MLB Push Probable Pitchers provides real-time updates to probable pitchers for upcoming games.
Syntax
https://api.sportradar.com/mlb/{access_level}/stream/en/probables/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 |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/mlb/trial/stream/en/probables/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/mlb/trial/stream/en/probables/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/mlb/trial/stream/en/probables/subscribe?api_key={your_api_key}'
Response Sample
The above commands return json like this.
Data Points
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
event_type | metadata | String | Type of an eventprobable |
league | metadata | String | Alias of a league ex. MLB |
locale | metadata | String | Language code ex. en (English) |
match | metadata | GUID | Unique ID of a game ex. sd:match:30ad883f-aeaf-4e6b-9fd9-a1cc0b6c4679 |
operation | metadata | String | Operation of an updatecreate , update , delete |
status | metadata | String | The status of a gamescheduled , inprogress , complete , closed , wdelay , fdelay , odelay , canceled , unnecessary , if-necessary , postponed , suspended , maintenance |
version | metadata | String | Version of the API ex. v6.5 |
Boxscore:
Attribute | Parent Element | Type | Description |
---|---|---|---|
abbr | away | String | Abbreviation of the away team ex. MIN (Minnesota) |
errors | away | Integer | Number of errors for the away team |
hits | away | Integer | Number of hits for the away team |
id | away | GUID | Unique ID of the away team ex. 29dd9a87-5bcc-4774-80c3-7f50d985068b |
market | away | String | Market name of the away team ex. Colorado |
name | away | String | Team name of the away team ex. Rockies |
runs | away | Integer | Number of runs for the away team in the game |
abbr | home | String | Abbreviation of the home team ex. CLE (Cleveland) |
errors | home | Integer | Number of errors for the home team |
hits | home | Integer | Number of hits for the home team |
id | home | GUID | Unique ID of the home team ex. 29dd9a87-5bcc-4774-80c3-7f50d985068b |
market | home | String | Market name of the home team ex. Cleveland |
name | home | String | Team name of the home team ex. Guardians |
runs | home | Integer | Number of runs for the home team in the game |
abbr | team | String | Abbreviation of a team ex. TB (Tampa Bay) |
Probable Pitchers:
Note: A new probable pitcher entry will appear under new, replacing the previous probable under previous.
Attribute | Parent Element | Type | Description |
---|---|---|---|
first_name | probable - previous / new | String | First name of a probable pitcher ex. Aaron |
full_name | probable - previous / new | String | Full name of a probable pitcher ex. Aaron Nola |
suffix | probable - previous / new | String | Name suffix of a probable pitcher ex. Jr. |
id | probable - previous / new | GUID | Unique ID of a probable pitcher ex. ded1b30d-52ca-4eec-bce6-251b15b085ac |
jersey_number | probable - previous / new | Integer | Number of a probable pitcher's jersey |
last_name | probable - previous / new | String | Last name of a probable pitcher ex. Nola |
preferred_name | probable - previous / new | String | Preferred name of a probable pitcher ex. Aaron |
updated | probable | dateTime | Timestamp of a probable pitcher update ex. 2022-10-26T20:06:00Z |
abbr | probable - team | String | Abbreviation of a team making a probable pitcher update ex. PHI (Philadelphia) |
id | probable - team | GUID | Unique ID of a team making a probable pitcher update ex. 2142e1ba-3b40-445c-b8bb-f1f8b1054220 |
market | probable - team | String | Market name of a team making a probable pitcher update ex. Philadelphia |
name | probable - team | String | Name of a team making a probable pitcher update ex. Phillies |
Game:
Attribute | Parent Element | Type | Description |
---|---|---|---|
away_team | game | GUID | Unique ID of the away team ex. 29dd9a87-5bcc-4774-80c3-7f50d985068b |
coverage | game | String | Coverage level of a gamefull , boxscore |
double_header | game | Boolean | Signifies whether a game is part of a double header |
day_night | game | String | Signifies a day or night gameD , N |
entry_mode | game | String | Signifies the type of data entrySTOMP , LDE |
home_team | game | GUID | Unique ID of the home team ex. ef64da7f-cfaf-4300-87b0-9313386b977c |
id | game | GUID | Unique ID of the game ex. 1b554f5e-d8b7-4268-95da-2f4191015c84 |
game_number | game | Integer | Number of the game |
ps_game | game | Integer | Game number in a series |
ps_round | game | String | Name of a series ex. ALDS |
reference | game | String | Unique MLBAM ID of a game |
scheduled | game | dateTime | Scheduled date and time of a game ex. 2022-09-25T20:10:00+00:00 |
split_squad | game | Boolean | Signifies a Spring Training split squad game |
status | game | String | The status of a gamescheduled , inprogress , complete , closed , wdelay , fdelay , odelay , canceled , unnecessary , if-necessary , postponed , suspended , maintenance |