Skip to main content

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyespn-0.1.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file pyespn-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pyespn-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pyespn-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 af92c7ad3581c11a6bfd7c6e234f5afca82324226f9c6c03f0ac44cbe88d0d66
MD5 c0307dadf659d776db63b8ca33d4d81b
BLAKE2b-256 cbd6a545f50ed58f22afebf345e6d1c806eec7395c6719647458db7bb5e1a42d

See more details on using hashes here.

Supported by

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