Note: Authentication is required for all API calls.
## Competitor Profile
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/horseracing/trial/v2/en/competitors/sr:competitor:568029/profile.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", "/horseracing/trial/v2/en/competitors/sr:competitor:568029/profile.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/horseracing/trial/v2/en/competitors/sr:competitor:568029/profile.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Competitor Profiles.
https://api.sportradar.us/horseracing/`{access_level}`/`{version}`/`{language_code}`/profile.`{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: v2). |
| `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
## Season Schedule
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/horseracing/trial/v2/en/sport_events/sr:stage:523540/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", "/horseracing/trial/v2/en/sport_events/sr:stage:523540/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/horseracing/trial/v2/en/sport_events/sr:stage:523540/schedule.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the Season Schedule.
https://api.sportradar.us/horseracing/`{access_level}`/`{version}`/`{language_code}`/sport_events/`{stage_id}`/schedule.`{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: v2). |
| `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `stage_id` | Stage id of a given season. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
## Seasons
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/horseracing/trial/v2/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", "/horseracing/trial/v2/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.us/horseracing/trial/v2/en/seasons.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the list of available seasons.
https://api.sportradar.us/horseracing/`{access_level}`/`{version}`/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: v2). |
| `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
## Sport Event Summary (Event)
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/horseracing/trial/v2/en/sport_events/sr:stage:523542/summary.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", "/horseracing/trial/v2/en/sport_events/sr:stage:523542/summary.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/horseracing/trial/v2/en/sport_events/sr:stage:523542/summary.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the summary of an event.
https://api.sportradar.us/horseracing/`{access_level}`/`{version}`/`{language_code}`/sport_events/`{stage_id}`/summary.`{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: v2). |
| `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `stage_id` | Stage id of a given event. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
## Sport Event Summary (Season)
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/horseracing/trial/v2/en/sport_events/sr:stage:523540/summary.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", "/horseracing/trial/v2/en/sport_events/sr:stage:523540/summary.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/horseracing/trial/v2/en/sport_events/sr:stage:523540/summary.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
This endpoint retrieves the summary of a season.
https://api.sportradar.us/horseracing/`{access_level}`/`{version}`/`{language_code}`/sport_events/`{stage_id}`/summary.`{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: v2). |
| `language_code` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). |
| `stage_id` | Stage id of a given season. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
## Frequently Asked Questions
Q: What competitions can be found in the API?
A: We currently cover the Triple Crown and Breeders' Cup.
Q: How far back does the data go?
A: Only the current season.
Q: Are events covered live?
A: No, all results are entered post-event. Results are expected 1-2 hours after the race has completed.
Q: What statistics are in the API?
A: Only time, positions, posts, and lengths where applicable.
Q: When are the competitor lists added to the sport event summaries?
A: Up to a few minutes before the event is run.
Q: How do I know which endpoints to hit?
A: There are only three endpoint "types": Profiles, season-based, and sport event-based. If the variable ID is stage based, you need to check the stage node to see what type it is. If type="season" that ID is only designed to be placed in the season based endpoints. However, if you place a season ID in the sport_event summary endpoint it will return the results at a season level. Every other stage ID including season, or events can be used on the sport_event summary to get results for that stage.
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 possible stage types that I can expect in the feeds?