Note: Authentication is required for all API calls.
## Player Mapping
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/players/id_mappings.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/players/id_mappings.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/players/id_mappings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Player Mappings.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/players/id_mappings.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Player Mappings use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/player_mappings.xsd
## Player Seasonal Statistics
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/players/statistics.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/sr:season:47694/players/statistics.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/players/statistics.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Player Seasonal Statistics.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/`{season_id}`/players/statistics.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `your_api_key` | Your API key. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Player Seasonal Statistics use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_players_statistics.xsd
## Season Mappings
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/id_mappings.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/id_mappings.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/id_mappings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Season Mappings.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/id_mappings.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Season Mappings use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_mappings.xsd
## Season Summaries
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/summaries.xml?start=0&limit=100?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/sr:season:47694/summaries.xml?start=0&limit=100?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/summaries.xml?start=0&limit=100?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Season Summaries.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/`{season_id}`/summaries.`{format}`?start=`{starting_result}`&limit=`{result_limit}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `your_api_key` | Your API key. |
| `format` | xml or json. |
| `starting_result` | Integer of the starting result starting from 0. |
| `result_limit` | Integer of the result limit per API call. Used for pagination, we suggest calling 100 results at a time. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Season Summaries use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_summaries.xsd
## Seasons
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Seasons.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Seasons use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/seasons.xsd
## Standings
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/standings.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/sr:season:47694/standings.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/standings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Standings.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/`{season_id}`/standings.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `season_id` | Id of a given season. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for Standings use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_standings.xsd
## Team Mappings
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/teams/id_mappings.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/teams/id_mappings.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/teams/id_mappings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Team Mappings.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/teams/id_mappings.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for Team Mappings use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/team_mappings.xsd
## Team Profiles
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/team_profiles.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/sr:season:47694/team_profiles.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/team_profiles.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Team Profiles.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/`{season_id}`/team_profiles.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `your_api_key` | Your API key. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Team Profiles use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_team_profiles.xsd
## Team Seasonal Statistics
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/teams/statistics.xml?api_key={your_api_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
```
```python
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/historical/nba/trial/v1/en/seasons/sr:season:47694/teams/statistics.xml?api_key={your_api_key}")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
```shell
curl -X GET "https://api.sportradar.com/historical/nba/trial/v1/en/seasons/sr:season:47694/teams/statistics.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Team Seasonal Statistics.
https://api.sportradar.com/historical/nba/`{access_level}`/`{version}`/`{language_code}`/seasons/`{season_id}`/teams/statistics.`{format}`?api_key=`{your_api_key}`
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `version` | Version number of the API you are accessing (Current Version: v1). |
| `language_code` | Two letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `your_api_key` | Your API key. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Team Seasonal Statistics use the following URL.
https://schemas.sportradar.com/bsa/historicalnba/v1/xml/endpoints/historicalnba/season_teams_statistics.xsd
## Frequently Asked questions
Q: What format are date fields presented in?
A: When we present date only values we present these in the ISO 8601 standard format.
ex: 2013-04-03
We use these for attributes that have date and no time (such as birthdate). For more information: https://en.wikipedia.org/wiki/ISO_8601
Q: What format are the date/time fields presented in?
A: All of our Date/Time attributes are in UTC, presented in the ISO 8601 standard format.
ex: 2013-04-03T18:15:00+00:00
For more information: https://en.wikipedia.org/wiki/ISO_8601
Q: What are the valid match status values?
A: Here are the valid match status values and their definitions:
not_started – The match is scheduled to be played
postponed – The match has been postponed to a future date
delayed – The match has been temporarily delayed and will be continued
canceled – The match has been canceled and will not be played
ended – The match is over
closed – The match results have been confirmed.
Q: What are the valid tournament type values?
A: Here are the valid tournament types:
group
cup
Q: What are the possible outcomes?
A: Different markets have different outcomes. The available markets are currently:
home_team_winner
away_team_winner
draw
Q: Why is there a limit on the number of match summaries in the Limit param?
A: Due to the amount of data, the maximum limit requested should be 100 to avoid server errors
Q: What is the purpose of the player mapping feeds?
A: These are to overcome the different IDs between Official, Classic and Global basketball IDS for players, teams, seasons and venues. The single ID should be SRIDs in the format: “sr:variable:int” eg: <player id="sr:player:1307222" name="Jordan, Michael">