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 i am not affiliated with espn not all api end points are available for all leagues, i am working on adding in exceptions but you could get odd errors if say you try recruiting rankings for the nfl
Table of Contents
PYESPN
includes information on apis available for the nfl
Init Class
create an init version of the class and feed it the league you want
| Param | Type | Description |
|---|---|---|
| league | string |
League. Options: |
| - nfl | ||
| - nba | ||
| - mcbb | ||
| - cfb |
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
Data Files
This is a list of ids/teams in json format that relate to the api and are used in the code.
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
nba_espn = PYESPN(sport_league='nba')
print(nfl_espn.TEAM_ID_MAPPING) #nfl team map
print(nba_espn.TEAM_ID_MAPPING) #nba team map
Team Data
Gets team info from espn api
| Param | Type | Description |
|---|---|---|
| team_id | number |
id for team |
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
team_id = 30 #jax
jags_team_info = nfl_espn.get_team_info(team_id=team_id)
print(jags_team_info)
Player Data
gets player level details from api
| Param | Type | Description |
|---|---|---|
| player_id | number |
id for player |
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
player_id = 278 # Jimmy Smith, Goat
jimmy_smith = nfl_espn.get_player_info(player_id=player_id)
print(jimmy_smith)
Game/Event Data
gets event/game details from api. the event ids can be found on the espn site web urls
| Param | Type | Description |
|---|---|---|
| event_id | number |
id for event |
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
event_id = 401671889 # 2025 Super Bowl
super_bowl = nfl_espn.get_game_info(event_id=event_id)
print(super_bowl)
Recruiting Data
this pulls recruiting data and is currently only works for mcbb and cfb
| Param | Type | Description |
|---|---|---|
| season | number |
season for rankings |
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
season = 2020
recruiting_rankings = nfl_espn.get_recruiting_rankings(season=season)
for recruit in recruiting_rankings:
print(recruit)
Draft Data
Gets team info from espn api, this is available for pro leagues
| 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 import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
season = 2020
pick = 1
pick_round = 1
draft_pick_info = nfl_espn.get_draft_pick_data(pick_round=pick_round,
pick=pick,
season=season)
print(draft_pick_info)
Betting Data
Betting Providers
there are many betting providers across the espn api and they dont appear to be consistant in my profiling. the ones that i have found can be accessed via
example
from pyespn import PYESPN
nfl_espn = PYESPN(sport_league='nfl')
print(nfl_espn.BETTING_PROVIDERS)
Against the Spread
Futures
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.4-py3-none-any.whl.
File metadata
- Download URL: pyespn-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.8 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 |
d60d76d7184275c65339023d2d7c820c60c268005f520803e1eabb69611b08b2
|
|
| MD5 |
dc8b57516a571168adb995364a434d94
|
|
| BLAKE2b-256 |
f46dde924d9aa33ecc2ba5b0c98936945f1c0488816d7b0e1602b923f4c5b387
|