MotoGP v2

Frequently Asked Questions
API API Version
MotoGP v2
Note: Authentication is required for all API calls.
## Competitor Profile ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/trial/v2/en/competitors/sr:competitor:49401/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", "/motogp/trial/v2/en/competitors/sr:competitor:49401/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/motogp/trial/v2/en/competitors/sr:competitor:49401/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/motogp/`{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` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). | | `competitor_id` | Id of a given competitor. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Competitor Profile, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/competitor_profile.xsd ## Seasons ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/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", "/motogp/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/motogp/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/motogp/`{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` | 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. | To retrieve the XML Schema Definition (.XSD) for the Seasons, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/seasons.xsd ## Stage Probabilities ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/trial/v2/us/sport_events/sr:stage:337639/probabilities.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", "/motogp/trial/v2/us/sport_events/sr:stage:337639/probabilities.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/motogp/trial/v2/us/sport_events/sr:stage:337639/probabilities.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Stage Probabilities. https://api.sportradar.us/motogp/`{access_level}`/`{version}`/`{language_code}`/sport_events/`{stage_id}`/probabilities.`{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` | Id of a given stage. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Stage Probabilities, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/probabilities.xsd ## Stage Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/trial/v2/en/sport_events/sr:stage:337639/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", "/motogp/trial/v2/en/sport_events/sr:stage:337639/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/motogp/trial/v2/en/sport_events/sr:stage:337639/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Stage Schedule. https://api.sportradar.us/motogp/`{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` | Id of a given stage. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Stage Schedule, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/schedule.xsd ## Stage Summary ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/trial/v2/en/sport_events/sr:stage:338513/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", "/motogp/trial/v2/en/sport_events/sr:stage:338513/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/motogp/trial/v2/en/sport_events/sr:stage:338513/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Stage Summary. https://api.sportradar.us/motogp/`{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` | Id of a given stage. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Stage Summary, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/summary.xsd ## Team Profile ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/motogp/trial/v2/en/competitors/sr:competitor:22035/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", "/motogp/trial/v2/en/competitors/sr:competitor:22035/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/motogp/trial/v2/en/competitors/sr:competitor:22035/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/motogp/`{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` | Optional 2 letter code for supported languages: en (English), ru (Russian), and zh (simplified Chinese). | | `competitor_id` | Id of a given competitor. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Team Profile, use the following URL. http://schemas.sportradar.com/bsa/genericstage/v2/xml/endpoints/genericstage/competitor_profile.xsd ## Frequently Asked Questions

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: How does the stage system work?

A: The MotoGP API uses generic stage implementation. The core of the API is built around the concept of stages. For example, an event contains the following stage types: practice, qualifying, and race. Each of those stages, in turn, have stages (except Practice which has no sub-stages). The IDs of each stage are usable in the URL path to request information about that particular stage. Qualifying stages contain sub-stages known as "Qualifying Parts". In the Race stages, the sub-stages are laps. You can use the lap stage ID in the URL to get specific lap details, including driver times, and position.

The MotoGP sport and seasons within it are stages as well. The sport stage consists of season stages for each annual season. Using the ID of a chosen season as a parameter in the Stage Summary endpoint you can "drill down" into each season. For example, using the 2018 season ID as a parameter in the Stage Summary endpoint, the sub-stages will be individual race events. From the race event, you can drill down into the practice, qualifying, race, and lap stages of a race using the same endpoint with different stage IDs.

The best way to "start" the navigation with the MotoGP API is using the Seasons endpoint. From there one can obtain the stage ID for the season required and use that as a parameter in the Stage Summary endpoint.

Stage Type Information Included Sub-stages
Sport Information about the seasons included. Which is limited to the current and previous season only. Note probabilities do not return valid data on this stage.

MotoGP seasons: 2017, 2018.

Moto2 seasons: 2017, 2018.

Moto3 seasons: 2017, 2018.

Superbike seasons: 2017, 2018.

Season Contains the season schedule, driver standings and statistics. Events on the race calendar for that season.
Event Information about a single event, the competitors, the teams, and the circuit. Sessions (eg: Practice, Qualifying, Race)
Practice Competitors and results of practice such as fastest time etc. None
Qualifying Information pertaining to the qualifying stage of the event including conditions, competitors, and overall qualifying results. Qualifying Parts
Qualifying Part Information about the individual qualifying parts of the overall qualifying stage such as conditions, competitors, and results. None
Race Details of the race itself including the competitors, lap by lap, and overall results. Laps
Lap Specific details on individual laps such as driver positions, times, etc. Note probabilities do not return valid data on this stage. None.

Q: What are the stage types I can expect to see in the feeds?

A: Here are the race stages:

  • sport
  • season
  • event
  • practice
  • qualifying
  • qualifying_part
  • race
  • lap

Q: How do I see the Championship points table?

A: Use the stage summary endpoint and a season stage ID as the parameter. The competitors node lists competitors, ranked with points, position, victories, races, races with points, and podiums.

Q: How do I know what "stage" I am currently looking at?

A: Each stage has a "stage" element. The stage element has an attribute "type" displays stage type. The different valid stage types are listed above.

Q: How do I get the probabilities for the entire Championship? Or only one race?

A: You can use season, event, and race stage IDs as parameters for the probabilities endpoint. Probabilities are available for the individual driver to win the season, a single event, and race stage. Probabilities are not available on the Sport, Practice, Qualifying, or Lap stages.

Q: How do I retrieve information about an individual driver?

A: Use the Competitor Profile endpoint with the required driver's competitor ID. The best place to get the driver's competitor ID is the Stage Summary endpoint, using the season stage ID.

Q: What races are covered in the MotoGP API?

A: The entire MotoGP, Moto2, Moto3, and Superbike championships.

Q: Is it updated in real-time?

A: No, the MotoGP API provides only post-event updates.

Q: Does this API include Qualifying and Practice sessions?

A: Yes, qualifying and practice sessions are updated post-event.

Q: What are the possible statuses of a race or stage?

A: Here are the possible race and stage statuses:

  • cancelled
  • finished
  • not_started
  • completed
  • closed
  • preliminary
Return to top