Documentation
Once you have your keys, you need to understand how to call the Sportradar APIs. You don't need to write any code to get started. Instead, you can use our API Sandbox to test those calls against our live sports data.
To use the API Sandbox:
- Select the API you want to view from the dropdown.
- Enter your API key in the field.
- Select your desired feed and adjust the parameters to your needs.
- Click Try It.
Use the navigation to the left to select the documentation for your desired sport. Detailed documentation and code examples are included for each API endpoint. View code examples in the area to the right. You can switch the programming language of the examples with the tabs in the top right. ## Authentication > Below is an example call to the NFL API v5 using API key authentication: ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/nfl/official/trial/v5/en/games/2019/reg/schedule.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", "/nfl/official/trial/v5/en/games/2019/reg/schedule.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.us/nfl/official/trial/v5/en/games/2019/reg/schedule.xml?api_key={your_api_key}" ``` > You must replace {your_api_key} with your API key. If you have upgraded from a trial key, be sure to change the access_level in the URL to reflect your production key. See the required parameters for the API for details. Sportradar APIs use authentication keys to allow access to the API. Each API requires its own separate key, and the key must be included in each request. To authenticate with the server, replace {your_api_key} with your API key. You can register for free API trial keys at our [developer portal](https://developer.sportradar.com/member/register).
You must replace {your_api_key} with your API key. If you have upgraded from a trial key, be sure to change the access_level in the URL to reflect your production key. See the required parameters for the API for details. |
These GUIDs may appear as an “id” or a “us_id” in various APIs, or both values may be present.
Example:
**SR IDs**: These IDs can have a varying structure but always begin with "sr:" and end with a number.
Example:
These IDs may appear as an “id” or a “sr_id” in various APIs.
Example:
Note: The sr_id is an optional value in the US APIs and it’s strongly encouraged to utilize the GUIDs as your primary key. |
**Reference IDs & Entity IDs**: Normally accompanied by an origin attribute that describes where the ID is linked to. For instance, NFL GSIS data may have an ID for a given player, we include that ID as a reference ID. Entity IDs perform the same function, but only appear in our Images and Editorial Content APIs.
Reference ID Example:
Entity ID Example:
### Notes Regarding IDs
Some IDs are displayed in different ways in different places along logical lines. For instance, some endpoints display a “team – id” to reference the teams that are competing in a specific sport event, but the team id may also be used to reflect a home team “home – id”, away team “away – id”, or an event winner “sport_event_status - winner_id”.
Another instance of this occurs frequently with “player – id” referencing the player, but the ID may also appear in event information to reflect player as a goal scorer “scorer – id”, or as providing an assist “assist – id”.
With various forms of IDs in the Sportradar APIs, some duplication can occur. For instance, a venue that is used by both the NBA and NBA G League may have multiple venue GUID IDs and/or SR IDs.
Similarly, a college player may have a GUID ID and/or SR ID that is different if they have joined a professional league.
Tournament IDs and Season IDs are interchangeable when calling Tournament endpoints. This is done so you are able to access a previous seasons data. To do this:
- Interrogate the Tournaments Seasons endpoint to ascertain the required Season ID.
- Use that Season ID to call any of the Tournament endpoints.
- Interrogate the Competitions List endpoint to ascertain the required Competition ID.
- Use that Competition ID to call the Competition Seasons endpoint and locate your desired Season ID.
- Use that Season ID to call any of the Season endpoints.
Live Data Simulations
The simulations for each sport replay full games in the order listed in the tables below. Feeds update with game data as it plays. For instance, when a play completes in the play-by-play feed, the game statistics feed updates as well. This allows you to see how each API feed changes over the course of the game. If you need assistance in utilizing these simulations, please contact Sportradar Support.NFL API Simulations
Below are the details regarding the simulations for our NFL Official API (v5) The live simulations give you the opportunity to test your code against a simulation of live data before the preseason starts or any time! Our simulation system replays select completed games allowing you to view our API feeds as if they were happening live. Below are the details regarding the simulations for our NFL API (v5) Simulations run twice a day at the following times (Eastern Time): 11:00 am/11:00 pm - Data is reset for the day’s simulations1:00 pm/1:00 am - PST week 1 games will run – Minnesota at New Orleans, Seattle at Philadelphia, Buffalo at Houston, and Tennessee at New England
3:00 pm/3:00 am – PST week 2 games will run - Minnesota at San Francisco, Houston at Kansas City, Tennessee at Baltimore, and Seattle at Green Bay
5:00 pm/5:00 am – PST week 3 games will run – Tennessee at Kansas City and Green Bay at San Francisco
7:00 pm/7:00 am – PST week 4 games will run – San Francisco vs Kansas City
By retrieving the Season Schedule feed for the 2019 postseason, you can obtain the game ID for each game listed above. All pull-based feeds are available for simulation. Simulations of push delivery are available for the Push Statistics and Push Event feeds, but we are currently unable to provide the Push Clock as a simulation. If you have an existing API key, simply replace the access_level (trial or production) in the URL of a feed with simulation.
NCAAFB API Simulations
Below are the details regarding the simulations for our NCAAFB API (v1)Feeds Available: Weekly Schedule, Season Schedule, Game Statistics, Game Summary, Play-By-Play, Play Summary, Boxscore, Extended-Boxscore, Game Roster, Team Hierarchy, Team Roster, Standings, Seasonal Statistics
Event Description | Season | Week | Example Play-By-Play Feed Path ----------------- | ------ | ---- | ------------------------------ WKY@MSH | 2015/REG | 1 | http://api.sportradar.us/ncaafb-sim-t1/2015/REG/1/WKY/MSH/pbp.xml?api_key={your_api_key} KEN@FLA | 2015/REG | 1 | http://api.sportradar.us/ncaafb-sim-t1/2015/REG/1/KEN/FLA/pbp.xml?api_key={your_api_key} WOU@PRST | 2015/REG | 1 | http://api.sportradar.us/ncaafb-sim-t1/2015/REG/1/WOU/PRST/boxscore.xml?api_key={your_api_key}NBA API Simulations
Below are the details regarding the simulations for our NBA API (v7)Feeds Available: Schedule, Standings, League Hierarchy, Game Boxscore, Game Summary, Play-By-Play, Team Profile, Seasonal Statistics, Injuries, Push Events, and Push Statistics
Simulations run every day at the following times (UTC): 12:45 pm – Data is reset for day's simulations.1:00 pm – Chicago Bulls at New York Knicks & Brooklyn Nets at Portland Trail Blazers.
5:00 pm – Utah Jazz at Los Angeles Clippers, Philadelphia 76ers at Detroit Pistons, and Washington Wizards at Golden State Warriors.
7:00 pm – San Antonio Spurs at Los Angeles Lakers.
To retrieve the game IDs, team IDs, and other associated information for each game listed above, you can use the following URL with the syntax noted below: http://api.sportradar.us/nba/simulation/`{version}`/`{language_code}`/games/2017/SIM/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `version` | Version number of the API you are accessing (Current Version: v7). | | `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), and ja (Japanese). | | `format` | xml or json. | | `your_api_key` | Your API key. | Most relevant pull-based feeds are available for simulation. Simulations of push delivery are available for all feeds. If you have an existing API key, simply replace the access_level (trial or production) in the URL of a feed with simulation.
NCAAMB API Simulations
Below are the details regarding the simulations for our NCAAMB API (v3)Feeds Available: Schedule, Standings, League Hierarchy, Game Boxscore, Game Summary, Play-By-Play, Team Profile
Game Description | Season | Event / Game ID | Example Play-By-Play Feed Path ---------------- | ------ | --------------- | ------------------------------ AUB@CONN (Replay of 12/23/2016) | 2016/REG | 50251ac4-d083-4ada-a736-67db9e894196 | http://api.sportradar.us/ncaamb-sim3/games/50251ac4-d083-4ada-a736-67db9e894196/pbp.xml?api_key={your_api_key} PUC@PAC (Replay of 12/23/2016) | 2016/REG | db79b069-f4ff-4153-ab5a-86670df5d7ca | http://api.sportradar.us/ncaamb-sim3/games/db79b069-f4ff-4153-ab5a-86670df5d7ca/pbp.xml?api_key=={your_api_key}NCAAWB API Simulations
Below are the details regarding the simulations for our NCAAWB API (v3)Feeds Available: Schedule, League Hierarchy, Game Boxscore
Game Description | Season | Event / Game ID | Example Play-By-Play Feed Path ---------------- | ------ | --------------- | ------------------------------ ND@CONN | 2014/pst | bce4735f-2b3c-458d-bad5-0d3ff118738d | http://api.sportradar.us/ncaawb-sim3/games/bce4735f-2b3c-458d-bad5-0d3ff118738d/boxscore.xml?api_key={your_api_key}NHL API Simulations
Below are the details regarding the simulations for our NHL API (v7) Simulations run every day at the following times (UTC): 11:00 am - Data is reset for the day’s simulations.12:00 pm - Vancouver at Colorado, Chicago at Los Angeles, Minnesota at St. Louis
4:00 pm – Dallas at St. Louis, Calgary at New York
8:00 pm – Dallas at Detroit, Nashville at Colorado, Minnesota at Vancouver, Florida at Chicago
To retrieve the game IDs, team IDs, and other associated information for each game listed above, you can use the following URL with the syntax noted below: http://api.sportradar.us/nhl/simulation/`{version}`/`{language_code}`/games/`{year}`/`{month}`/`{day}`/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `version` | Version number of the API you are accessing (Current Version: v7). | | `language_code` | 2 letter code for supported languages: en (English), es (Spanish), fr (French), ru (Russian), and zh (simplified Chinese). | | `year` | Current year in 4 digit format (YYYY). | | `month` | Current month in 2 digit format (MM). | | `day` | Current day in 2 digit format (DD). | | `format` | xml or json. | | `your_api_key` | Your API key. |
Note: If the simulation URL requires a nhl_season, you must use the season type of SIM. |
Golf API Simulations
Below are the details regarding the simulations for our Golf API (v2)Feeds Available: Tournament Schedule, Tournament Summary, Tournament Leaderboard, Tournament Hole Statistics, Tee Times Per Round, Scorecards Per Round, Player Statistics
Tournament Description | Season | Tournament ID | Round | Example Leaderboard Feed Path ---------------------- | ------ | ------------- | ----- | ----------------------------- Scottish Open Simulation | 2015 | 57bdb770-e0b5-4344-ac24-21e059e1219e | all | http://api.sportradar.us/golf-sim-pga2-t2/leaderboard/pga/2015/tournaments/57bdb770-e0b5-4344-ac24-21e059e1219e/leaderboard.xml?api_key={your_api_key} Masters Simulation | 2015 | a2576743-9b52-41b8-be69-b16e73d3b94e | all | http://api.sportradar.us/golf-sim-pga1-t2/leaderboard/pga/2015/tournaments/a2576743-9b52-41b8-be69-b16e73d3b94e/leaderboard.xml?api_key={your_api_key} ## FAQs ### What is an API request? API stands for "Application Programming Interface." Basically, an API is how computers talk to each other to share data. Web applications will request data through an API, with the path and parameters provided defining what data is returned. ### How do I get started sampling feeds? You can get access to our complete set of data feeds by following these steps:- Register for a user account
- Register your application
- Navigate to My Account
- Select Get API Keys
Docs Navigation
- Documentation
- Football (Soccer)
- American Football
- Australian Rules Football
- Baseball
- Basketball
- Combat Sports
- Cricket
- Editorial Content
- eSports
- Golf
- Handball
- Hockey
- Images
- Core Insights
- Betting Insights
- All Insights
- Odds
- Racing
- Rugby
- Tennis
- Baseline Sports Coverage
- Badminton v2
- Badminton v1
- Bandy v1
- Curling v1
- Cycling v2
- Cycling v1
- Darts v2
- Darts v1
- Floorball v1
- Futsal v1
- Horse Racing v2
- Lacrosse v1
- Pesapallo v1
- Snooker v2
- Snooker v1
- Squash v1
- Table Tennis v2
- Volleyball (Beach) v2
- Volleyball (Beach) v1
- Volleyball (Indoor) v2
- Volleyball (Indoor) v1
- Waterpolo v1
- Winter Sports v1