Integration GuidesDocs
Coverage MatrixDocumentationChange LogLog InContact Us
Docs

Push Events

Returns detailed, real-time information on every match event

Syntax

https://api.sportradar.com/tennis/{access_level}/stream/events/subscribe

Parameters

ParameterDescription
access_levelDefines the access level of your API key as Production (production) or Trial (trial).

Optional Query String Parameters

By default, a Push feed will provide all data available for all in progress games. If needed, you can filter the data returned by including query strings.

Each query string parameter can be added with a preceding ampersand (&).

ParameterDescription
event_idEvent id expressed as: {event_id}.
Example: event_id=point
formatFormat expressed as: {format}.
Example: format=json
sport_event_idSport Event Id expressed as: {sport_event_id}.
Example: sport_event_id=sr:sport_event:27496678
season_idSeason Id expressed as: {season_id}.
Example: season_id=sr:season:81932
competition_idCompetition Id expressed as: {competition_id}.
Example: competition_id=sr:competition:16126


Code Samples

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.com/tennis/trial/stream/events/subscribe")

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)
request["x-api-key"] = "`{your_api_key}`"  # Replace with your actual key

response = http.request(request)
puts response.read_body
import requests
import json

headers = {
    'x-api-key': 'your_api_key'  # Replace with your actual key
}

r = requests.get(
    "https://api.sportradar.com/tennis/trial/stream/events/subscribe",
    headers=headers,
    allow_redirects=False
)

redirect_url = r.headers['Location']
r = requests.get(redirect_url, stream=True, headers=headers)

for line in r.iter_lines():
    # filter out keep-alive new lines
    if line:
        decoded_line = line.decode('utf-8')
        print(json.loads(decoded_line))
curl -L -X GET 'https://api.sportradar.com/tennis/trial/stream/events/subscribe' \
  -H 'x-api-key: `{your_api_key}`'

Samples with Query String Params

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.com/tennis/trial/stream/events/subscribe?&format=json&competition_id=sr:competition:16126")

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)
request["x-api-key"] = "`{your_api_key}`"  # Replace with your actual key

response = http.request(request)
puts response.read_body
import requests
import json

headers = {
    'x-api-key': 'your_api_key'  # Replace with your actual key
}

r = requests.get("https://api.sportradar.com/tennis/trial/stream/events/subscribe",
    params = {'format': 'json', 'competitor_id': 'sr:competition:16126'},
    allow_redirects=False)

redirect_url = r.headers['Location']
r = requests.get(redirect_url, stream=True)

for line in r.iter_lines():
    # filter out keep-alive new lines
    if line:
        decoded_line = line.decode('utf-8')
        print(json.loads(decoded_line))
curl -L -X GET 'api.sportradar.com/tennis/trial/stream/events/subscribe?&format=json&competition_id=sr:competition:16126'
  -H 'x-api-key: `{your_api_key}`'


Response Sample

The above commands return json like this.