NBA API Basics
Learn important structural concepts of the NBA API
Intro
Sportradar's NBA data is delivered as a RESTful B2B (Business-to-Business) API. HTTP requests are made using the API authentication access established in your account.
Data can be returned in either JSON or XML format.
Technical Requirements
To accept data from our API feeds, ensure that your application:
- Supports TLS 1.2 or above
- Can follow an HTTP redirect (used in Push and the Images API)
API Style
The NBA API is a Sportradar Leagued-Based API. This means it was designed specifically for the sport of basketball, and an aim to provide our media customers with in-depth, intuitive, and speedy NBA statistics.
We provide five additional basketball data APIs: WNBA, NCAA Men's Basketball, NCAA Women's Basketball, G-League, and Global Basketball.
All of the Basketball APIs except for Global Basketball have a similar structure to the NBA, with the only differences being those necessitated by the league structures themselves. For example, Rankings data in the NBA behaves differently than RPI Rankings in NCAA Men's Basketball.
The Global Basketball API is a separate structure, adhering to our General Sport API format. Integration with the "Global" API will not be covered in this guide.
Data Collection
Supported by the NBA as the Official Source, data is collected by on-venue statisticians and monitored by Sportradar's in-house data entry team.
Versioning
The current version of the NBA API is v8. We strongly recommend using the latest version of all of our APIs, as these will be the most stable and robust offerings. However, we do support up to 3 versions (the current and 2 past versions) of our data APIs, per our Versioning Policy.
To access NBA v8, simply use v8
in each request to the API in the version
parameter. To access previous versions, alter to v7
or v5
. No other adjustment is necessary for access.
Data Flow and Retrieval
The NBA API organizes its data into logical endpoints, or feeds. For example, to access a team schedule you will want to retrieve a "schedule" feed like Schedule; to access a game, you will want to retrieve a "game" feed like Game Play-by-Play or Game Summary.
The API is separated into 36 distinct feeds, each with a focused purpose to allow for efficient data retrieval. Depending on your specific need, different feeds and pull frequencies will be needed. Use our NBA Endpoints section for feed documentation and an interactive sandbox.
Most feeds will require the inclusion of a unique id or parameter. Parameters can range from: season type, season year, game id, player id, or team id. To retrieve these unique Ids you may have to iterate through feeds with larger data sets. See our ID Handling section for more info on Sportradar Ids.
Here is a retrieval path for a player profile.
Step 1
Step 2
Step 3
All NBA API feeds will follow this pulling logic. Visit our Integration Scenarios section for specific retrieval scenarios.
You can also reference our NBA API Map to get a sense of how the entire API is interconnected.
RESTful & Push
Most of our NBA endpoints are RESTful, but we also include complementary Push feeds available to Realtime customers.
With RESTful feeds, a request must be made whenever a data update is needed. For our Push feeds, one request will open up a streaming connection. Data is then delivered in a continuous stream indefinitely.
Push feeds correlate to the RESTful endpoints, but are not necessarily 1:1 in parity. For example, the Push Events feed follows the same format, and includes nearly all the same data, as the Game Play-by-Play RESTful endpoint. And Push Statistics correlates to Game Summary.
For increased data speed, and less API requests, many customers use Push. Though it is important to note that Push feeds are not meant to replace the RESTful data, but to enhance it. RESTful feeds should always be used as the backbone of the NBA API.
See our Push Feeds section for more info.
Change Log
The NBA API includes a Daily Change Log feed, which is used to catch updates for teams, players, game stats, schedules, standings, and rankings.
A request is made for a specific date, which then returns a list of unique Ids and timestamps of updates on that day. You can then use these Ids to retrieve stat updates from other endpoints. This allows for quick and efficient data retrieval, and will be a common concept across all integration scenarios.
See our advanced Change Log guide for detail on how to efficiently leverage this feed.
Pagination
The NBA API does not currently make use of pagination for any endpoint. Each return will provide all data available.
Additional Integration Options
Postman Workspace
Our entire Media APIs are available on Postman. Click the link above to be taken directly to our NBA API v8 collection.
Feel free to follow and/or fork this collection to retrieve updates.
Schema Download
Open the zip file below to access our entire NBA API XSD schema.
More Questions?
Check our NBA API FAQ or reach out to our support team at [email protected]
Updated 21 days ago