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
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 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_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
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 Feeds
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 Info
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 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_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_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)
MLB
coming ...
EPL
coming ..
F1
coming ...
College Basketball | CBB
coming ...
College Football | CFB
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.0-py3-none-any.whl.
File metadata
- Download URL: pyespn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 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 |
bac8081d129845c543cc90e8c90f46cb8b4d7719c125dead0b1155d7f87e1fe5
|
|
| MD5 |
fdbff81404c22fa569b9809c72c4f5e2
|
|
| BLAKE2b-256 |
68b3b8a6f490547166518a0fb0a2e41c819abdc0721fa6357c979f7f0f31f969
|