Integration GuidesDocs
Coverage MatrixDocumentationChange LogLog InContact Us
Integration Guides

Push Feeds

Streamline your access to live game updates by utilizing our Tennis Push feeds.

Intro

With our RESTful endpoints, you'll make API requests when you want to receive new data. But our Push feeds allow you to open a connection with a single call to receive continuous live updates. Once this connection opens, it will remain open indefinitely.

Thus, Push feeds are an efficient option to retrieve live Tennis match data. You need not worry about API pull frequency, but need only to "listen" for game updates.



RESTful & Push

Each Push update comes in the form of a JSON or XML payload, which will mimic the structure of a similar RESTful Tennis API endpoint. Below are the Push endpoints alongside their RESTful counterparts.

It's important to note that our Push service is not meant to replace our RESTful API, but to complement it. Push does not provide a "stateful session". There is no memory or method to access data sent previously. If you are disconnected from a Push session, use the corresponding RESTful API feed to catch up or recover from the disconnection. For example, if you experience a disconnection from a game while using Push Events, request the RESTful Live Timelines or Sport Event Timeline endpoints to capture the plays missed during the disconnection.

Additionally, it is important to note that Push feeds correlate to RESTful endpoints, but are not necessarily a 1:1 parity for all Tennis data. For a complete Tennis experience, you will need to make use of RESTful endpoints.



Access

Tennis Push feeds are an add-on service, and unavailable in the self-issued Tennis trial within your account. Reach out to a sales representative for trial access.

🔐

Tennis Push feeds are available for Sportradar Realtime customers only


Make a Request

Each Push feed starts with a URL request, as with our other RESTful API endpoints.

curl -L -X GET 'https://api.sportradar.com/tennis/{access_level}/{version}/stream/events/subscribe' \
  -H 'x-api-key: {your_api_key}'

When constructed, the above call opens up an HTTP redirect connection, returning all Push data for the requested feed. To filter results to a smaller data set include an optional query string.

There are no restrictions on the number of connections you may have open. Feel free to filter requests to individual games and close the connections when games complete, or keep a single unfiltered connection open indefinitely.

Visit the feed endpoints pages for complete syntax instructions.


Filtering

By default, a Push feed will provide all data available. For example, a Push Events connection would stream all Tennis matches in progress to your application. If needed, you can filter the data returned by including query strings.

For example, let's say you want to restrict your connection to one Tennis match in progress. Construct your call as normal and add the unique match id to the query string.

Here's an example:

curl -L -X GET 'https://api.sportradar.com/tennis/trial/v3/stream/events/subscribe?&format=json&sport_event_id=sr:sport_event:13468929' \
  -H 'x-api-key: {your_api_key}'

Visit the feed endpoints pages for complete query string syntax instructions.


Technical Requirements

To accept data from our Push feeds, ensure that your application can:

  • Follow an HTTP redirect, or use the location provided in the feeds header within one minute of your initial request.
  • Accept HTTP data transfer encoded as chunked.


Payloads

Our Push services are delivered by HTTP Streaming with chunked encoding, also commonly called HTTP Chunked. The streaming of data is based on long HTTP response. Chunked streaming allows you to act on the chunks immediately instead of waiting or requesting a full file.

When new feed content is available, the server pushes that information out to your client. When no new information is available on a feed, a heartbeat message is sent every 5 seconds to keep the connection active.

Messages are delivered in JSON format only.

}{
   "heartbeat":{
      "from":1738689527,
      "interval":5,
      "to":1738689532,
      "type":"events",
      "package":"tennis-v3"
   }
}{
   "payload":{
      "sport_event_status":{
         "status":"live",
         "match_status":"3rd_set",
         "home_score":1,
         "away_score":1,
         "period_scores":[
            {
               "home_score":4,
               "away_score":6,
               "type":"set",
               "number":1
            },
            {
               "home_score":6,
               "away_score":1,
               "type":"set",
               "number":2
            },
            {
               "home_score":5,
               "away_score":2,
               "type":"set",
               "number":3
            }
         ],
         "game_state":{
            "home_score":0,
            "away_score":0,
            "serving":"away",
            "last_point_result":"receiver_winner",
            "tie_break":false
         }
      },
      "event":{
         "id":485308,
         "type":"period_score",
         "time":"2025-02-04T17:18:50+00:00",
         "period":"3",
         "competitor":"home",
         "home_score":5,
         "away_score":2,
         "server":"home",
         "result":"server_won"
      }
   },
   "metadata":{
      "format":"json",
      "sport_event_id":"sr:sport_event_id:57798949",
      "event_id":"period_score",
      "channel":"tennis",
      "competition_id":"sr:competition:35428",
      "sport_id":"sr:sport:5",
      "season_id":"sr:season:126111"
   }
}{
   "heartbeat":{
      "from":1738689532,
      "interval":5,
      "to":1738689537,
      "type":"events",
      "package":"tennis-v3"
   }
}{
   "heartbeat":{
      "from":1738689537,
      "interval":5,
      "to":1738689542,
      "type":"events",
      "package":"tennis-v3"
   }
}{
   "heartbeat":{
      "from":1738689542,
      "interval":5,
      "to":1738689547,
      "type":"events",
      "package":"tennis-v3"
   }

Disconnections

Should you cease to receive heartbeat messages, or are disconnected from the Push service for any reason, re-connect using your same initial request.


Metadata

Each payload contains a metadata object that provides details about the payload type, including format, event, competition, sport, and season identifiers. This metadata enables you to filter and route messages efficiently, helping reduce processing and integration overhead.

   "metadata":{
      "format":"json",
      "sport_event_id":"sr:sport_event_id:57756307",
      "event_id":"point",
      "channel":"tennis",
      "competition_id":"sr:competition:34320",
      "sport_id":"sr:sport:5",
      "season_id":"sr:season:124107"
   }
   "metadata":{
      "format":"json",
      "sport_event_id":"sr:sport_event_id:57756307",
      "event_id":"period_score",
      "channel":"tennis",
      "competition_id":"sr:competition:34320",
      "sport_id":"sr:sport:5",
      "season_id":"sr:season:124107"
   }

Visit the Endpoints documentation for each feed to view all available data points.



Samples


Code Samples

To best utilize Push feeds, see the below code samples in Ruby and Java. These provide an example of a method to 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.

require 'httpclient'

module Sportradar
  module HTTP
    module Stream
      class Client
        attr_reader :url, :logger

        def initialize(url, api_key, logger)
          @url = url
          @logger = logger
          @api_key = api_key
          @client = ::HTTPClient.new(agent_name: 'SportsData/1.0')
        end

        def start
          @thread ||= Thread.new do
            logger.debug "Starting loop"
            headers = {
              'x-api-key' => @api_key
            }
            @client.get_content(url, header: headers, 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
package com.sportradar.http.stream.client;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class StreamClient {

    private Thread streamThread;
    private volatile boolean running = false;
    private String apiKey;

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public void stream(String serviceUrl, Handler handler) {
        running = true;
        streamThread = new Thread(() -> {
            try {
                URL url = new URL(serviceUrl);
                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                connection.setRequestMethod("GET");
                connection.setRequestProperty("User-Agent", "SportsData/1.0");

                if (apiKey != null && !apiKey.isEmpty()) {
                    connection.setRequestProperty("x-api-key", apiKey);
                }

                try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
                    String line;
                    while (running && (line = reader.readLine()) != null) {
                        if (!line.trim().isEmpty()) {
                            handler.handle(line);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        });

        streamThread.start();
    }

    public void terminate() {
        running = false;
        if (streamThread != null) {
            streamThread.interrupt();
        }
    }
}

Data Samples

See Push samples (Events, Statistics) of a complete game.



ID Updates

Updates in the Push Events feed are flagged with the updated field, which is set to true when a change occurs. Updates may be the creation of an event or an update of information to a previous event.

When you receive an event with the same ID as an event that has been previously consumed, it is best practice to replace the data from the previous message with the data consumed in the most recent message.

}{
   "payload":{
      "sport_event_status":{
         "status":"live",
         "match_status":"2nd_set",
         "home_score":0,
         "away_score":1,
         "period_scores":[
            {
               "home_score":2,
               "away_score":6,
               "type":"set",
               "number":1
            },
            {
               "home_score":2,
               "away_score":5,
               "type":"set",
               "number":2
            }
         ],
         "game_state":{
            "home_score":15,
            "away_score":40,
            "serving":"away",
            "last_point_result":"ace",
            "tie_break":false,
            "point_type":"match"
         }
      },
      "event":{
         "id":1961571099,
         "type":"point",
         "time":"2025-02-04T17:23:26+00:00",
         "competitor":"away",
         "updated":true,
         "updated_time":"2025-02-04T17:23:33+00:00",
         "home_score":15,
         "away_score":40,
         "server":"away",
         "result":"ace"
      }
   },


Endpoint Docs

Visit the links below for syntax structure, data samples, and data dictionaries for all Tennis Push feeds.

  • Push Events - Provides detailed, real-time information on every live match event.
  • Push Statistics - Provides detailed, real-time game stats at the team and player level for all live matches.
🔐

Access

Our Tennis Push feed is available exclusively for Realtime plans. Reach out to our sales team for more information.