Tennis v2

Frequently Asked Questions
API API Version XSD Schema
Tennis v2 Download
Note: Authentication is required for all API calls.
## Tennis v2 API Map To best utilize the Tennis 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 win probabilities for a match, given the date: >
  1. Call the Daily Schedule for the day the sport event takes place and find the Sport Event Id for the chosen sport event
  2. Call the Match Probabilities using the Sport Event Id
>The probability of a win for each participant is displayed. The primary feeds require only a date or human-readable parameters to call the endpoints. Those feeds provide Sport Event Ids, Competitor Ids, or Tournament Ids which can be used to generate the match, team, and tournament feeds. ## Tennis v2 Failover Information

If our scout feed goes down or becomes unavailable, Sportradar takes over Live Data Entry (LDE) to provide a failover.

In case of a failover, we follow one of the following scenarios:

  1. Continue point-by-point coverage – but lose service outcomes. During the failover we cannot provide data related to service outcome. The following data will be unavailable: aces, double faults, service faults, and successful service outcome. Those statistics will be verified and updated post-match.
  2. If point-by-point coverage is not possible – we will update game-by-game, post-match. During the failover we cannot provide point-by-point coverage and service outcomes. The following data will be unavailable: aces, double faults, service faults, and successful service outcome. Missing point-by-point coverage and statistics will be verified and updated post-match. Tie-break score will not be displayed. Game-by-game coverage will continue as each match ends.
## Complexes Lists all complexes and venues available in the API. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/complexes.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", "/tennis/trial/v2/en/complexes.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/tennis/trial/v2/en/complexes.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Complexes feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/complexes.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Daily (Live) Results Returns a list of results for all matches on a given date. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/schedules/2016-07-06/results.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", "/tennis/trial/v2/en/schedules/2016-07-06/results.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/tennis/trial/v2/en/schedules/2016-07-06/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Daily Results feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/schedules/`{year}`-`{month}`-`{day}`/results.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `year` | Year in 4 digit format (YYYY). | | `month` | Month in 2 digit format (MM). | | `day` | Day of the month in 2 digit format (DD). | | `live` | Optional: In place of the date, substitute live for the current live results. | | `format` | xml or json. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis/trial/v2/en/schedules/2016-07-06/results.xml?api_key={your_api_key}&start=0&limit=75")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis/trial/v2/en/schedules/2016-07-06/results.xml?api_key={your_api_key}&start=0&limit=75")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis/trial/v2/en/schedules/2016-07-06/results.xml?api_key={your_api_key}&start=0&limit=75'
In addition to the URL parameters listed above, you can paginate the lineup 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 200.
Example: limit=200 | Return to API map ## Daily (Live) Schedule Returns a schedule of matches on a given date. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/schedules/2016-07-06/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", "/tennis/trial/v2/en/schedules/2016-07-06/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/tennis/trial/v2/en/schedules/2016-07-06/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Daily Schedule feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/schedules/`{year}`-`{month}`-`{day}`/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `year` | Year in 4 digit format (YYYY). | | `month` | Month in 2 digit format (MM). | | `day` | Day of the month in 2 digit format (DD). | | `live` | Optional: In place of the date, substitute live for the current live results. | | `format` | xml or json. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis/trial/v2/en/schedules/2016-07-06/schedule.xml?api_key={your_api_key}&start=0&limit=75")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis/trial/v2/en/schedules/2016-07-06/schedule.xml?api_key={your_api_key}&start=0&limit=75")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis/trial/v2/en/schedules/2016-07-06/schedule.xml?api_key={your_api_key}&start=0&limit=75'
In addition to the URL parameters listed above, you can paginate the lineup 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 200.
Example: limit=200 | Return to API map ## Deleted Matches Returns a list of all events that have been removed from coverage. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/schedules/deleted_matches.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", "/tennis/trial/v2/en/schedules/deleted_matches.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/tennis/trial/v2/en/schedules/deleted_matches.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Deleted Matches feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/schedules/deleted_matches.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Doubles Team Head-To-Head Returns past and upcoming matches between doubles teams given two competitor IDs. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/sr:competitor:43047/versus/sr:competitor:207715/matches.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", "/tennis/trial/v2/en/double_teams/sr:competitor:43047/versus/sr:competitor:207715/matches.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/tennis/trial/v2/en/double_teams/sr:competitor:43047/versus/sr:competitor:207715/matches.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Doubles Team Head-to-Head feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/`{competitor_id}`/versus/`{competitor_id2}`/matches.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the doubles competitor. | | `competitor_id2` | id of the doubles competitor. | | `format` | xml or json. | Return to API map ## Doubles Team Profile Lists profile information for a doubles team such as form, information about the players comprising the team. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/sr:competitor:17518/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", "/tennis/trial/v2/en/double_teams/sr:competitor:17518/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/tennis/trial/v2/en/double_teams/sr:competitor:17518/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Doubles Team Profile feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/`{competitor_id}`/profile.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | Return to API map ## Doubles Team Race Rankings Rankings for the ATP/WTA finals. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/race_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", "/tennis/trial/v2/en/double_teams/race_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/tennis/trial/v2/en/double_teams/race_rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Doubles Team Race Rankings feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/race_rankings.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Doubles Team Rankings Rankings in ascending order for doubles teams ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/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", "/tennis/trial/v2/en/double_teams/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/tennis/trial/v2/en/double_teams/rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Doubles Team Rankings feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/rankings.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Doubles Team Results Results given a doubles team competitor ID ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/sr:competitor:17518/results.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", "/tennis/trial/v2/en/double_teams/sr:competitor:17518/results.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/tennis/trial/v2/en/double_teams/sr:competitor:17518/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Doubles Team Results feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/`{competitor_id}`/results.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | Return to API map ## Doubles Team Schedule Returns all scheduled matches for a given doubles team competitor ID ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/double_teams/sr:competitor:17518/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", "/tennis/trial/v2/en/double_teams/sr:competitor:17518/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/tennis/trial/v2/en/double_teams/sr:competitor:17518/schedule.xml?api_key={your_api_key}" ``` Access the Doubles Team Schedule feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/double_teams/`{competitor_id}`/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | Return to API map ## Live Summaries Returns information for currently live matches including live updates and statistics ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/schedules/live/summaries.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", "/tennis/trial/v2/en/schedules/live/summaries.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/tennis/trial/v2/en/schedules/live/summaries.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Live Summaries feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/schedules/live/summaries.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Match Probabilities Provides 2-way probabilities (home team win, away team win) for a given match. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/matches/sr:match:10351680/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", "/tennis/trial/v2/en/matches/sr:match:10351680/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.com/tennis/trial/v2/en/matches/sr:match:10351680/probabilities.xml?api_key={your_api_key}" ``` Access the Match Probabilities feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/matches/`{match_id}`/probabilities.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | Return to API map ## Match Summary Returns information for a match including live updates and statistics ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/matches/sr:match:9734443/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", "/tennis/trial/v2/en/matches/sr:match:9734443/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/tennis/trial/v2/en/matches/sr:match:9734443/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Match Summary feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/matches/`{match_id}`/summary.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | Return to API map ## Match Timeline Returns information for a given match ID including a timeline of events, (point-by-point or Game-by-Game depending on the coverage) and some basic stats ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/matches/sr:match:9734443/timeline.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", "/tennis/trial/v2/en/matches/sr:match:9734443/timeline.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/tennis/trial/v2/en/matches/sr:match:9734443/timeline.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Match Timeline feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/matches/`{match_id}`/timeline.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | Return to API map ## Player Head-To-Head Provides past and upcoming match details between two singles players given two competitor IDs ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/sr:competitor:18111/versus/sr:competitor:15126/matches.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", "/tennis/trial/v2/en/players/sr:competitor:18111/versus/sr:competitor:15126/matches.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/tennis/trial/v2/en/players/sr:competitor:18111/versus/sr:competitor:15126/matches.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Head-to-Head feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/`{competitor_id}`/versus/`{competitor_id2}`/matches.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the singles competitor. | | `competitor_id2` | id of the singles competitor. | | `format` | xml or json. | Return to API map ## Player Profile Provides stats and information for a given player. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/sr:competitor:18111/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", "/tennis/trial/v2/en/players/sr:competitor:18111/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/tennis/trial/v2/en/players/sr:competitor:18111/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Profile feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/`{competitor_id}`/profile.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | Return to API map ## Player Race Rankings Returns a list in ascending order for the race to the ATP/WTA finals. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/race_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", "/tennis/trial/v2/en/players/race_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/tennis/trial/v2/en/players/race_rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Race Rankings feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/race_rankings.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Player Rankings Returns a list in ascending order of ATP/WTA world rankings. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/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", "/tennis/trial/v2/en/players/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/tennis/trial/v2/en/players/rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Rankings feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/rankings.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Player Results Returns a listing of results given a single player ID. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/sr:competitor:18111/results.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", "/tennis/trial/v2/en/players/sr:competitor:18111/results.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/tennis/trial/v2/en/players/sr:competitor:18111/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Results feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/`{competitor_id}`/results.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis/trial/v2/en/players/sr:competitor:18111/results.xml?api_key={your_api_key}&start=0&limit=5")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis/trial/v2/en/players/sr:competitor:18111/results.xml?api_key={your_api_key}&start=0&limit=5")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis/trial/v2/en/players/sr:competitor:18111/results.xml?api_key={your_api_key}&start=0&limit=5'
In addition to the URL parameters listed above, you can filter the Player Results 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` | Result number to start from, expressed as: {start}.
Example: start=0 | | `limit` | Number to limit results, expressed as: {limit}.
Example: limit=5 | Return to API map ## Player Schedule Returns a schedule of upcoming matches for a given player ID. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/players/sr:competitor:18111/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", "/tennis/trial/v2/en/players/sr:competitor:18111/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/tennis/trial/v2/en/players/sr:competitor:18111/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Schedule feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/players/`{competitor_id}`/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | Return to API map ## Tournaments Lists all tournaments available in the API. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/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", "/tennis/trial/v2/en/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/tennis/trial/v2/en/tournaments.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournaments feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `format` | xml or json. | Return to API map ## Tournament Info Returns key information for a given tournament or season. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/sr:tournament:2555/info.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", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/info.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/tennis/trial/v2/en/tournaments/sr:tournament:2555/info.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Info feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/info.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | Return to API map ## Tournament Ongoing Returns all tournaments which start in less than seven days, currently ongoing tournaments, and completed tournaments until 1 week after they end. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/ongoing.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", "/tennis/trial/v2/en/tournaments/ongoing.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/tennis/trial/v2/en/tournaments/ongoing.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Ongoing feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/ongoing.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id` | id of the tournament. | | `format` | xml or json. | Return to API map ## Tournament Results Provides results for all matches within a given tournament or season. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/sr:tournament:2555/results.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", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/results.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/tennis/trial/v2/en/tournaments/sr:tournament:2555/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Results feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/results.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | Return to API map ## Tournament Schedule Provides scheduling information for all matches within a given tournament or season. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/sr:tournament:2555/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", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/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/tennis/trial/v2/en/tournaments/sr:tournament:2555/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Schedule feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis/trial/v2/en/tournaments/sr:tournament:2555/schedule.xml?api_key={your_api_key}&start=0&limit=75")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/schedule.xml?api_key={your_api_key}&start=0&limit=75")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis/trial/v2/en/tournaments/sr:tournament:2555/schedule.xml?api_key={your_api_key}&start=0&limit=75'
In addition to the URL parameters listed above, you can paginate the lineup 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 200.
Example: limit=200 | Return to API map ## Tournament Seasons Returns a list of seasons, the IDs of which can be used interchangeably with "tournament_id" to access historical results. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/sr:tournament:2555/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", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/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/tennis/trial/v2/en/tournaments/sr:tournament:2555/seasons.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Seasons feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/seasons.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | Return to API map ## Tournament Summary Returns information for a tournament or season, including live updates and statistics. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.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", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.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/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Summary feed by replacing the parameters in the following URL: https://api.sportradar.com/tennis/`{access_level}`/`{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/summaries.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `language_code` | Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.xml?api_key={your_api_key}&start=0&limit=75")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.xml?api_key={your_api_key}&start=0&limit=75")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis/trial/v2/en/tournaments/sr:tournament:2555/summaries.xml?api_key={your_api_key}&start=0&limit=75'
In addition to the URL parameters listed above, you can paginate the lineup 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 200.
Example: limit=200 | Return to API map ## Push Feeds >To best utilize Push feeds, we have included code samples in Ruby and Java which provides an example of a way you can consume the feeds. Using these samples will output the feeds content to STDOUT.
For Java, we have also provided a Stream Client to assist your integration.

Note: In the provided Java sample, replace "URL GOES HERE" with the desired Push feed URL. ```ruby require 'httpclient' module Sportradar module HTTP module Stream class Client attr_reader :url, :logger def initialize(url, publisher, logger) @url = url @logger = logger @publisher = publisher @client = ::HTTPClient.new(:agent_name => 'SportsData/1.0') end def start @thread ||= Thread.new do logger.debug "Starting loop" @client.get_content(url, :follow_redirect => true) do |chunk| @publisher.publish(::JSON.parse(chunk)) if @publisher end logger.debug "finished loop" end end def stop @thread.terminate if @thread end end end end end ``` ```java package com.sportradar.http.stream.client; import org.junit.After; import org.junit.Before; import org.junit.Test; public class StreamClientTest { private StreamClient client; private static String SERVICE_URL = ""; @Before public void setup() { client = new StreamClient(); } @After public void cleanup() { client.terminate(); } @Test public void testStream() throws Exception { Handler handler = new ConsoleHandler(); client.stream(SERVICE_URL, handler); System.out.println("Connecting...."); Thread.sleep(1 * 60 * 1000); System.out.println("Disconnecting...."); } } ``` Some of our APIs include Push feeds that allow you to get updates as soon as they are available. Push API feeds automatically send XML and JSON payload to you via a push service, and can dramatically reduce the number of calls you need to make to our RESTful API feeds. The structure of the Push feeds are similar to the structure of the corresponding RESTful API feed (i.e. Push Events, and Push Statistics). The push service ensures reliable and efficient delivery of the most up to date information. Our Push services are based on a HTTP publish/subscribe model. When making a call to the Push APIs, you "subscribe" to various data feeds provided by our service; whenever new content is available on one of those feeds, the server pushes that information out to your client. When no new information is available on the feed, a heartbeat message is sent every 5 seconds to keep the connection active. If you want to filter the results of the feeds, there are several optional query string parameters that can be applied to the API call. If left unfiltered, than all data for the feed is displayed (i.e. all games, events, or statistics). For your applications to accept data from our Push feeds, ensure that your application can: * Can follow a HTTP redirect or use the location provided in the feeds header within one minute of your initial request. * Can accept HTTP data transfer encoded as chunked. Our Push service does not provide a "stateful session", there is no memory of what data has been sent previously. If you are disconnected from the Push session, you can use the RESTful API to catch up or recover from the disconnection. Syntax for using our Push feeds and examples of the JSON payloads can be found below. ## Push - Events Returns detailed, real-time information on every game event ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/tennis-t2/stream/events/subscribe?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", "/tennis-t2/stream/events/subscribe?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET 'api.sportradar.us/tennis-t2/stream/events/subscribe?api_key={your_api_key}' ``` >The above command returns json like this. Access the Push Events feed by replacing the parameters in the following URL: https://api.sportradar.us/tennis-`{access_level}{version}`/stream/events/subscribe?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis-t2/stream/events/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis-t2/stream/events/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis-t2/stream/events/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102'
In addition to the URL parameters listed above, you can filter the Events 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 (&). If you are filtering for more than one result, separate the results with a comma (,) and no spaces.
Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `event_id` | Event id expressed as: {event_id}.
Example: event_id=point | | `format` | Format expressed as: {format}.
Example: format=json | | `sport_event_id` | Sport Event Id expressed as: {sport_event_id}.
Example: sport_event_id=sr:match:14586844 | | `tournament_id` | Tournament Id expressed as: {tournament_id}.
Example: tournament_id=sr:tournament:70389 | Return to API map ## Push - Statistics Returns detailed game stats at the doubles team or player level ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/tennis-t2/stream/statistics/subscribe?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", "/tennis-t2/stream/statistics/subscribe?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET 'api.sportradar.us/tennis-t2/stream/statistics/subscribe?api_key={your_api_key}' ``` > The above command returns json like this. Access the Push Statistics feed by replacing the parameters in the following URL: https://api.sportradar.us/tennis-`{access_level}{version}`/stream/statistics/subscribe?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Whole number (Current Version: v2). | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters:
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/tennis-t2/stream/statistics/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102")

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
import http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/tennis-t2/stream/statistics/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -L GET 'api.sportradar.us/tennis-t2/stream/statistics/subscribe?api_key={your_api_key}&format=json&tournament_id=sr:tournament:2102'
In addition to the URL parameters listed above, you can filter the Statistics 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 (&). If you are filtering for more than one result, separate the results with a comma (,) and no spaces.
Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `event_id` | Event id expressed as: {event_id}.
Example: event_id=point | | `format` | Format expressed as: {format}.
Example: format=json | | `sport_event_id` | Sport Event Id expressed as: {sport_event_id}.
Example: sport_event_id=sr:match:14586844 | | `tournament_id` | Tournament Id expressed as: {tournament_id}.
Example: tournament_id=sr:tournament:70389 | Return to API map ## 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: What leagues or tournaments do you cover for Tennis?

A: We cover the following tours:

  • ATP Singles
  • ATP Doubles
  • Olympic Tournament
  • Challenger Tournaments Singles
  • Challenger Tournaments Doubles
  • Davis Cup
  • Exhibition
  • Match for Africa
  • Fed Cup
  • Hopman Cup
  • IPTL
  • ITF Singles
  • ITF Doubles
  • ITF Women Singles
  • ITF Women Doubles
  • WTA Singles
  • WTA Doubles
  • Olympic Tournament, Women
  • WTA 125K Singles
  • WTA 125K Doubles

Q: What are the valid match modes?

A: bo5 (best of 5 sets), bo3 (Best of 3 sets)

Q: What are the valid outcomes for probabilities?

A: Here are the valid outcome probabilities:

  • home_team_winner
  • away_team_winner

Q: What are the valid sport_event_status – status values?

A: Status values can change over time, and new values may be added when needed. Here is a list of the currently valid status values and their definitions:

  • not_started – The match is scheduled to be played
  • match_about_to_start – The match time has expired, awaiting play
  • live – The match is currently in progress
  • closed – The match results have been confirmed.
  • ended – The match is over
  • 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
  • suspended – The match began, but has been suspended to a later time
  • cancelled – The match has been cancelled and will not be played
  • delayed – The match has been temporarily delayed and will be continued
  • abandoned – The match began, but was then cancelled

Q: What are the valid sport_event_status – match_status values?

A: Match status values can change over time, and new values may be added when needed. Here is a list of the currently valid match status values and their definitions:

  • not_started – The match is scheduled to be played
  • match_about_to_start – The match time has expired, awaiting play
  • start_delayed – The match has been temporarily delayed and will be continued. Matches are manually moved to this status 15 minutes after the scheduled start time.
  • live – The match is currently in progress
  • 1st_set – First set
  • 2nd_set – Second set
  • 3rd_set – Third set
  • 4th_set – Fourth set
  • 5th_set – Fifth set
  • ended – The match is over
  • walkover - The match ended in a walkover
  • interrupted – The match began, but is stopped for a short time
  • suspended – The match began, but has been suspended to a later time
  • cancelled – The match has been cancelled and will not be played
  • postponed – The match has been postponed to a future date
  • abandoned – The match began, but was then cancelled
  • retired – The match is incomplete as the result of one player
  • closed – The match results have been confirmed
  • defaulted - The match has ended as a result of one player being disqualified

Q: How do I find out the coverage for a particular match?

A: Find the node called: coverage_info. The attribute live_coverage reports whether Sportradar has live coverage of the match or not. The level can be gold, silver or bronze. Bronze includes basic_score. Silver includes basic_score and key_events. Gold includes everything in silver and detailed events and lineups.

Q: What are the possible surface values?

A: Here are the possible surface values:

  • red clay
  • hardcourt indoor
  • hardcourt outdoor
  • grass
  • unknown

Q: What are the possible weather conditions?

A: Here are the possible weather conditions:

  • indoor
  • good
  • medium
  • bad
  • extreme

Q: What are the possible event types logged?

A: Here are all of the possible event types we log:

  • deciding_team
  • match_started
  • match_called
  • period_start
  • point
  • period_score
  • match_suspended
  • match_resumed
  • match_ended

Q: What are the point event possible values?

A: Here are the possible values for a point event:

  • ace
  • receiver_won
  • server_won
  • double_fault

Q: What are the valid tournament types?

A: Here are the valid tournament types:

  • group
  • playoff
  • qualifier
  • variable

Q: What are markets and what are the different markets?

A: Markets is something you can bet on that we provide probabilities for. Over time we intend to provide more and more markets in the API. Currently the only market we provide is 3-way (will the home team win? Or the away team? Or will it be a draw?)

Q: What are the possible outcomes?

A: Different markets have different outcomes. The available markets are currently:

  • home_team_winner
  • away_team_winner
  • draw

Q: Is the statistical data provided in the Tennis API official data?

A: Sportradar collects sports data independently. For some sports Sportradar is the official data provider. In the case of Tennis, we provide official data for ITF tournaments only.

Q: What are the possible name values within tournament_round? 

A: Here is a list of possible values for tournament_round – name:

  • 11th_place_final
  • 13th_place_final
  • 15th_place_final
  • 17th_place_final
  • 19th_place_final
  • 21st_place_final
  • 23rd_place_final
  • 2nd_place_final
  • 3rd_place_final
  • 3rd_place_playoff
  • 4th_place_final
  • 5th_place_final
  • 7th_place_final
  • 9th_place_final
  • decider_match
  • final
  • initial_match
  • losers_final
  • losers_match
  • losers_quarterfinal
  • losers_round_1
  • losers_round_2
  • losers_round_3
  • losers_round_4
  • losers_round_5
  • losers_round_of_16
  • losers_semifinal
  • placement_qualification_match
  • qualification
  • quarterfinal
  • round_of_128
  • round_of_16
  • round_of_256
  • round_of_32
  • round_of_64
  • semifinal
  • winners_final
  • winners_match
  • winners_quarterfinal
  • winners_round_1
  • winners_round_2
  • winners_round_3
  • winners_round_4
  • winners_round_5
  • winners_round_of_16
  • winners_semifinal

Q: Why do some players have height and weight data and others don't? 

A: Only the height and weight of the top 500 ranked players for ATP and WTA are included. There may be some instances where some players outside of the top 500 have these attributes but should not be relied upon.

Q: What aare the possible name values in the category node?

A: Listed below are the possible name values for category – name. Note that new values can be added at any time.

  • ATP
  • Challenger
  • Davis Cup
  • Exhibition
  • Federation Cup
  • Hopman Cup
  • IPTL
  • ITF Men
  • ITF Women
  • Juniors
  • Legends
  • WTA 125K
  • WTA
  • Wheelchairs

Q: What are the possible values of level in the category node?

A: Here is a list of possible values for category – level:

  • grand_slam
  • atp_1000
  • atp_500
  • atp_250
  • wta_premier
  • wta_international
  • atp_world_tour_finals
  • wta_championships
  • atp_next_generation
  • wta_elite_trophy
  • wta_master
  • wta_500
  • wta_250
  • wta_1000
  • wta_125

Q: How are statistics handled at a match level?

A: All match statistics start at 0 and can change while events unfold. Though, if detailed_service_outcomes is false then the following stats are not collected: 

  • aces
  • double-faults
  • second_serve_points_won

Q: How long are matches stored in the deleted/updated matches endpoints?

A: The deleted/updated matches endpoints will show sport events removed or updated in the last 2 weeks.

Q: How do venues work for country vs country competitions?

A: To explain, in country vs country competitions such as Davis Cup and ATP Cup, venues on the parent matches refer to the complex in which the courts are located, and on the child match level venue refers to the court where the match is played. Note that only the finals venue will be linked to complex attribute for the Davis Cup competition.

Q: How does sport event type work in the feeds?

A: The sport_event_type explicitly denotes the match type. Where there are tournaments which have "parent matches" and "child matches" where country_format='true', such as Davis Cup and ATP Cup, this attribute will only appear on the "child match" node. The "parent match" sport_event node will have a "type='parent'" attribute and the "tournament" node will have a "type='mixed'" attribute. Otherwise, for competitions where "country_format" is not present, the tournament will have a type either "singles" or "doubles".

Q: How do I detect when one player has "advantage" in the case where the players both reached "40" or "deuce"?

A: The player who has "advantage" will have a score of "50" in the timeline, for example this is how a game was won by the receiver after a server committed a double_fault when the receiver was at "advantage":

In addition, when in a live situation the "game_state" node will display the following:

Return to top

Docs Navigation