Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curious about ESPN API... #18

Closed
CMorton737 opened this issue Apr 9, 2017 · 5 comments
Closed

Curious about ESPN API... #18

CMorton737 opened this issue Apr 9, 2017 · 5 comments
Assignees

Comments

@CMorton737
Copy link

So I'm a little confused. I wasn't able to get this working on my machine, but before I dig into it too much... I'm curious how you were able to use the ESPN Fantasy Football API, seeing as they stopped issuing new API keys in 2012, and cut off all use in 2014 . Furthermore, I haven't been able to find any information online that would suggest that ESPN has a Fantasy Football API available at this moment. So I'm just curious if, and how, this works on the back-end?

@rbarton65
Copy link
Owner

Hello!

Thanks for taking interest in espnff! As you stated, ESPN doesn't support a public API. I happened to find the URL of their private API and was able to gather data in json format that way. Can you provide me with the steps you used to try to install espnff? What doesn't work?

@CMorton737
Copy link
Author

I did a pypi install and cloned the repo, both gave me the same error. However, it was specific to my league. When I tried another league it worked great! Here is the error I received

Traceback (most recent call last):
  File "playground.py", line 2, in <module>
    league = espnff.League(203986,2016)
  File "/usr/local/lib/python2.7/dist-packages/espnff/espnff.py", line 30, in __init__
    self._fetch_league()
  File "/usr/local/lib/python2.7/dist-packages/espnff/espnff.py", line 54, in _fetch_league
    self._fetch_settings(data)
  File "/usr/local/lib/python2.7/dist-packages/espnff/espnff.py", line 80, in _fetch_settings
    self.settings = Settings(data)
  File "/usr/local/lib/python2.7/dist-packages/espnff/espnff.py", line 195, in __init__
    self._fetch_tie_rules(data)
  File "/usr/local/lib/python2.7/dist-packages/espnff/espnff.py", line 253, in _fetch_tie_rules
    self.playoff_seed_tie_rule = playoff_tie_map[playoff_id]
KeyError: -1

So my next question is... were you able to find any other URLs other than leagueSettings and scoreboard? Specifically, were you able to find a way to access json data for a Fantasy teams lineup, whether it's a current lineup or lineups from prior matchups?

@rbarton65
Copy link
Owner

Sorry for being MIA on this for a bit - it looks like I'm going to have to find a way to populate classes with an exception rule.

I'm going to continue working on reverse engineering the API, I haven't exactly found those specific endpoints yet, however I'm sure they're out there.

@rbarton65 rbarton65 self-assigned this Jul 25, 2017
@rbarton65
Copy link
Owner

Looks like the map I had for playoff_seed_tie_rule wasn't correct. I fixed it locally and am running tests before releasing a patch.

@rbarton65
Copy link
Owner

This is fixed in new v1.3.1. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants