mkreiser / ESPN-Fantasy-Football-API

Connect to ESPN's fantasy football API via this JS API client for web and NodeJS. Available as an npm package.
http://espn-fantasy-football-api.s3-website.us-east-2.amazonaws.com/
GNU Lesser General Public License v3.0
310 stars 78 forks source link

Transactions #132

Open todsac opened 5 years ago

todsac commented 5 years ago

Is it possible to get transactions (add / drop) via the API?

rektdeckard commented 5 years ago

Came here for this! the old API had a recentActivity param that returned player transactions and pending trades. Any word on this?

rektdeckard commented 5 years ago

The current API has this route that seems to return the transactions we're looking for, albeit in a very inscrutable format:

https://fantasy.espn.com/apis/v3/games/ffl/seasons/2019/segments/0/leagues/<LEAGUE_ID>?view=mPendingTransactions

Requires dozens of follow-up requests to get the player names, positions, team name/owner... Who the heck designed their API?

mkreiser commented 5 years ago

Who the heck designed their API?

@rektdeckard This keeps me up at night

mkreiser commented 5 years ago

@rektdeckard I checked out that route and the recent activity webpage. The route you've specified was not returning any transaction data.

I tried spying on the recent activity page and matched up this route to the data: https://fantasy.espn.com/apis/v3/games/ffl/seasons/2019/segments/0/leagues/<LEAGUE_ID>/communication/?view=kona_league_communication. However, this route is batshit and maps out each transaction (called a topic) to some UUIDs that are coming from somewhere. I have no idea where these are getting matched up.

Since transactions are a bit crazy, I'm going to push transactions off for now