Authentication & Authorization
Authentication
Sportradar APIs use API key authentication as your unique identifier to allow access. Use your API key in the header of each request.
API keys are randomly generated 40 characters. Please note that keys from our previous system are 24 characters.
Sample Requests
Below are example requests using API key authentication in the header.
NFL API
curl --request GET \
--url https://api.sportradar.com/nfl/official/trial/v7/en/games/2024/REG/schedule.json \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'
require 'uri'
require 'net/http'
url = URI("https://api.sportradar.com/nfl/official/trial/v7/en/games/2024/REG/schedule.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["x-api-key"] = 'YOUR_API_KEY'
response = http.request(request)
puts response.read_body
import requests
url = "https://api.sportradar.com/nfl/official/trial/v7/en/games/2024/REG/schedule.json"
headers = {
"accept": "application/json",
"x-api-key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.text)
Soccer API
curl --request GET \
--url https://api.sportradar.com/soccer/trial/v4/en/competitions.json \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'
require 'uri'
require 'net/http'
url = URI("https://api.sportradar.com/soccer/trial/v4/en/competitions.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["x-api-key"] = 'YOUR_API_KEY'
response = http.request(request)
puts response.read_body
import requests
url = "https://api.sportradar.com/soccer/trial/v4/en/competitions.json"
headers = {
"accept": "application/json",
"x-api-key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.text)
For proper syntax of each endpoint, visit the API Endpoint docs (NFL, Soccer).
Authorization
To authorize to our APIs you need to create an account. Sign up for a free trial or access your existing account here.
Within each application on your account is a unique master API key that is applicable across all products associated with that application. These may be licensed products or free trials.
For more information on accounts and access, see our Account Info section.
Updated 10 days ago