Wrapper for hidden ESPN API
Project description
espn-api
work in progress for hitting hidden espn api, right now there is nfl and nba functions, stay tuned for more
Table of Contents
NFL
includes information on apis available for the nfl
Data Files
pyespn.nfl.data.nfl_teams_data ⇒
This is a list of ids/teams in json format
example
from pyespn.nfl.data import nfl_teams_data
print(nfl_teams_data)
Team Data
functions under here get team data
pyespn.nfl.get_team_info(team_id) ⇒
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
example
from pyespn.nfl import get_team_info
team_id = 30 # JAX
team_info = get_team_info(team_id=team_id)
print(team_info)
Player Data
these functions pull player data
pyespn.nfl.get_player_info(player_id) ⇒
Gets player info from espn api
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.nfl import get_player_info
player_id = 278 # Jimmy Smith, Goat
player_info = get_player_info(player_id=player_id)
print(player_info)
pyespn.nfl.get_nfl_players_historical_stats(player_id) ⇒
Gets all players stats for career
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.nfl import get_nfl_players_historical_stats
player_id = 278 # Jimmy Smith, Goat
player_info = get_nfl_players_historical_stats(player_id=player_id)
print(player_info)
Draft Data
these functions pull data for the draft
pyespn.nfl.get_draft_pick_data(team_id) ⇒
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| pick_round | number |
round of pick |
| pick | number |
pick number in round (not overall) |
| season | number |
season of draft |
example
from pyespn.nfl import get_draft_pick_data
season = 2020
pick = 1
pick_round = 1
draft_pick_info = get_draft_pick_data(pick_round=pick_round,
pick=pick,
season=season)
print(draft_pick_info)
Game/Event Data
functions under here retrieve event/game info. game id is required and is the same from espn front page
pyespn.nfl.get_game_info(team_id, season) ⇒
returns a info related toa single event
| Param | Type | Description |
|---|---|---|
| event_id | number |
id for event |
from pyespn.nfl import get_game_info
event_id = 401671889 # 2025 Super Bowl
game_info = get_game_info(event_id=event_id)
print(game_info)
Betting Data
functions under here get betting data, against the spread and futures
pyespn.nfl.get_year_nfl_super_bowl_futures(season, provider) ⇒
returns futures for superbowl winner for a given year
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nfl import get_year_nfl_super_bowl_futures
season = 2023
provider = 'DraftKings'
futures_record = get_year_nfl_super_bowl_futures(season=season,
provider=provider)
print(futures_record)
pyespn.nfl.get_year_nfc_division_champ_futures(season, provider) ⇒
returns afc division champions futures
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| division | string |
Division. Options: |
| - north | ||
| - south | ||
| - west | ||
| - east | ||
| - conf | ||
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nfl import get_year_afc_division_champ_futures
season = 2023
division = 'south'
provider = 'DraftKings'
futures_record = get_year_afc_division_champ_futures(season=season,
division=division,
provider=provider)
print(futures_record)
pyespn.nfl.get_year_nfc_division_champ_futures(season, provider) ⇒
returns nfc division champions futures
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| division | string |
Division. Options: |
| - north | ||
| - south | ||
| - west | ||
| - east | ||
| - conf | ||
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nfl import get_year_nfc_division_champ_futures
season = 2023
division = 'south'
provider = 'DraftKings'
futures_record = get_year_nfc_division_champ_futures(season=season,
division=division,
provider=provider)
print(futures_record)
pyespn.nfl.get_team_year_ats_overall(team_id, season) ⇒
returns a teams overall against the spread for a season
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_overall
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_overall(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_underdog(team_id, season) ⇒
returns a teams against the spread for a season as an underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_underdog
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_underdog(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_away(team_id, season) ⇒
returns a teams against the spread for a season as the away team
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_away
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_away(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_home(team_id, season) ⇒
returns a teams against the spread for a season as the home team
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_home
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_home(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_home_favorite(team_id, season) ⇒
returns a teams against the spread for a season as the home team and favorite
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_home_favorite
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_home_favorite(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_away_underdog(team_id, season) ⇒
returns a teams against the spread for a season as the away team and underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_away_underdog
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_away_underdog(team_id=team_id,
season=season)
print(ats_record)
pyespn.nfl.get_team_year_ats_home_underdog(team_id, season) ⇒
returns a teams against the spread for a season as the home team and underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nfl import get_team_year_ats_home_underdog
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_home_underdog(team_id=team_id,
season=season)
print(ats_record)
NBA
Data Files
pyespn.nba.data.nfl_teams_data ⇒
This is a list of ids/teams in json format
example
from pyespn.nba.data import nba_teams_data
print(nba_teams_data)
Team Data
pyespn.nba.get_team_info(team_id) ⇒
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
example
from pyespn.nba import get_team_info
team_id = 26 # Jazz
team_info = get_team_info(team_id=team_id)
print(team_info)
Player Data
these functions pull player data
pyespn.nba.get_player_info(player_id) ⇒
Gets player info from espn api
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.nba import get_player_info
player_id = 4397002 # Ayo
player_info = get_player_info(player_id=player_id)
print(player_info)
pyespn.nba.get_nba_players_historical_stats(player_id) ⇒
Gets all players stats for career
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.nba import get_nba_players_historical_stats
player_id = 4397002 # Ayo
player_info = get_nba_players_historical_stats(player_id=player_id)
print(player_info)
Game/Event Data
functions under here retrieve event/game info. game id is required and is the same from espn front page
pyespn.nba.get_game_info(team_id, season) ⇒
returns a info related toa single event
| Param | Type | Description |
|---|---|---|
| event_id | number |
id for event |
from pyespn.nba import get_game_info
event_id = 401705402 # a game
game_info = get_game_info(event_id=event_id)
print(game_info)
Betting Data
functions under here get betting data, against the spread
pyespn.nba.get_year_nba_champ_futures(season, provider) ⇒
returns futures for finals winner for a given year
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nba import get_year_nba_champ_futures
season = 2023
provider = 'DraftKings'
futures_record = get_year_nba_champ_futures(season=season,
provider=provider)
print(futures_record)
pyespn.nba.get_year_east_champ_futures(season, provider) ⇒
returns futures for east conf finals winner for a given year
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nba import get_year_east_champ_futures
season = 2023
provider = 'DraftKings'
futures_record = get_year_east_champ_futures(season=season,
provider=provider)
print(futures_record)
pyespn.nba.get_year_west_champ_futures(season, provider) ⇒
returns futures for west conf finals winner for a given year
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.nba import get_year_west_champ_futures
season = 2023
provider = 'DraftKings'
futures_record = get_year_west_champ_futures(season=season,
provider=provider)
print(futures_record)
pyespn.nba.get_team_year_ats_overall(team_id, season) ⇒
returns a teams overall against the spread for a season
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_overall
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_overall(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_underdog(team_id, season) ⇒
returns a teams against the spread for a season as an underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_underdog
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_underdog(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_away(team_id, season) ⇒
returns a teams against the spread for a season as the away team
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_away
team_id = 30 # JAX
season = 2020
ats_record = get_team_year_ats_away(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_home(team_id, season) ⇒
returns a teams against the spread for a season as the home team
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_home
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_home(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_home_favorite(team_id, season) ⇒
returns a teams against the spread for a season as the home team and favorite
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_home_favorite
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_home_favorite(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_away_underdog(team_id, season) ⇒
returns a teams against the spread for a season as the away team and underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_away_underdog
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_away_underdog(team_id=team_id,
season=season)
print(ats_record)
pyespn.nba.get_team_year_ats_home_underdog(team_id, season) ⇒
returns a teams against the spread for a season as the home team and underdog
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
| season | number |
year of season |
from pyespn.nba import get_team_year_ats_home_underdog
team_id = 26 # Jazz
season = 2020
ats_record = get_team_year_ats_home_underdog(team_id=team_id,
season=season)
print(ats_record)
Draft Data
these functions pull data for the draft
pyespn.nba.get_draft_pick_data(team_id) ⇒
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| pick_round | number |
round of pick |
| pick | number |
pick number in round (not overall) |
| season | number |
season of draft |
example
from pyespn.nba import get_draft_pick_data
season = 2021
pick = 8
pick_round = 2
draft_pick_info = get_draft_pick_data(pick_round=pick_round,
pick=pick,
season=season)
print(draft_pick_info)
College Football | CFB
Data Files
This is the data feeds for college football - note as of 0.1.2 there are still missing values
pyespn.cfb.data.cfb_teams_data ⇒
This is a list of ids/teams in json format - currently missing values
example
from pyespn.cfb.data import cfb_teams_data
print(cfb_teams_data)
Team Data
pyespn.cfb.get_team_info(team_id) ⇒
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
example
from pyespn.cfb import get_team_info
team_id = 356 # Illini
team_info = get_team_info(team_id=team_id)
print(team_info)
Player Data
pyespn.cfb.get_player_info(player_id) ⇒
Gets player info from espn api
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.cfb import get_player_info
player_id = 505719 # Blake Bortles, Garbage Time Goat
player_info = get_player_info(player_id=player_id)
print(player_info)
pyespn.cfb.get_cfb_players_historical_stats(player_id) ⇒
Gets all players stats for career
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn.cfb import get_cfb_players_historical_stats
player_id = 505719 # Blake Bortles, Garbage Time Goat
player_info = get_cfb_players_historical_stats(player_id=player_id)
print(player_info)
Recruiting Data
pyespn.cfb.get_recruiting_rankings(season) ⇒
Gets all players stats for career
| Param | Type | Description |
|---|---|---|
| season | number |
season for rankings |
example
from pyespn.cfb import get_recruiting_rankings
season = 2020
recruiting_rankings = get_recruiting_rankings(season=season)
for recruit in recruiting_rankings:
print(recruit)
Game/Event Data
functions under here retrieve event/game info. game id is required and is the same from espn front page
pyespn.cfb.get_game_info(event_id) ⇒
returns a info related toa single event
| Param | Type | Description |
|---|---|---|
| event_id | number |
id for event |
from pyespn.cfb import get_game_info
event_id = 401677192 # 2025 cfp title game osu/nd
game_info = get_game_info(event_id=event_id)
print(game_info)
Betting Data
These functions have betting details, rn there are futures data. note there could be more providers
pyespn.cfb.get_year_cfb_champions_futures(season, provider) ⇒
returns futures for cfp champion for a given year
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.cfb import get_year_cfb_champions_futures
season = 2023
provider = 'DraftKings'
futures_record = get_year_cfb_champions_futures(season=season,
provider=provider)
print(futures_record)
pyespn.cfb.get_year_conference_champ_futures(season, provider) ⇒
returns a conferences champions futures
| Param | Type | Description |
|---|---|---|
| season | number |
Year of season |
| conference | string |
Conference. Options: |
| - big12 | ||
| - big10 | ||
| - big10 east | ||
| - big10 west | ||
| - acc | ||
| - aac | ||
| - usa | ||
| - mid-am | ||
| - mid-am east | ||
| - mid-am west | ||
| - mt west | ||
| - pac12 | ||
| - sec | ||
| - sec west | ||
| - sec east | ||
| - sun belt | ||
| provider | string |
Betting provider. Options: |
| - DraftKings | ||
| - SugarHouse | ||
| - Caesars Sportsbook (New Jersey) | ||
| - PointsBet | ||
| - Caesars Sportsbook (Colorado) | ||
| - Holland Casino | ||
| - Caesars Sportsbook (Tennessee) | ||
| - FanDuel | ||
| - Unibet | ||
| - Bet365 |
from pyespn.cfb import get_year_conference_champ_futures
season = 2023
conference = 'south'
provider = 'DraftKings'
futures_record = get_year_conference_champ_futures(season=season,
conference=conference,
provider=provider)
print(futures_record)
Men's College Basketball | MCBB
next up ...
MLB
coming ...
EPL
coming ..
F1
coming ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyespn-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyespn-0.1.2-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca21049463b8f8871c5489c9c8dbcc8c36f0f238652e34d2bfb6461abc393121
|
|
| MD5 |
315757d13a89f9f6c6c47e7e811962d2
|
|
| BLAKE2b-256 |
ced90c12a0b1f92d74713964acba4b06f517c1fd751c9fbf1cb1088e0ab41a61
|