Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A Python wrapper for the Sportradar APIs

Project description

Sportradar APIs

Build Status PyPI version Python version

This is a Python wrapper for the sports APIs provided by Sportradar. You'll need to sign up for an API key to use the service. Sportradar provides a free trial evaluation that provides 1,000 API queries at up to 1 query per second.

Supported APIs

Sport API Wrapper Unit Tests
Soccer :soccer: :heavy_check_mark: :heavy_check_mark:
NBA :basketball: :heavy_check_mark: :heavy_check_mark:
WNBA :basketball: :heavy_check_mark: :heavy_check_mark:
NCAAMB :basketball: :heavy_check_mark: :heavy_check_mark:
NFL :football: :heavy_check_mark: :heavy_check_mark:
NHL :trophy: :heavy_check_mark: :heavy_check_mark:
Tennis :tennis: :heavy_check_mark: :heavy_check_mark:
MLB :baseball: :heavy_check_mark: :heavy_check_mark:
Darts :dart: :heavy_check_mark: :heavy_check_mark:
Beach volleyball :palm_tree: :heavy_check_mark: :heavy_check_mark:
Golf :golf: :heavy_check_mark: :heavy_check_mark:
NASCAR :red_car: :heavy_check_mark: :heavy_check_mark:
LoL :video_game: :heavy_check_mark: :heavy_check_mark:
Dota2 :video_game: :heavy_check_mark: :heavy_check_mark:
Cricket :cricket: :heavy_check_mark: :heavy_check_mark:
Rugby :rugby_football: :heavy_check_mark: :heavy_check_mark:


The easiest way to start using this package is via PyPI using pip:

$pip install sportradar

If you'd prefer to clone the repository and install the package manually, follow these steps:

  1. Clone this repo: $git clone
  2. Enter the cloned directory: $cd SportradarAPIs
  3. Install: $python install


Below is a brief demonstration of how to use the package to download data for the 2018 FIFA World Cup.

from sportradar import Soccer

# Create an instance of the Sportradar Soccer API class
sr = Soccer.Soccer("paste your api key here")

# Get a list of all tournaments
tournaments = sr.get_tournaments().json()

# Get info on the 2018 World Cup (Teams, Rounds, etc.)
worldcup = sr.get_tournament_info(tournaments['tournaments'][4]['id']).json()

# Get more information on each team in the World Cup
teams = []
team_counter = 0
for group in worldcup['groups']:
    for team in group['teams']:
        team_counter += 1
        team_id = team['id']
        team_name = team['name']
        print("({}): {}, {}".format(team_counter, team_name, team_id))
        except Exception as e:
            print("Error: {}".format(e))
        time.sleep(5) # wait 5 seconds before next API call

# Save the team data to a .json file
print("Saving the data...", end="", flush=True)
with open("world_cup_team_data.json", "w") as outfile:
    json.dump(teams, outfile)
print(" Done.")

Example projects

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sportradar, version 1.6.0
Filename, size File type Python version Upload date Hashes
Filename, size sportradar-1.6.0-py3-none-any.whl (23.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sportradar-1.6.0.tar.gz (14.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page