NFL Push Draft Trades provides summary details of all in-draft trades in real-time.
Syntax
| https://api.sportradar.com/draft/nfl/{access_level}/stream/{language_code}/trades/subscribe |
Parameters
| Parameter | Description |
|---|---|
access_level | Defines the access level of your API keyproduction, trial |
language_code | 2-letter code for supported languagesen (English) |
Optional Query String Parameters
By default, a Push feed will provide all data available for all in-progress events. If needed, you can filter the data returned by including query strings.
Each query string parameter can be added with a preceding ampersand (&).
| Parameter | Description |
|---|---|
{draft} | Draft id Example: draft=sd:draft:04b11293-240e-4340-8f4f-ded6c6281fe9 |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/draft/nfl/trial/stream/en/trades/subscribe")
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)
request["x-api-key"] = "`{your_api_key}`" # Replace with your actual key
response = http.request(request)
puts response.read_bodyimport requests
import json
headers = {
'x-api-key': '`your_api_key`' # Replace with your actual key
}
r = requests.get("https://api.sportradar.com/draft/nfl/trial/stream/en/trades/subscribe",
allow_redirects=False)
redirect_url = r.headers['Location']
r = requests.get(redirect_url, stream=True, headers=headers)
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 -X GET 'https://api.sportradar.us/draft/nfl/trial/stream/en/trades/subscribe' \
-H 'x-api-key: `{your_api_key}`'Samples with Query String Params
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/draft/nfl/trial/stream/en/trades/subscribe?&draft=draft=sd:draft:04b11293-240e-4340-8f4f-ded6c6281fe9")
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)
request["x-api-key"] = "`{your_api_key}`" # Replace with your actual key
response = http.request(request)
puts response.read_bodyimport requests
import json
headers = {
'x-api-key': '`your_api_key`' # Replace with your actual key
}
r = requests.get("https://api.sportradar.com/draft/nfl/trial/stream/en/trades/subscribe",
params = {'draft': 'sd:draft:04b11293-240e-4340-8f4f-ded6c6281fe9'},
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 -X GET 'https://api.sportradar.com/draft/nfl/trial/stream/en/trades/subscribe?&draft=sd:draft:04b11293-240e-4340-8f4f-ded6c6281fe9'
-H 'x-api-key: `{your_api_key}`'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-04-30 |
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-04-30 |
status | draft | String | Status of a draft ex. closed |
year | draft | Integer | Year of a draft |
Trade Info
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
id | trade | GUID | Unique ID of a trade ex. 3fc4ffa0-fe54-4d9a-bf53-e85df0e2cefd |
sequence | trade | Integer | Sequence number of a trade ex. 1648829953213 |
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. 88db5bd9-f8ef-4ddc-a4fc-0de7a04b2d56 |
id | transactions - to_team/from_team | GUID | Unique ID of a trade team ex. 82d2d380-3834-4938-835f-aec541e5ece7 |
market | transactions - to_team/from_team | String | Trade team market name ex. Minnesota |
name | transactions - to_team/from_team | String | Trade team name ex. Vikings |
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 item ex. future_pick or player |
round | item - future_pick | Integer | Future pick round number |
year | item - future_pick | Integer | Future pick draft year |
compensatory | item - pick | Boolean | Signifies a compensatory draft pick |
id | item - pick | GUID | Unique ID of a draft pick ex. ca6b8dae-e835-49e4-9638-b30cdd3969a8 |
number | item - pick | Integer | Number of a draft pick within a round |
supplemental | item - pick | Boolean | Signifies a supplemental draft pick |
overall | item - pick | Integer | Overall number of a draft pick |
Round Info
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
end_date | round | Date | End date of a round ex. 2022-04-30 |
id | round | GUID | Unique ID of a round ex. 2e9eee59-fdc4-4dbf-bafa-b1cc80976fdb |
number | round | Integer | Number of a round |
start_date | round | Date | Start date of a round ex. 2022-04-30 |
League
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
alias | league | String | Alias of a league ex. NFL |
id | league | GUID | Unique ID of a league ex. 3c6d318a-6164-4290-9bbc-bf9bb21cc4b8 |
name | league | String | Name of a league ex. National Football League |
Players
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
first_name | player | String | First name of a player ex. Patrick |
id | player | GUID | Unique ID of a player ex. 11cad59d-90dd-449c-a839-dddaba4fe16c |
last_name | player | String | Last name of a player ex. Mahomes |
position | player | String | Position of a player See our FAQ for a list of valid positions |
source_id | player | GUID | Unique ID of a player's source team ex. 9fe7c9f9-5830-4e22-953d-054a44342323 |
sr_id | player | GUID | Unique Sportradar ID of a player ex. sr:player:1234416 |
Coaches
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
first_name | coach | String | First name of a coach ex. Dennis |
id | coach | GUID | Unique ID of a coach ex. ef1b4704-0ce4-4977-a882-2b14413dd2d2 |
last_name | coach | String | Last name of a coach ex. Allen |
source_id | coach | GUID | Unique ID of a player's source team ex. 9fe7c9f9-5830-4e22-953d-054a44342323 |
Metadata
| Attribute | Parent Element | Type | Description |
|---|---|---|---|
league | metadata | String | Alias of a league ex. NFL |
draft | metadata | String | Unique ID of a draft ex. sd:draft:04b11293-240e-4340-8f4f-ded6c6281fe9 |
locale | metadata | String | Language code ex. en (English) |
operation | metadata | String | Operation of an updateupdate, delete |
version | metadata | String | Version of the API ex. v1 |
