NBA Push Draft Trades retrieves summary details of all in-draft trades in real-time.
Syntax
https://api.sportradar.com/draft/nba/{access_level}/stream/en/trades/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.
Parameter | Description |
---|---|
draft | Draft id Example: draft=sd:draft:e04e45a4-7a76-470c-a3ee-ed6bd56583f1 |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/draft/nba/trial/stream/en/trades/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/trades/nba/trial/stream/en/picks/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.us/draft/nba/trial/stream/en/trades/subscribe?api_key={your_api_key}'
Samples with Query String Params
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/draft/nba/trial/stream/en/trades/subscribe?api_key={your_api_key}&draft=sd:draft:e04e45a4-7a76-470c-a3ee-ed6bd56583f1&league=NBA")
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/draft/nba/trial/stream/en/trades/subscribe",
params = {'api_key': 'your_api_key', 'draft': 'sd:draft:e04e45a4-7a76-470c-a3ee-ed6bd56583f1', 'league': 'NBA'},
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.us/draft/nba/trial/stream/en/trades/subscribe?api_key={your_api_key}&draft=sd:draft:e04e45a4-7a76-470c-a3ee-ed6bd56583f1&league=NBA'
Response Sample
The above commands return json like this.
Data Points
Draft Info:
Attribute | Parent Element | Type | Description |
---|---|---|---|
end_date | draft | Date | End date of a draft ex. 2022-06-23 |
id | draft | GUID | Unique ID of a draft ex. 01c63362-299c-48a0-b725-63fa18fca261 |
start_date | draft | Date | Start date of a draft ex. 2022-06-23 |
status | draft | String | Status of a draftscheduled , inprogress , complete , closed |
year | draft | Integer | Year of a draft |
Trade Info:
Attribute | Parent Element | Type | Description |
---|---|---|---|
id | trade | GUID | Unique ID of a trade ex. bced26d2-2b01-41f8-8d1c-7db9e926f758 |
sequence | trade | Integer | Sequence number of a trade ex. 1652884083078 |
complete | trade | Boolean | Signifies a trade is complete |
alias | transactions - to_team / from_team | String | Trade team alias ex. MIN (Minnesota) |
id | transactions | GUID | Unique ID of a trade ex. 86f84e62-684b-4667-a9c7-5ccb26b9962a |
id | transactions - to_team / from_team | GUID | Unique ID of a trade team ex. 583eca2f-fb46-11e1-82cb-f4ce4684ea4c |
market | transactions - to_team / from_team | String | Trade team market name ex. Minnesota |
name | transactions - to_team / from_team | String | Trade team name ex. Timberwolves |
Pick Info:
Attribute | Parent Element | Type | Description |
---|---|---|---|
amount | items | String | Amount of trade compensation |
id | items | String | Unique ID of a draft item |
type | items | String | Type of a draft itemcoach , future_pick , money , player , pick |
round | item - future_pick | Integer | Future pick round number |
year | item - future_pick | Integer | Future pick draft year |
id | items - pick | GUID | Unique ID of a draft pick ex. ca6b8dae-e835-49e4-9638-b30cdd3969a8 |
number | items - pick | Integer | Number of a draft pick within a round |
supplemental | items - pick | Boolean | Signifies a supplemental draft pick |
overall | items - pick | Integer | Overall number of a draft pick |
Round Info:
Attribute | Parent Element | Type | Description |
---|---|---|---|
end_date | pick - round | Date | End date of a round ex. 2022-06-23 |
id | pick - round | GUID | Unique ID of a round ex. 27b93f2c-95fb-4ba6-80ea-d50c95f7d1a4 |
number | pick - round | Integer | Number of a round |
start_date | pick - round | Date | Start date of a round ex. 2022-06-23 |
status | round | String | Status of a round ex. closed |
Broadcast:
Attribute | Parent Element | Type | Description |
---|---|---|---|
channel | broadcast | String | Name of the draft's broadcast channel |
network | broadcast | String | Name of the draft's broadcast network ex. ABC, ESPN |
League:
Attribute | Parent Element | Type | Description |
---|---|---|---|
alias | draft - league | String | Alias of a league ex. NBA |
id | draft - league | GUID | Unique ID of a league ex. 4353138d-4c22-4396-95d8-5f587d2df25c |
name | draft - league | String | Name of a league ex. NBA |
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
draft | metadata | GUID | Unique ID of a draft ex. sd:draft:e04e45a4-7a76-470c-a3ee-ed6bd56583f1 |
league | metadata | String | Alias of a league ex. NBA |
locale | metadata | String | Language code ex. en (English) |
operation | metadata | String | Operation of an updateupdate , delete |
version | metadata | String | Version of the API ex. v7 |