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.7-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyespn-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 33.6 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2e5baac98b936cf0a118a85b9e6c87d90521adc993826b83b8b3f51d82e4cd6f
MD5 16e360bdaa84eb013f1828b2ef595e21
BLAKE2b-256 c513152faac0b6ef43160603718653c0ffcd55dcd8afd9ddf3c423a7fa7c26a5

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