Tennis v2

API API Version
Tennis v2
Note: Authentication is required for all API calls.
## Daily (Live) Results ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/schedules/2016-07-06/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Daily Results. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/schedules/`{year}`-`{month}`-`{day}`/results.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of 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. | ## Daily (Live) Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/schedules/2016-07-06/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Daily Schedule. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/schedules/`{year}`-`{month}`-`{day}`/schedule.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of 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. | ## Deleted Matches ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/schedules/deleted_matches.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves a list of Deleted Matches. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/schedules/deleted_matches.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Doubles Team Head-To-Head ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/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. This endpoint retrieves the Head-To-Head information for Doubles Teams. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/`{competitor_id}`/versus/`{competitor_id2}`/matches.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the doubles competitor. | | `competitor_id2` | id of the doubles competitor. | | `format` | xml or json. | ## Doubles Team Profile ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/double_teams/sr:competitor:17518/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Doubles Team Profile. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/`{competitor_id}`/profile.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | ## Doubles Team Race Rankings ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/double_teams/race_rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Doubles Team Race Rankings. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/race_rankings.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Doubles Team Rankings ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/double_teams/rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Doubles Team Rankings. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/rankings.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Doubles Team Results ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/double_teams/sr:competitor:17518/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Doubles Team Results. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/`{competitor_id}`/results.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | ## Doubles Team Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/double_teams/sr:competitor:17518/schedule.xml?api_key={your_api_key}" ``` This endpoint retrieves the Doubles Team Schedule. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/double_teams/`{competitor_id}`/schedule.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the doubles competitor. | | `format` | xml or json. | ## Match Probabilities ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/matches/sr:match:10351680/probabilities.xml?api_key={your_api_key}" ``` This endpoint retrieves the Match Probabilities. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/matches/`{match_id}`/probabilities.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | ## Match Summary ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/matches/sr:match:9734443/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Match Summary. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/matches/`{match_id}`/summary.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | ## Match Timeline ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/matches/sr:match:9734443/timeline.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Match Timeline. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/matches/`{match_id}`/timeline.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `match_id` | id of the match. | | `format` | xml or json. | ## Player Head-To-Head ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/sr:competitor:18111/versus/sr:competitor:15126/matches.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Head-To-Head information for singles Players. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/`{competitor_id}`/versus/`{competitor_id2}`/matches.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the singles competitor. | | `competitor_id2` | id of the singles competitor. | | `format` | xml or json. | ## Player Profile ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/sr:competitor:18111/profile.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Player Profile. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/`{competitor_id}`/profile.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | ## Player Race Rankings ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/race_rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Player Race Rankings. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/race_rankings.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Player Rankings ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/rankings.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Player Rankings. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/rankings.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Player Results ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/sr:competitor:18111/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Player Results. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/`{competitor_id}`/results.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | ## Player Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/players/sr:competitor:18111/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Player Schedule. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/players/`{competitor_id}`/schedule.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `competitor_id` | id of the singles competitor. | | `format` | xml or json. | ## Tournaments ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves Tournaments. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `format` | xml or json. | ## Tournament Info ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments/sr:tournament:2555/info.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Info. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/info.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ## Tournament Ongoing ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments/ongoing.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Ongoing information. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments/ongoing.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `tournament_id` | id of the tournament. | | `format` | xml or json. | ## Tournament Results ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments/sr:tournament:2555/results.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Results. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/results.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ## Tournament Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments/sr:tournament:2555/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Schedule. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/schedule.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ## Tournament Season ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/tennis-t2/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-t2/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-t2/en/tournaments/sr:tournament:2555/seasons.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Season. https://api.sportradar.com/tennis-`{access_level}{version}`/`{language_code}`/tournaments/`{tournament_id or season_id}`/seasons.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Production (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `language_code` | List of Supported Locales | | `tournament_id or season_id` | Id of the tournament or season. | | `format` | xml or json. | ## 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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://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. This endpoint retrieves the Events information via Push. http://api.sportradar.us/tennis-`{access_level}{version}`/stream/events/subscribe?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 (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters: ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://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 ``` ```python 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")) ``` ```shell 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 | ## Push - Statistics ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://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. This endpoint retrieves the Statistics information via Push. http://api.sportradar.us/tennis-`{access_level}{version}`/stream/statistics/subscribe?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 (p) or Trial (t). | | `version` | Whole number (Current Version: 2). | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters: ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://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 ``` ```python 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")) ``` ```shell 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 |