GuidesDocs
Coverage MatrixDocumentationChange LogLog InContact Us
Guides

Authentication

Below is an example call to the NFL API v5 using API key authentication:

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.us/nfl/official/trial/v5/en/games/2019/reg/schedule.xml?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 http.client

conn = http.client.HTTPSConnection("api.sportradar.us")

conn.request("GET", "/nfl/official/trial/v5/en/games/2019/reg/schedule.xml?api_key=`{your_api_key}`")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl -X GET "https://api.sportradar.us/nfl/official/trial/v5/en/games/2019/reg/schedule.xml?api_key=`{your_api_key}`"

You must replace {your_api_key} with your API key. If you have upgraded from a trial key, be sure to change the access_level in the URL to reflect your production key. See the required parameters for the API for details.

Sportradar APIs use api_key authentication within the query to allow access to the API. Each API requires its own separate key, and the key must be included in each request. To authenticate with the server, replace {your_api_key} with your API key for the requested API.

You can register for free API trial keys at our developer portal.

You must replace {your_api_key} with your API key. If you have upgraded from a trial key, be sure to change the access_level in the URL to reflect your production key. See the required parameters for the API for details.