How to Access the Unofficial ESPN Fantasy Footbball API with Python
- pandas
- requests
- espn fantasy football account
- python-dotenv
Create a .env
file and add the following
export LEAGUE_ID = 'YOU_LEAGUE_ID_HERE'
export SWID_COOKIE = "YOUR_SWID_COOKIE_HERE"
export ESPN_S2_COOKIES = "YOUR_ESPN_S2_COOKIE_HERE"
Make sure to update your league_id and adjust the years list in static.py
to match the years in your fantasy football league
$ python draft_history.py