## Odds Comparison API Overview
The Odds Comparison API provides aggregated odds data for pre-match, outrights, and consensus lines.
The API is consistent in structure, format, and behavior with the other General Sport APIs. Primary feeds will return books, categories, sports, and tournaments offered.
Additional feeds provide an array of supplementary odds breakdowns, including:
Daily schedules
Outrights by category
ID mapping
API
API Version
Odds Comparison Regular
v1
Note: Authentication is required for all API calls.
## Available Markets
See below for all available markets within this API.
Odds Type Id
Market Name
1
2way
2
3way
3
total
4
spread
4
run_line
5
handicap
5
asian_handicap
100
first_team_to_score
102
1x2_half_time
103
both_teams_to_score
104
first_team_to_get_corner
108
odd_even_goals
109
double_chance
110
draw_no_bet
## Odds Comparison API Map
To best utilize the Odds Comparison API, you will need several parameters to create your API calls. The map below illustrates how you can obtain the parameters you need.
>
Examples:
>To find the Category Outright odds for Estonia:
>
Call the Categories endpoint and find Estonia
Take note of the "category - id"
Call the Category Outrights endpoint using the category id.
>The outright odds for Estonia are displayed.
>
>To find the schedule for Golf:
>
Call the Sports endpoint and find Golf
Take note of the "sport - id"
Call the Daily Sport Schedule endpoint using the sport id and desired date.
>The schedule for Golf is displayed.
Primary feeds don't require any parameters, while other feeds may require dates, IDs or other human-readable parameters to identify the category, sport, sport event or tournament that the feed will describe. The primary feeds provide IDs for categories, sports and tournaments. Note that unix_timestamp (used in Sport Event Change Log) is not human readable parameter.
Mapping feeds provide a list of IDs for players, seasons, sport events, teams, tournaments, and venues which are mapped between US IDs and Sportradar IDs. The mapping feeds have a limit of 30,000 results per page. To get additional results you need to use the optional query string parameters “start” and “limit” which are detailed in the affected feeds below.
## Books
Returns a list of configured bookmakers and their IDs.
TTL / Cache:
30 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/books.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", "/oddscomparison-rowt1/en/us/books.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/oddscomparison-rowt1/en/us/books.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this.
Access the Books feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/books.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Books use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/books.xsd
Return to top
## Categories
Returns a list of categories where outrights exist.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/categories.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", "/oddscomparison-rowt1/en/us/categories.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/oddscomparison-rowt1/en/us/categories.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Categories feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/categories.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Categories use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/categories.xsd
Return to top
## Category Outrights
Returns a list of outrights, competitors and their odds for a given category ID.
TTL / Cache:
60 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/categories/sr:category:1/outrights.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", "/oddscomparison-rowt1/en/us/categories/sr:category:1/outrights.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/oddscomparison-rowt1/en/us/categories/sr:category:1/outrights.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Category Outrights feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/categories/`{category_id}`/outrights.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `category_id` | ID of a given category. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Outrights by Category use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/category_outrights.xsd
Return to top
## Daily Sport Schedule
Returns a list of sport events for a given sport ID and date that have odds available.
TTL / Cache:
60 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sports/sr:sport:1/2017-06-30/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", "/oddscomparison-rowt1/en/us/sports/sr:sport:1/2017-06-30/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.com/oddscomparison-rowt1/en/us/sports/sr:sport:1/2017-06-30/schedule.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Daily Sport Schedule feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sports/`{sport_id}`/`{date}`/schedule.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `sport_id` | ID of a given sport. |
| `date` | Date in the following format: YYYY-MM-DD |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Daily Sport Schedule use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sport_schedule.xsd
Return to top
## Player Mapping
Provides player ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/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", "/oddscomparison-rowt1/en/eu/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/oddscomparison-rowt1/en/eu/players/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Player Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/players/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
### Optional Query String Parameters
>Example including optional query string parameters:
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/oddscomparison-rowt1/en/eu/players/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/oddscomparison-rowt1/en/eu/players/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000'
In addition to the URL parameters listed above, you can paginate the player information with one or more of the following optional query string parameters.
Note: Optional query string parameters must be added after your API key with an ampersand (&).
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `start` | Number to start the list of results from. Example: start=0 |
| `limit` | Number to limit the number of results. Minimum value is 1, maximum value is 30000. Example: limit=30000 |
Return to top
## Season Mapping
Provides season ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/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", "/oddscomparison-rowt1/en/eu/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/oddscomparison-rowt1/en/eu/seasons/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Season Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/seasons/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to top
## Sport Categories
Returns a list of categories for a sport ID that have outrights available.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sports/sr:sport:1/categories.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", "/oddscomparison-rowt1/en/us/sports/sr:sport:1/categories.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/oddscomparison-rowt1/en/us/sports/sr:sport:1/categories.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sport Categories feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sports/`{sport_id}`/categories.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `sport_id` | ID of a given sport. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Sport Categories use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sport_categories.xsd
Return to top
## Sport Event Change Log
Returns a list of sport events where odds have changed including changed odds values and possible sport event changes.
TTL / Cache:
60 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sport_events/1498814700/changelog.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", "/oddscomparison-rowt1/en/us/sport_events/1498814700/changelog.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/oddscomparison-rowt1/en/us/sport_events/1498814700/changelog.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sport Event Change Log feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sport_events/`{unix_timestamp}`/changelog.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `unix_timestamp` | Unix epoch time. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Sport Event Change Log use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sport_events_changelog.xsd
Return to top
## Sport Event Mapping
Provides sport event ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/sport_events/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", "/oddscomparison-rowt1/en/eu/sport_events/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/oddscomparison-rowt1/en/eu/sport_events/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sport Event Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sport_events/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
### Optional Query String Parameters
>Example including optional query string parameters:
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/oddscomparison-rowt1/en/eu/sport_events/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/oddscomparison-rowt1/en/eu/sport_events/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000'
In addition to the URL parameters listed above, you can paginate the sport event information with one or more of the following optional query string parameters.
Note: Optional query string parameters must be added after your API key with an ampersand (&).
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `start` | Number to start the list of results from. Example: start=0 |
| `limit` | Number to limit the number of results. Minimum value is 1, maximum value is 30000. Example: limit=30000 |
Return to top
## Sport Event Markets
Returns a list of markets and odds for a given match.
TTL / Cache:
60 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sport_events/sr:match:10151323/markets.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", "/oddscomparison-rowt1/en/us/sport_events/sr:match:10151323/markets.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/oddscomparison-rowt1/en/us/sport_events/sr:match:10151323/markets.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sport Event Markets feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sport_events/`{sport_event_id}`/markets.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `sport_event_id` | ID of a given sport event. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Sport Event Markets use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sport_event_markets.xsd
Return to top
## Sport Tournaments
Returns a list of tournaments for a given sport ID that have schedules available.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sports/sr:sport:6/tournaments.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", "/oddscomparison-rowt1/en/us/sports/sr:sport:6/tournaments.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/oddscomparison-rowt1/en/us/sports/sr:sport:6/tournaments.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sport Tournaments feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sports/`{sport_id}`/tournaments.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `sport_id` | ID of a given sport. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for Tournaments by Sport use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sport_tournaments.xsd
Return to top
## Sports
Returns a list of sports and sport IDs.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/sports.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", "/oddscomparison-rowt1/en/us/sports.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/oddscomparison-rowt1/en/us/sports.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Sports feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/sports.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for Sports use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/sports.xsd
Return to top
## Team Mapping
Provides team ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/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", "/oddscomparison-rowt1/en/eu/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/oddscomparison-rowt1/en/eu/teams/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Team Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/teams/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to top
### Optional Query String Parameters
>Example including optional query string parameters:
import http.client
conn = http.client.HTTPSConnection("api.sportradar.us")
conn.request("GET", "/oddscomparison-rowt1/en/eu/teams/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/oddscomparison-rowt1/en/eu/teams/id_mappings.xml?api_key={your_api_key}&start=0&limit=30000'
In addition to the URL parameters listed above, you can paginate the team information with one or more of the following optional query string parameters.
Note: Optional query string parameters must be added after your API key with an ampersand (&).
Replace placeholders with the following query parameters:
| Parameter | Description |
| --------- | ----------- |
| `start` | Number to start the list of results from. Example: start=0 |
| `limit` | Number to limit the number of results. Minimum value is 1, maximum value is 30000. Example: limit=30000 |
Return to top
## Tournament Mapping
Provides tournament ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/tournaments/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", "/oddscomparison-rowt1/en/eu/tournaments/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/oddscomparison-rowt1/en/eu/tournaments/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Tournament Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/tournaments/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to top
## Tournament Schedule
Returns a list of scheduled sport events by tournament.
TTL / Cache:
1 second
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/tournaments/sr:tournament:234/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", "/oddscomparison-rowt1/en/us/tournaments/sr:tournament:234/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.com/oddscomparison-rowt1/en/us/tournaments/sr:tournament:234/schedule.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Tournament Schedule feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/tournaments/`{tournament_id}`/schedule.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `tournament_id` | ID of a given tournament. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Tournament Schedule use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/tournament_schedule.xsd
Return to top
## Tournaments
Returns a list of tournaments and their IDs.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/us/tournaments.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", "/oddscomparison-rowt1/en/us/tournaments.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/oddscomparison-rowt1/en/us/tournaments.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Tournaments feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/tournaments.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for Tournaments use the following URL.
https://schemas.sportradar.com/bsa/v1/endpoints/oddscomparison/tournaments.xsd
Return to top
## Venue Mapping
Provides venue ID mapping between League Specific and General Sport ID types.
TTL / Cache:
600 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/oddscomparison-rowt1/en/eu/venues/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", "/oddscomparison-rowt1/en/eu/venues/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/oddscomparison-rowt1/en/eu/venues/id_mappings.xml?api_key={your_api_key}"
```
> This feed returns xml structured like this for row (Rest of World) markets.
> This feed returns xml structured like this for us (US) markets.
Access the Venue Mapping feed by replacing the parameters in the following URL:
https://api.sportradar.us/oddscomparison-`{package}{access_level}{version}`/`{language_code}`/`{odds_format}`/venues/id_mappings.`{format}`?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `package` | Defines the package you are accessing as US (us) or Rest of World (row). |
| `access_level` | Defines the access level of your API key as Production (p) or Trial (t). |
| `version` | Version number of the API you are accessing (Current Version: 1). |
| `language_code` | Supported Locales |
| `odds_format` | Odds type in 2 letter format: American (us), Fractional (uk), or Decimal (eu). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to top
## Frequently Asked Questions
Q: What format are date fields presented in?
A: All of our Date/Time attributes are in either UTC (ISO-8601) or Unix Time (Epoch Time).
UTC Example: 2013-04-03T18:15:00+00:00
Unix Example: 1505844490
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 sports are covered?
A: The sports coverage varies depending on configured bookmakers offering in that particular point in time. To get a list of available sports call the Sports endpoint.
Q: What tournaments are covered?
A: The tournament coverage varies depending on configured bookmakers offering in that particular point in time. To get a list of all the tournaments call the Tournaments endpoint. Alternatively, you may call the Sports Tournaments endpoint to get a list of all the tournaments for a given sport.
Q: Does it have live odds?
A: Yes, there are live consensus odds available, and pre-match odds data.
Q: How long are odds stored and provided?
A: Odds are removed from all endpoints after 24 hours of their completion. This will include competition and sport event information.
Q: How frequently are the odds updated?
A: Update frequency varies between different bookmakers. The API checks for odds changes every 60 seconds and updates them as soon as changes are found in our system. Note that we will not update the "last_updated" timestamp if there are no odds changes found when running the check.
Q: What endpoint should be used to retrieve odds?
A: There are several endpoints through which you can retrieve odds - their usage depends on the particular use case.
Tournament Schedule - returns a list of scheduled sport events and main markets for a given tournament ID. To get a list of all tournaments call the Tournaments or Sports Tournaments endpoint.
Sport Schedule - returns a list of scheduled sport events and main markets for a given sport ID and date. To get a list of all sports call the Sports endpoint.
Sport Event Markets - returns all available markets for a given match ID. To get a list of sport events call the Tournament Schedule or Sport Schedule endpoints.
Category Outrights - returns a list of outrights, outright competitors and their winning odds for a given category ID. To get a list of all the categories containing outright odds, call the Sport Categories endpoint.
Sport Events Change Log - returns a list of all the sport events where odds have changed including changed odds values and possible sport event changes.
Q: How do you retrieve all possible results from the mapping feeds?
A: The mapping feeds have a limit of 30,000 results per page. To get additional results you need to use the optional query string parameters “start” and “limit”. Optional query string parameters must be added after your API key with an ampersand (&). For example: https://api.sportradar.us/oddscomparison-rowt1/en/eu/sport_events/id_mappings.xml?api_key={your_api_key}&start=30000&limit=30000
Q: How do you indicate when a bookmaker withdraws a match odds or outright competitor odds?
A: Removed markets are indicated with "removed" flag as shown below
A: The Sport Event Change Log endpoint returns a list of all the sport events where odds have changed including the changed odds values. It takes a Unix timestamp in UTC as a URL input parameter and must be between current UTC time -15min and current UTC time. To avoid empty responses it's suggested to request this endpoint with regular frequency that should not be less than 60 seconds and should be few seconds smaller than Unix timestamp not to miss any odds changes and to account for the document generation time.
ex: Requesting Sport Event Change Log endpoint every 110 seconds with Unix timestamp of current UTC time - 120 seconds.
This endpoint also displays newly published matches, removed markets, and possible match scheduled time and status changes. It will not include matches and/or markets where odds values have remained unchanged.
Q: What markets are currently available?
A: Only main markets (2way, 3way, total, spread, handicap, and asian handicap), exchange odds, and outright odds are currently available. Special bet markets will become available at a later time.
Q: What is an outright?
A. Outrights (also known as Futures) are a flexible odds type that covers any variety of events where you have two or more competitors trying to win the same event. The event does not even have to be a physical match of any kind for instance: “Who will win the Formula 1 Drivers Championship this year?” for which there is a long list of competitors, each with their odds for winning this outright.
Q: What is a consensus line?
A: Consensus line is the most balanced line, calculated from the primary lines from configured bookmakers. There are six consensus lines that we calculate (Spread, Spread Live, Total, Total Live, Moneyline, and Moneyline Live). Each of these will display information about the opening and the current consensus line.
Consensus lines are available across all sports but their presence depends on availability of primary lines from configured bookmakers – for instance when none of the configured bookmakers is offering “Spread” odds for a particular match, the opening and current consensus spread line will not be present.
Consensus lines are sport-dependent, which means that for Soccer the Moneyline is calculated based on 3way odds and will have three outcomes for home, draw and away odds. In the case of Basketball the Moneyline is calculated based on 2way odds and will have only two outcomes for home and away odds.
Consensus spread line in Ice Hockey is generally known as the “puck line” and in Baseball it’s known as the “run line”. In the API it will be named accordingly.
Q: What is a consensus pick?
A: Consensus pick shows a percentage of bets placed on each side of the primary line. Having primary line odds does not automatically guarantee that a pick will be present. Consensus picks are included when Sportradar has information about bets being placed on specific primary line
Q: What are the possible values for “line – name”?
A: Line names can vary by sport, and not all values may be available for all sports or events. The possible values for “line – name” are:
moneyline_current
moneyline_live
moneyline_open
puck_line_current
puck_line_open
run_line_current
run_line_open
spread_current
spread_live
spread_open
total_current
total_live
total_open
Q: What are the possible values for “sport_event - status”?
A: The possible values for “sport_event – status” are:
not_started – The match is scheduled to be played
started - The match has begun
live – The match is currently in progress
postponed – The match has been postponed to a future date
suspended - The match has been suspended
match_about_to_start - The match is about to begin
delayed – The match has been temporarily delayed and will be continued
interrupted - The match began, but coverage has stopped for a short time. Note that match scores may not be updated during this period, the last recorded match score will be displayed instead
cancelled – The match has been cancelled and will not be played
ended – The match is over
closed – The match results have been confirmed
Q: Which sports/leagues feature consensus bet percentage outcomes?
A: Bet percentage outcomes (bet_percentage_outcomes) are currently available for NFL, NHL, NBA and MLB only.
Q: Why would a player ID (ex. sr:player:830531) appear more than once in the Player Mappings endpoint?
A: A player may appear in multiple APIs with a separate ID unique to that API. For example, multiple ID mapping entries could occur from the American Football API to the NFL, NCAA Men’s Football, or USFL APIs.
Q: How do I locate the TTL (Time to Live)/cache on an API endpoint?
A: The cache (in seconds) can be accessed in the returned header information on each RESTful API call, under cache-control.
ex. cache-control: max-age=1, public, s-maxage=1 or cache-control: public, must-revalidate, max-age=120