Skip to main content

A free sports API written for python

Project description

https://travis-ci.org/roclark/sportsreference.svg?branch=master Documentation Status

Sportsreference is a free python API that pulls the stats from www.sports-reference.com and allows them to be easily be used in python-based applications, especially ones involving data analytics and machine learning.

Sportsreference exposes a plethora of sports information from major sports leagues in North America, such as the MLB, NBA, College Football and Basketball, NFL, and NHL. Every sport has its own set of valid API queries ranging from the list of teams in a league, to the date and time of a game, to the total number of wins a team has secured during the season, and many, many more metrics that paint a more detailed picture of how a team has performed during a game or throughout a season.

Examples

The following are a few examples showcasing how easy it can be to collect an abundance of metrics and information from all of the tracked leagues. The examples below are only a miniscule subset of the total number of statistics that can be pulled using sportsreference. Visit the documentation on Read The Docs for a complete list of all information exposed by the API.

Get instances of all NHL teams for the 2018 season

from sportsreference.nhl.teams import Teams

teams = Teams(2018)

Get a specific NFL team’s season information

from sportsreference.nfl.teams import Teams

teams = Teams()
lions = teams('DET')

Get a Pandas DataFrame of all stats for a MLB game

from sportsreference.mlb.boxscore import Boxscore

game = Boxscore('BOS201806070')
df = game.dataframe

Documentation

Complete documentation is hosted on readthedocs.org. Refer to the documentation for a full list of all metrics and information exposed by sportsreference. The documentation is auto-generated using Sphinx based on the docstrings in the sportsreference package.

Project details


Download files

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

Source Distribution

sportsreference-0.1.1.tar.gz (124.7 kB view hashes)

Uploaded Source

Built Distribution

sportsreference-0.1.1-py2.py3-none-any.whl (212.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page