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

ESPN Fantasy platform updates broke JSON parsing? #59

Open
earlejam opened this issue Feb 15, 2019 · 16 comments
Open

ESPN Fantasy platform updates broke JSON parsing? #59

earlejam opened this issue Feb 15, 2019 · 16 comments

Comments

@earlejam
Copy link

earlejam commented Feb 15, 2019

From what I can tell, some big changes to the ESPN fantasy platform may have changed the format of the JSON this package parses. Especially when attempting to get the leage: league = League(league_id, year).

I get a JSONDecodeError("Expecting value", s, err.value) from None followed by json.decoder.JSONDecodeError: Expecting value: line 2 column 2 (char 2). Can anyone else confirm this problem?

@danabrey
Copy link

All of the API endpoints that I've tried appear to be redirecting to http://www.espn.com/fantasy/football/. They've either moved their API endpoints to a new location, or got rid of it.

@danabrey
Copy link

danabrey commented Feb 18, 2019

The new API is based at http://fantasy.espn.com/apis/v3 but the URLs bear no resemblance to v2.

League pages now make a call to e.g. http://fantasy.espn.com/apis/v3/games/ffl/seasons/2018/segments/0/leagues/7168?view=mBoxscore&view=mMatchupScore&view=mSchedule&view=mScoreboard&view=mSettings&view=mStatus&view=mTeam&view=mRoster&view=modular&view=mNav

That path appears to give all the available data for a league, regardless of what you pass as the value of the view GET parameter (obviously, as they're actually overriding it 10+ times in that URL!).

@danabrey
Copy link

@rbarton65 Looks like the ESPN relaunch has totally messed this up, would gladly assist in trying to fix this up.

@scottenriquez
Copy link

scottenriquez commented Mar 16, 2019

@danabrey do you by chance have a list of the new endpoints? I wrote a .NET package for this that I need to update as well. I haven't started sniffing out the endpoints yet, so I figured I'd check to see if you have.

Also, here's a URL for my league which is public unlike the link above: http://fantasy.espn.com/apis/v3/games/ffl/seasons/2019/segments/0/leagues/526113?view=mBoxscore&view=mMatchupScore&view=mSchedule&view=mScoreboard&view=mSettings&view=mStatus&view=mTeam&view=mRoster&view=modular&view=mNav

Side note: I reached out to my comish, and he said that as part of this redesign, our league got reset to private. Sounds like if you were using a public league like us, you'll need to set it to public again.

@danabrey
Copy link

@scottenriquez From what I could see when I last looked, there isn't a "list" of endpoints because that's the only one. Whatever you pass as the value of the "view" GET parameter, you get everything.

Thanks for the pointer about the league being reset to private!

@bluesforsalvador
Copy link

I love this project to help me score my league's non-standard scoring system.
Is this fixable (need help?) Or shall I go back to keeping score with a spreadsheet =/

@danabrey
Copy link

danabrey commented Aug 1, 2019

The last activity on this project was in August 2017 so I am sort of assuming that @rbarton65 has moved on to other things, given that that was their last GitHub activity too? It might be a fork-and-fix job, and then a courtesy pull request. I am happy to help but I'm not an experienced Python developer.

@thend20
Copy link

thend20 commented Aug 1, 2019

I hacked a few things into this module for my personal use. I was planning to see if I can salvage anything using the v3 endpoints before the start of this season. If I find anything, I'll fork and post it here.

@thend20
Copy link

thend20 commented Aug 1, 2019

And look at that, someone already documented and built a "thing" with the new V3 api! https://github.com/mkreiser/ESPN-Fantasy-Football-API . This is in Node however. But, this is good, a lot of the hard work is already done.

@kstreepy
Copy link

kstreepy commented Aug 5, 2019

I would be interested in supporting/working on anything related to this. Found another resource with a Python focus: https://stmorse.github.io/journal/espn-fantasy-v3.html

@kstreepy
Copy link

kstreepy commented Aug 6, 2019

Here is a repo of a python V3 API in progress: https://github.com/cwendt94/ff-espn-api

@tflurry
Copy link

tflurry commented Sep 28, 2019

@danabrey do you by chance have a list of the new endpoints? I wrote a .NET package for this that I need to update as well. I haven't started sniffing out the endpoints yet, so I figured I'd check to see if you have.

Also, here's a URL for my league which is public unlike the link above: http://fantasy.espn.com/apis/v3/games/ffl/seasons/2019/segments/0/leagues/526113?view=mBoxscore&view=mMatchupScore&view=mSchedule&view=mScoreboard&view=mSettings&view=mStatus&view=mTeam&view=mRoster&view=modular&view=mNav

Side note: I reached out to my comish, and he said that as part of this redesign, our league got reset to private. Sounds like if you were using a public league like us, you'll need to set it to public again.

Are you able to get the url above to work with seasons prior to 2018? I only seem to be able to get it to work with 2018 and 2019.

@scottenriquez
Copy link

@tflurry I ran into the same issue and haven't found a way around this.

@danabrey
Copy link

Yeah, ESPN just killed any sort of public access to that history. There's no way of accessing it on the front-end anymore either. Shame.

@tflurry
Copy link

tflurry commented Sep 29, 2019

@scottenriquez @danabrey that's unfortunate... i wonder if we could petition to get them to make that history available... with the threat of leaving ESPN for Yahoo or someone else! lol.. we'd need a lot of signatures..

@cgome032
Copy link

There's actually a second endpoint for the history of your fantasy football league. The url is: https://fantasy.espn.com/apis/v3/games/ffl/leagueHistory/ + "league ID"?seasonId="year"

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

8 participants