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 NCAA Men's Basketball (NCAAMB) game 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 payload, which will mimic the structure of a similar RESTful NCAAMB API endpoint. Below are the Push endpoints alongside their RESTful counterparts.
Push Feed | RESTful Counterpart |
---|---|
Push Events | Game Play-by-Play |
Push Statistics | Game Summary |
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 Game Play-by-Play 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 NCAAMB data. For a complete NCAAMB experience, you will need to make use of RESTful endpoints.
Access
NCAA Men's Basketball Push feeds are an add-on service, and unavailable in the self-issued NCAAMB trial within your account. Reach out to a sales representative for trial access.
NCAAMB Push feeds are available for Sportradar Realtime customers only
Make a Request
Each Push feed will begin with a URL request appended with your unique API key, as with our other RESTful API endpoints.
https://api.sportradar.com/ncaamb/{access_level}/stream/{language_code}/{push_feed}/subscribe?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 NCAAMB games 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 NCAAMB game in progress. Construct your call as normal and add the unique game id
to the query string.
Here's an example: https://api.sportradar.com/ncaamb/trial/stream/en/events/subscribe?api_key={your_api_key}&match=sd:match:d613a22d-91aa-451a-8148-fcff2a5970cc
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":{
"interval":5000
}
}{
"heartbeat":{
"interval":5000
}
}{
"heartbeat":{
"interval":5000
}{
"payload":{
"game":{
"id":"1f0318ea-21c5-4f15-89ee-a07ae02c3c3b",
"status":"inprogress",
"coverage":"full",
"scheduled":"2024-01-11T01:00:00+00:00",
"home":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553",
"points":63,
"rank":13,
"remaining_timeouts":3
},
"away":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"points":62,
"rank":0,
"remaining_timeouts":2
}
},
"event":{
"id":"ddf01819-dcae-46d4-af44-996fed7f5a65",
"event_type":"shootingfoul",
"sequence":1704940160754,
"clock":"10:22",
"clock_decimal":"10:22",
"updated":"2024-01-11T02:29:20Z",
"created":"2024-01-11T02:29:20Z",
"description":"Isaiah Wyatt shooting foul (David Jones draws the foul)",
"home_points":63,
"away_points":62,
"attribution":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"team_basket":"left"
},
"location":{
"coord_x":930,
"coord_y":257,
"action_area":"backcourt"
},
"possession":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553"
},
"period":{
"id":"a7aad0fd-194d-49b7-8b35-fd81e81fa9f2",
"number":2,
"sequence":2,
"type":"half"
},
"on_court":{
"home":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553",
"players":[
{
"full_name":"David Jones",
"jersey_number":"8",
"id":"c7e1f696-20fa-4a8a-84d5-d469f30406f9"
},
{
"full_name":"Nae'Qwan Tomlin",
"jersey_number":"7",
"id":"034345a0-ca68-4d80-92ed-6968d03a4def"
},
{
"full_name":"Jahvon Quinerly",
"jersey_number":"11",
"id":"d54bbba0-5627-449f-81b1-591727ae4eb4"
},
{
"full_name":"Malcolm Dandridge",
"jersey_number":"23",
"id":"e3585a02-b9e4-4914-a626-323d58fd8b49"
},
{
"full_name":"Jayden Hardaway",
"jersey_number":"25",
"id":"81162b32-db40-448f-a2c0-1a66f74c501c"
}
]
},
"away":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"players":[
{
"full_name":"Carlton Linguard Jr.",
"jersey_number":"2",
"id":"fc2c32b8-fcbd-437a-bca1-22ea04a9edef"
},
{
"full_name":"Isaiah Wyatt",
"jersey_number":"11",
"id":"fef62d51-e1c4-47ff-9546-f40b1c2374c5"
},
{
"full_name":"Massal Diouf",
"jersey_number":"14",
"id":"b1b3b4ac-4b27-4425-94ad-f92bb8939420"
},
{
"full_name":"Jordan Ivy-Curry",
"jersey_number":"1",
"id":"be817bd1-813d-4804-a0b0-03d4318a6802"
},
{
"full_name":"Christian Tucker",
"jersey_number":"22",
"id":"5686d2a2-63bf-4f0d-8933-65d4f5391e14"
}
]
}
},
"statistics":[
{
"type":"fouldrawn",
"team":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553"
},
"player":{
"full_name":"David Jones",
"jersey_number":"8",
"id":"c7e1f696-20fa-4a8a-84d5-d469f30406f9"
}
},
{
"type":"personalfoul",
"team":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf"
},
"player":{
"full_name":"Isaiah Wyatt",
"jersey_number":"11",
"id":"fef62d51-e1c4-47ff-9546-f40b1c2374c5"
}
}
]
}
},
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:1f0318ea-21c5-4f15-89ee-a07ae02c3c3b",
"status":"inprogress",
"team":"sd:team:953151f2-1e42-4cb0-a99e-202493a64dcf",
"players":"sd:player:c7e1f696-20fa-4a8a-84d5-d469f30406f9,sd:player:034345a0-ca68-4d80-92ed-6968d03a4def,sd:player:d54bbba0-5627-449f-81b1-591727ae4eb4,sd:player:e3585a02-b9e4-4914-a626-323d58fd8b49,sd:player:81162b32-db40-448f-a2c0-1a66f74c501c,sd:player:fc2c32b8-fcbd-437a-bca1-22ea04a9edef,sd:player:fef62d51-e1c4-47ff-9546-f40b1c2374c5,sd:player:b1b3b4ac-4b27-4425-94ad-f92bb8939420,sd:player:be817bd1-813d-4804-a0b0-03d4318a6802,sd:player:5686d2a2-63bf-4f0d-8933-65d4f5391e14",
"event_type":"shootingfoul",
"event_category":"foul",
"locale":"en",
"operation":"update",
"version":"v7"
}{
"heartbeat":{
"interval":5000
}
}
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 includes a metadata header message. The metadata includes information on the type of payload, as well as possible filtering options, saving processing and integration time.
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:8178dfc1-2ef0-45a9-b9dc-0448b263f45c",
"status":"inprogress",
"team":"sd:team:7cdfcf92-7fe7-46f1-9b66-6912114182e6",
"event_type":"rebound",
"event_category":"shot",
"locale":"en",
"operation":"update",
"version":"v7"
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:883f1fbf-5df8-44a7-a19e-3b4ceb2182ab",
"player":"sd:player:e5013f75-d1d4-4227-a378-b73a169f0581",
"status":"inprogress",
"stats_type":"player",
"locale":"en",
"operation":"update",
"version":"v7"
}
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, 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
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 = "<URL GOES HERE>";
@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....");
}
}
Data Samples
Click here for additional samples (Events and Statistics) of games.
ID Updates
All updates to the Push feeds are categorized as an update
or a delete
. These will be found within metadata.operation
.
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":{
"game":{
"id":"1f0318ea-21c5-4f15-89ee-a07ae02c3c3b",
"status":"inprogress",
"coverage":"full",
"scheduled":"2024-01-11T01:00:00+00:00",
"home":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553",
"points":63,
"rank":13,
"remaining_timeouts":3
},
"away":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"points":62,
"rank":0,
"remaining_timeouts":2
}
},
"event":{
"id":"ddf01819-dcae-46d4-af44-996fed7f5a65",
"event_type":"shootingfoul",
"sequence":1704940160754,
"clock":"10:22",
"clock_decimal":"10:22",
"updated":"2024-01-11T02:29:20Z",
"created":"2024-01-11T02:29:20Z",
"description":"Isaiah Wyatt shooting foul (David Jones draws the foul)",
"home_points":63,
"away_points":62,
"attribution":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"team_basket":"left"
},
"location":{
"coord_x":930,
"coord_y":257,
"action_area":"backcourt"
},
"possession":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553"
},
"period":{
"id":"a7aad0fd-194d-49b7-8b35-fd81e81fa9f2",
"number":2,
"sequence":2,
"type":"half"
},
"on_court":{
"home":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553",
"players":[
{
"full_name":"David Jones",
"jersey_number":"8",
"id":"c7e1f696-20fa-4a8a-84d5-d469f30406f9"
},
{
"full_name":"Nae'Qwan Tomlin",
"jersey_number":"7",
"id":"034345a0-ca68-4d80-92ed-6968d03a4def"
},
{
"full_name":"Jahvon Quinerly",
"jersey_number":"11",
"id":"d54bbba0-5627-449f-81b1-591727ae4eb4"
},
{
"full_name":"Malcolm Dandridge",
"jersey_number":"23",
"id":"e3585a02-b9e4-4914-a626-323d58fd8b49"
},
{
"full_name":"Jayden Hardaway",
"jersey_number":"25",
"id":"81162b32-db40-448f-a2c0-1a66f74c501c"
}
]
},
"away":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf",
"players":[
{
"full_name":"Carlton Linguard Jr.",
"jersey_number":"2",
"id":"fc2c32b8-fcbd-437a-bca1-22ea04a9edef"
},
{
"full_name":"Isaiah Wyatt",
"jersey_number":"11",
"id":"fef62d51-e1c4-47ff-9546-f40b1c2374c5"
},
{
"full_name":"Massal Diouf",
"jersey_number":"14",
"id":"b1b3b4ac-4b27-4425-94ad-f92bb8939420"
},
{
"full_name":"Jordan Ivy-Curry",
"jersey_number":"1",
"id":"be817bd1-813d-4804-a0b0-03d4318a6802"
},
{
"full_name":"Christian Tucker",
"jersey_number":"22",
"id":"5686d2a2-63bf-4f0d-8933-65d4f5391e14"
}
]
}
},
"statistics":[
{
"type":"fouldrawn",
"team":{
"name":"Tigers",
"market":"Memphis",
"id":"1551b3a0-6d10-4ffa-8dfa-73b56f004553"
},
"player":{
"full_name":"David Jones",
"jersey_number":"8",
"id":"c7e1f696-20fa-4a8a-84d5-d469f30406f9"
}
},
{
"type":"personalfoul",
"team":{
"name":"Roadrunners",
"market":"UTSA",
"id":"953151f2-1e42-4cb0-a99e-202493a64dcf"
},
"player":{
"full_name":"Isaiah Wyatt",
"jersey_number":"11",
"id":"fef62d51-e1c4-47ff-9546-f40b1c2374c5"
}
}
]
}
},
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:1f0318ea-21c5-4f15-89ee-a07ae02c3c3b",
"status":"inprogress",
"team":"sd:team:953151f2-1e42-4cb0-a99e-202493a64dcf",
"players":"sd:player:c7e1f696-20fa-4a8a-84d5-d469f30406f9,sd:player:034345a0-ca68-4d80-92ed-6968d03a4def,sd:player:d54bbba0-5627-449f-81b1-591727ae4eb4,sd:player:e3585a02-b9e4-4914-a626-323d58fd8b49,sd:player:81162b32-db40-448f-a2c0-1a66f74c501c,sd:player:fc2c32b8-fcbd-437a-bca1-22ea04a9edef,sd:player:fef62d51-e1c4-47ff-9546-f40b1c2374c5,sd:player:b1b3b4ac-4b27-4425-94ad-f92bb8939420,sd:player:be817bd1-813d-4804-a0b0-03d4318a6802,sd:player:5686d2a2-63bf-4f0d-8933-65d4f5391e14",
"event_type":"shootingfoul",
"event_category":"foul",
"locale":"en",
"operation":"update",
"version":"v7"
}
}{
"payload":{
"game":{
"id":"883f1fbf-5df8-44a7-a19e-3b4ceb2182ab",
"status":"inprogress",
"coverage":"full",
"scheduled":"2024-01-11T01:30:00+00:00",
"home":{
"name":"Musketeers",
"market":"Xavier",
"id":"0d8a328f-20ce-410b-bed1-15fc01308aaf",
"points":35,
"rank":0,
"bonus":true,
"remaining_timeouts":3
},
"away":{
"name":"Huskies",
"market":"UConn",
"id":"efba5350-79bc-47aa-a189-db177b95b491",
"points":40,
"rank":4,
"double_bonus":true,
"remaining_timeouts":3
}
},
"event":{
"id":"7a4d1cd5-1c7e-4887-ae50-6672bc3b9d69",
"event_type":"lineupchange",
"sequence":1704940161545,
"clock":"1:24",
"clock_decimal":"1:24",
"updated":"2024-01-11T02:29:21Z",
"created":"2024-01-11T02:29:21Z",
"description":"Musketeers lineup change (Desmond Claude, Trey Green, Quincy Olivari, Gytis Nemeiksa, Abou Ousmane)",
"home_points":35,
"away_points":40,
"attribution":{
"name":"Musketeers",
"market":"Xavier",
"id":"0d8a328f-20ce-410b-bed1-15fc01308aaf",
"team_basket":"right"
},
"location":{
"coord_x":0,
"coord_y":0
},
"period":{
"id":"1471675d-2741-45e9-b658-5830018a14c3",
"number":1,
"sequence":1,
"type":"half"
},
"on_court":{
"home":{
"name":"Musketeers",
"market":"Xavier",
"id":"0d8a328f-20ce-410b-bed1-15fc01308aaf",
"players":[
{
"full_name":"Desmond Claude",
"jersey_number":"1",
"id":"8dae6552-d723-4a8f-8adb-0be883cb2b4e"
},
{
"full_name":"Trey Green",
"jersey_number":"0",
"id":"e5013f75-d1d4-4227-a378-b73a169f0581"
},
{
"full_name":"Quincy Olivari",
"jersey_number":"8",
"id":"06eb146b-d583-41cf-a435-b5729b7d9dfd"
},
{
"full_name":"Gytis Nemeiksa",
"jersey_number":"50",
"id":"61e6eae0-ecb6-415e-b25d-b48ec36de8e7"
},
{
"full_name":"Abou Ousmane",
"jersey_number":"24",
"id":"0a54846c-e075-4f24-969a-5480a31a011b"
}
]
},
"away":{
"name":"Huskies",
"market":"UConn",
"id":"efba5350-79bc-47aa-a189-db177b95b491",
"players":[
{
"full_name":"Tristen Newton",
"jersey_number":"2",
"id":"d8105232-a0e7-4f54-8ccd-de9fc2cb0670"
},
{
"full_name":"Stephon Castle",
"jersey_number":"5",
"id":"c2c42723-cc6c-420e-8202-070a4023c6ff"
},
{
"full_name":"Hassan Diarra",
"jersey_number":"10",
"id":"47c24d47-e523-4ae1-9a35-02851dc2b20d"
},
{
"full_name":"Alex Karaban",
"jersey_number":"11",
"id":"fba1c25b-f3b9-40bc-9c44-6918cf97c61b"
},
{
"full_name":"Samson Johnson",
"jersey_number":"35",
"id":"767110e4-94c1-4f47-8310-7d8a03f146f9"
}
]
}
}
}
},
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:883f1fbf-5df8-44a7-a19e-3b4ceb2182ab",
"status":"inprogress",
"team":"sd:team:0d8a328f-20ce-410b-bed1-15fc01308aaf",
"players":"sd:player:8dae6552-d723-4a8f-8adb-0be883cb2b4e,sd:player:e5013f75-d1d4-4227-a378-b73a169f0581,sd:player:06eb146b-d583-41cf-a435-b5729b7d9dfd,sd:player:61e6eae0-ecb6-415e-b25d-b48ec36de8e7,sd:player:0a54846c-e075-4f24-969a-5480a31a011b,sd:player:d8105232-a0e7-4f54-8ccd-de9fc2cb0670,sd:player:c2c42723-cc6c-420e-8202-070a4023c6ff,sd:player:47c24d47-e523-4ae1-9a35-02851dc2b20d,sd:player:fba1c25b-f3b9-40bc-9c44-6918cf97c61b,sd:player:767110e4-94c1-4f47-8310-7d8a03f146f9",
"event_type":"lineupchange",
"event_category":"lineupchange",
"locale":"en",
"operation":"update",
"version":"v7"
}
{
"payload":{
"game":{
"id":"8178dfc1-2ef0-45a9-b9dc-0448b263f45c",
"status":"inprogress",
"coverage":"full",
"scheduled":"2024-01-11T01:00:00+00:00",
"home":{
"name":"Beacons",
"market":"Valparaiso",
"id":"df3da9d7-2d2b-44e2-99e2-08c4945a203b",
"points":46,
"rank":0,
"bonus":true,
"remaining_timeouts":3
},
"away":{
"name":"Salukis",
"market":"Southern Illinois",
"id":"7cdfcf92-7fe7-46f1-9b66-6912114182e6",
"points":60,
"rank":0,
"remaining_timeouts":3
}
},
"event":{
"id":"cf5780d0-8f83-484b-971c-8128eefae47c",
"event_type":"rebound",
"sequence":1704940162700,
"clock":"7:54",
"clock_decimal":"7:54",
"updated":"2024-01-11T02:29:22Z",
"created":"2024-01-11T02:29:22Z",
"description":"Kennard Davis Jr. defensive rebound",
"home_points":46,
"away_points":60,
"attribution":{
"name":"Salukis",
"market":"Southern Illinois",
"id":"7cdfcf92-7fe7-46f1-9b66-6912114182e6",
"team_basket":"right"
},
"location":{
"coord_x":308,
"coord_y":174,
"action_area":"backcourt"
},
"possession":{
"name":"Salukis",
"market":"Southern Illinois",
"id":"7cdfcf92-7fe7-46f1-9b66-6912114182e6"
},
"period":{
"id":"6a48bffa-015c-41d5-a3cf-853c9c850ce5",
"number":2,
"sequence":2,
"type":"half"
},
"statistics":[
{
"type":"rebound",
"rebound_type":"defensive",
"team":{
"name":"Salukis",
"market":"Southern Illinois",
"id":"7cdfcf92-7fe7-46f1-9b66-6912114182e6"
},
"player":{
"full_name":"Kennard Davis Jr.",
"jersey_number":"30",
"id":"2e11fd76-02ca-46ae-b58d-7d375aa88bc5"
}
}
]
}
},
"locale":"en",
"metadata":{
"league":"NCAAM",
"match":"sd:match:8178dfc1-2ef0-45a9-b9dc-0448b263f45c",
"status":"inprogress",
"team":"sd:team:7cdfcf92-7fe7-46f1-9b66-6912114182e6",
"event_type":"rebound",
"event_category":"shot",
"locale":"en",
"operation":"delete",
"version":"v7"
}
Endpoint Docs
Visit the links below for syntax structure, data samples, and data dictionaries for all NCAAMB Push feeds.
- Push Events - Provides detailed, real-time information on every live game event.
- Push Statistics - Provides detailed, real-time game stats at the team and player level for all live games.
Updated 21 days ago