Provides real-time team and player match-level statistics for all live games.
Syntax
https://api.sportradar.com/handball/{access_level}/stream/statistics/subscribe?api_key={your_api_key} |
Parameters
Parameter | Description |
---|---|
access_level | Defines the access level of your API keyproduction , trial |
your_api_key | Your API key |
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.
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.
URL Parameters | Description |
---|---|
channel | Channel type Example: channel=handball |
competition_id | Competition id Example: competition_id=sr:competition:1398 |
event_id | Event type Example: event_id=score_change |
format | Format typejson , xml Example: format=json |
season_id | Season id Example: season_id=sr:season:70242 |
sport_event_id | Sport event id Example: sport_event_id=sr:sport_event:19115812 |
sport_id | Sport id Example: sport_id=sr:sport:6 |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/handball/trial/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
import requests
import json
r = requests.get("https://api.sportradar.com/handball/trial/stream/statistics/subscribe",
params = {'api_key': 'your_api_key'},
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 GET "api.sportradar.com/handball/trial/stream/statistics/subscribe?api_key={your_api_key}"
Samples with Query String Params
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/handball/trial/stream/statistics/subscribe?api_key={your_api_key}&format=json&sport_event_id=sr:sport_event:19115812")
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 requests
import json
r = requests.get("https://api.sportradar.com/handball/trial/stream/statistics/subscribe",
params = {'api_key': 'your_api_key', 'format': 'json', 'sport_event_id': 'sr:sport_event:19115812'},
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 GET 'https://api.sportradar.com/handball/trial/stream/statistics/subscribe?api_key={your_api_key}&format=json&sport_event_id=sr:sport_event:19115812'
Response Sample
The above commands return json like this.
Data Points
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
channel | metadata | String | Sport of the stream connection ex. handball |
competition_id | metadata | String | Unique Id of a competition ex. sr:competition:149 |
event_id | metadata | String | Type of timeline event. Reference enum_event_type in our Handball OpenAPI Spec for a complete list of event types ex. match_started , score_change , shot_off_target |
format | metadata | String | Format type of the responsejson , xml |
season_id | metadata | String | Unique Id of a season ex. sr:season:106289 |
sport_event_id | metadata | String | Unique Id of a sport event ex. sr:sport_event_id:49324739 |
sport_id | metadata | String | Unique Id of a sport ex. sr:sport:6 |
from | heartbeat | Integer | Unix timestamp of the beginning of a heartbeat message ex. 1713804799 |
to | heartbeat | Integer | Unix timestamp of the end of a heartbeat message ex. 1713804804 |
interval | heartbeat | Integer | Interval of a heartbeat message in seconds |
type | heartbeat | String | Type of heartbeat message ex. events , statistics |
package | heartbeat | String | Package of a heartbeat message ex. handball-v2 |
Competitor:
Attribute | Parent Element | Type | Description |
---|---|---|---|
abbreviation | competitors | String | Abbreviation for a competitor name ex. RNL (Rhein-Neckar Lowen) |
id | competitors | String | Unique ID for a competitor ex. sr:competitor:4004 (Rhein-Neckar Lowen) |
name | competitors | String | Name for a competitor ex. Rhein-Neckar Lowen |
qualifier | competitors | String | Designation of a competitor for a seasonhome , away |
Player:
Attribute | Parent Element | Type | Description |
---|---|---|---|
id | players | String | Unique ID of a player ex. sr:player:2300047 |
name | players | String | Name of a player ex. Grupe, Magnus |
Period Scores:
Attribute | Parent Element | Type | Description |
---|---|---|---|
away_score | sport_event_status - period_scores - period_score | Integer | Away team inning score |
home_score | sport_event_status - period_scores - period_score | Integer | Home team inning score |
number | sport_event_status - period_scores - period_score | Integer | Period number |
type | sport_event_status - period_scores - period_score | String | Period typeregular_period , overtime , penalties , awaiting_penalties , 1st_half , 2nd_half , pause , 1st_extra , 2nd_extra , awaiting_extra , extra_time_halftime , interrupted |
Sport Event Status:
Attribute | Parent Element | Type | Description |
---|---|---|---|
aggregate_away_score | sport_event_status | Integer | Aggregate score (of multiple sport events) for the away team |
aggregate_home_score | sport_event_status | Integer | Aggregate score (of multiple sport events) for the home team |
aggregate_winner_id | sport_event_status | String | Unique ID of the aggregate score winner ex. sr:competitor:44 |
away_normaltime_score | sport_event_status | Integer | Score for the away team in normal time |
away_overtime_score | sport_event_status | Integer | Score for the away team in overtime |
away_score | sport_event_status | Integer | Total score for the away team in the match |
home_normaltime_score | sport_event_status | Integer | Score for the home team in normal time |
home_overtime_score | sport_event_status | Integer | Score for the home team in overtime |
home_score | sport_event_status | Integer | Total score for the home team in the match |
decided_by_fed | sport_event_status | Boolean | Signifies a match result was decided by the federation when true . For example, incomplete due to crowd disruption |
match_status | sport_event_status | String | Status within a match. Provides more detail on the state of a match when live than status ex. not_started , 2nd_half , ended , awaiting_penalties See our Handball OpenAPI under enum_sport_event_match_status for a complete list of statuses |
match_tie | sport_event_status | Boolean | Signifies a match ended in a tie when true |
scount_abandoned | sport_event_status | Boolean | Signifies a match was abandoned by a scout when true |
status | sport_event_status | String | Status of a match ex. not_started , live , ended , closed See our FAQ for a complete list of statuses and their definitions. |
winner_id | sport_event_status | String | Unique ID of the match winner ex. sr:competitor:7578 |
Match Stats (Team):
Attribute | Parent Element | Type | Description |
---|---|---|---|
assists | competitors - statistics | Integer | Total team assists for a match |
blocks | competitors - statistics | Integer | Total team blocks for a match |
field_goals | competitors - statistics | Integer | Total team field goals for a match |
goals_conceded | competitors - statistics | Integer | Total team goals conceded for a match |
goals_scored | competitors - statistics | Integer | Total team goals scored for a match |
red_cards | competitors - statistics | Integer | Total team red cards for a match |
saves | competitors - statistics | Integer | Total team saves for a match |
seven_m_goals | competitors - statistics | Integer | Total team 7-meter throw goals for a match |
shot_accuracy | competitors - statistics | Float | Team shot accuracy percentage for a match ex. 63.04 |
shots | competitors - statistics | Integer | Total team shots for a match |
shots_against | competitors - statistics | Integer | Total team shots against for a match |
shots_off_goal | competitors - statistics | Integer | Total team shots off goal for a match |
shots_on_goal | competitors - statistics | Integer | Total team shots on goal for a match |
steals | competitors - statistics | Integer | Total team steals for a match |
suspensions | competitors - statistics | Integer | Total team suspensions for a match |
technical_fouls | competitors - statistics | Integer | Total team technical fouls for a match |
yellow_cards | competitors - statistics | Integer | Total team yellow cards for a match |
Match Stats (Player):
Attribute | Parent Element | Type | Description |
---|---|---|---|
assists | players - statistics | Integer | Player assists for a match |
blocks | players - statistics | Integer | Player blocks for a match |
field_goals | players - statistics | Integer | Player field goals for a match |
goalkeeper_minutes_played | players - statistics | String | Number of minutes played for a goalkeeper in a match ex. 34:03 |
goals_conceded | players - statistics | Integer | Number of goals conceded for a goalkeeper in a match |
goals_scored | players - statistics | Integer | Player goals scored for a match |
red_cards | players - statistics | Integer | Player red cards for a match |
save_accuracy | players - statistics | Float | Save percentage for a goalkeeper in a match ex. 34.78 |
saves | players - statistics | Integer | Number of saves for a goalkeeper in a match |
seven_m_goals | players - statistics | Integer | Player 7-meter goals for a match |
seven_m_saves | players - statistics | Integer | Player 7-meter throw saves in a match |
shot_accuracy | players - statistics | Float | Player shot accuracy percentage for a match ex. 63.04 |
shots | players - statistics | Integer | Player shots for a match |
shots_against | players - statistics | Integer | Number of shots against for a goalkeeper in a match |
shots_off_goal | players - statistics | Integer | Player shots off goal for a match |
shots_on_goal | players - statistics | Integer | Player shots on goal for a match |
steals | players - statistics | Integer | Player steals for a match |
suspensions | players - statistics | Integer | Player suspensions for a match |
technical_fouls | players - statistics | Integer | Player technical fouls for a match |
yellow_cards | players - statistics | Integer | Player yellow cards for a match |