Note: Authentication is required for all API calls.
## Cycling API Overview
The Cycling API provides schedules and results for top competitions. Data is collected via Sportradar operators and is available post-event. Select the Cycling package in our Coverage Matrix for competitions and data offered.
This API uses a descending, stage-based structure. By changing the stage ID, you can retrieve information on a sport, season, discipline, or event.
Additional feeds provide a host of complementary stats, including:
Rankings
Team and competitor profiles
Historical results
## Cycling v2 API Map
To best utilize the Cycling API, you will need several parameters to create your API calls. The map below illustrates how you can obtain the parameters you need.
>
Example:
>To find the results for a given race:
>
Call the Seasons resource for a list of seasons, making note of the Stage Id for your desired season
Call the Season Schedule using the Stage Id and locate your desired race
Call the Sport Event Summary using your race Stage Id
>The summary for your race is displayed.
The primary feeds require only a human-readable parameter to call the endpoints. Those feeds provide Stage Ids and Competitor Ids which can be used to generate the profile, summary, and schedule feeds.
## Competitor Merge Mappings
Provides the valid Sportradar Id in cases when two competitors have been merged into one. Mapping entries will remain in the feed for 7 days.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/competitors/merge_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.com")
conn.request("GET", "/cycling/trial/v2/en/competitors/merge_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/cycling/trial/v2/en/competitors/merge_mappings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Competitor Merge Mappings feed by replacing the parameters in the following URL:
https://api.sportradar.com/cycling/`{access_level}`/`{version}`/`{language_code}`/competitors/merge_mappings.`{format}`?api_key=`{your_api_key}`
| 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` | Supported Locales |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to top
## Competitor Profile
Returns biographical information for a given competitor.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/competitors/sr:competitor:44092/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.com")
conn.request("GET", "/cycling/trial/v2/en/competitors/sr:competitor:44092/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.com/cycling/trial/v2/en/competitors/sr:competitor:44092/profile.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{access_level}`/`{version}`/`{language_code}`/competitors/`{competitor_id}`/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` | Supported Locales |
| `competitor_id` | Id of a given competitor. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Rankings
Returns competitor rankings for the current week.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/rankings.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.com")
conn.request("GET", "/cycling/trial/v2/en/rankings.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/cycling/trial/v2/en/rankings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{access_level}`/`{version}`/`{language_code}`/rankings.`{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` | Supported Locales |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Season Schedule
Returns a list of scheduled races for a given season.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/sport_events/sr:stage:415966/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.com")
conn.request("GET", "/cycling/trial/v2/en/sport_events/sr:stage:415966/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/cycling/trial/v2/en/sport_events/sr:stage:415966/schedule.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{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` | Supported Locales |
| `stage_id` | Stage id for a given season. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Seasons
Returns a list of available seasons.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/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.com")
conn.request("GET", "/cycling/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.com/cycling/trial/v2/en/seasons.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{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: v2). |
| `language_code` | Supported Locales |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Sport Event Summary
Returns competitor, team, and results information for a given sport event.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/sport_events/sr:stage:726466/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.com")
conn.request("GET", "/cycling/trial/v2/en/sport_events/sr:stage:726466/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.com/cycling/trial/v2/en/sport_events/sr:stage:726466/summary.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{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` | Supported Locales |
| `stage_id` | Stage Id of a given sport event. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Team Profile
Returns information for a team.
TTL / Cache:
300 seconds
Update Frequency:
As Necessary
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/cycling/trial/v2/en/competitors/sr:competitor:26520/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.com")
conn.request("GET", "/cycling/trial/v2/en/competitors/sr:competitor:26520/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.com/cycling/trial/v2/en/competitors/sr:competitor:26520/profile.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
https://api.sportradar.com/cycling/`{access_level}`/`{version}`/`{language_code}`/competitor/`{competitor_id}`/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` | Supported Locales |
| `competitor_id` | Competitor id of a given team. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
Return to API map
## Frequently Asked Questions
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 “stage – status” values?
A: Here are the valid stage status values and their definitions:
Preliminary – results are entered but not completed (e.g. first 10 racers for a stage).
Completed – daily result is completed for a stage, or overall.
Closed – stage and overall results have been confirmed and verified.
Cancelled – stage or overall event is cancelled.
Running – the stage is in progress.
Q: What are the valid “stage – classification” values?
A: Here are the valid course classification values:
individual_time_trial
team_time_trial
flat
medium_mountain
high_mountain
no_classification
Q: What are the valid “stage – type” values?
A: Here are the valid "stage - type" values:
stage
event
discipline
season
sport
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