Cycling v2

Frequently Asked Questions
API API Version
Cycling v2
Note: Authentication is required for all API calls.
## 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: >
  1. Call the Seasons resource for a list of seasons, making note of the Stage Id for your desired season
  2. Call the Season Schedule using the Stage Id and locate your desired race
  3. 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 Profile ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/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.us") 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.us/cycling/trial/v2/en/competitors/sr:competitor:44092/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Competitor Profile. https://api.sportradar.us/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/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.us") 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.us/cycling/trial/v2/en/rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Rankings. https://api.sportradar.us/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/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.us") 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.us/cycling/trial/v2/en/sport_events/sr:stage:415966/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/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/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.us") 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.us/cycling/trial/v2/en/seasons.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Seasons. https://api.sportradar.us/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/cycling/trial/v2/en/sport_events/sr:stage:425486/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", "/cycling/trial/v2/en/sport_events/sr:stage:425486/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/cycling/trial/v2/en/sport_events/sr:stage:425486/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Sport Event Summary. https://api.sportradar.us/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/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.us") 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.us/cycling/trial/v2/en/competitors/sr:competitor:26520/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Team Profile. https://api.sportradar.us/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

Q: What leagues or tournaments do you cover for Cycling?

A: We cover UCI World Tour and the World Championships.

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 “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.

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
Return to top

Docs Navigation