Download the PHP package corbpie/nbalive without Composer

On this page you can find all versions of the php package corbpie/nbalive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nbalive

NBA API Wrapper

A PHP 8.3+ library for accessing NBA API endpoints — live games, box scores, play-by-play, standings, player stats, and more. Responses are normalized into readable arrays (and typed DTOs where available) so you get clean data without parsing raw API payloads yourself.

[Generic badge]()

[Generic badge]()

[Generic badge]()


Table of contents / index


Installing

Install with Composer:

Requirements

How it works

Every NBA endpoint is a class under the Corbpie\NBALive namespace. Each class:

  1. Extends NBABase and implements FetchableEndpoint
  2. Exposes a fetch() method that calls the NBA API and populates public properties
  3. Normalizes raw API responses into easy-to-use arrays (and typed DTOs where available)

Two API sources are used:

Source Used for Example
cdn.nba.com Live data (box scores, play-by-play, scoreboard) NBABoxScore, NBAToday
stats.nba.com Historical stats, standings, player data NBAStandings, NBAPlayerCareer

Fetching data

All endpoints use a consistent fetch() pattern. Constructors still auto-fetch for backward compatibility when you pass parameters, but the recommended approach is to configure properties and call fetch() explicitly.

Explicit fetch (recommended):

Constructor auto-fetch (still supported):

Lazy fetch with game ID endpoints:

Error handling

API failures throw NBAApiException. Transport errors (timeouts, cURL failures) and invalid JSON are also surfaced as exceptions.

Debugging

After any API call, debug metadata is available on the endpoint instance:

Custom HTTP client

Inject a custom HTTP client for testing, custom timeouts, or swapping the transport layer. All endpoint constructors accept an optional NbaHttpClientInterface as the last argument.

Available HTTP classes:

Class Purpose
CurlNbaHttpClient Default cURL transport (10s connect / 30s total timeout)
CachingNbaHttpClient PSR-16 caching decorator (see below)
NbaHttpResponse Immutable response DTO returned by the client

For unit tests, mock the client:

Response caching

Wrap any HTTP client with CachingNbaHttpClient to cache successful responses. Pass any PSR-16 CacheInterface implementation (Redis, filesystem, in-memory, etc.).

Suggested TTLs:

Data type Suggested TTL
Standings, rosters 5–15 minutes
Live box scores, play-by-play 5–15 seconds
Historical stats, career data 1–24 hours

Typed DTOs

Selected endpoints expose readonly DTO objects alongside the legacy array properties. DTOs provide typed access; toArray() returns the same shape as the array properties for backward compatibility.

Endpoint DTO property Array property DTO class
NBATeamGameLogs $gameLogs $games TeamGameLog
NBAStandings $standingEntries $standings TeamStanding
NBALeagueGameFinder $gameEntries $games LeagueGameEntry

Explicit fetch()

All endpoints now expose a fetch() method. Constructors still auto-fetch for backward compatibility when parameters are provided, but you can also configure properties and call fetch() manually:

Helpers

Season and utility constants on NBABase:

Testing & development

CI runs on GitHub Actions against PHP 8.3 and 8.4.

Todays games and live

Game time seconds formatted (Helper function)

Outputs

Boxscore

NBA API Live CDN box score version.

Team example:

Play by play

Play by play V3

Play by play V2

Play by play V1

Play by play clips

Traditional box score

Defensive box score

Box score matchups

Scoring box score

Misc box score

Usage box score

4 factors box score

Advanced box score

Tracking box score

Team lineups

Team Dash pts shots

Game rotations

Outputs

Team year over year

Standings

League game log

Team info

Team game logs

Team franchise players

Schedule

Output

Hustle box score

Team array output

Game summary

Output for $sum->away

Team roster

League leaders

Player year over year

Player on off

Output for $on_off->player_only

Player shooting

Player data

Details:

Player awards

Player career

Playoff brackets

Playoff picture

Playoff series

Team

Teams years

Outputs

League player match ups

League player shot locations

League player shots

Video events

Player game logs

Player compare

Player next games

Player vs player

Player index

Shot chart

Draft history

Draft combine

Franchise history

Franchise leaders

All-time leaders

Team historical leaders

Team dashboard

Win probability

Player clutch stats

Team clutch stats

League hustle stats

League game finder

Player fantasy profile

Team game streak finder

Player estimated metrics


All versions of nbalive with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package corbpie/nbalive contains the following files

Loading the files please wait ...