Need help with espn-api?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

206 Stars 89 Forks MIT License 378 Commits 18 Opened issues


ESPN Fantasy API! (Football, Basketball)

Services available


Need anything else?

Contributors list

# 13,372
10 commits
# 3,242
1 commit
# 611,595
1 commit

codecov Join the chat at PyPI version


[NOTICE] Username and password will be removed soon. You can access your private league using SWID and ESPN_S2.

This package uses ESPN's Fantasy API to extract data from any public or private league for Fantasy Football and Basketball (Hockey and Baseball in development).
Please feel free to make suggestions, bug reports, and pull request for features or fixes!

This package was inspired and based off of rbarton65/espnff.


With Git:

git clone
cd espn-api
python3 install
With pip:
pip install espn_api


For Getting Started and API details head over to the Wiki!

# Football API
from import League
# Basketball API
from import League
# Hockey API
from import League
# Baseball API
from import League
# Init
league = League(league_id=222, year=2019)

Run Tests

python3 nosetests

Discussions (new)

If you have any questions about the package, ESPN API data, or want to talk about a feature please start a discussion!

Issue Reporting

If you find a bug follow the steps below for reporting.

  1. Open a new issue with a brief description of the bug for the title. In the title also add which sport (Football or Basketball)

  2. Run the application in debug mode to view ESPN API request's and response's ```python

    ... import statement above

    league = League(league_id=1245, year=2019, debug=True) ``` The application will print all requests and the response from ESPN's API in the console. I would suggest piping the console output to a text file as it will be a lot of data.

  3. Find the last log before the crash and copy it in the issue descrption with the line number of the crash or possible bug.

  4. Submit the new issue!

I will try to comment on the issue as soon as possible with my thoughts and possible fix!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.