cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
599 stars 193 forks source link

Implement Free Agency List #18

Closed rhartman93 closed 5 years ago

rhartman93 commented 5 years ago

For a given week, be able to get a list of players on free agency, similar to box player, slot_position could be 'FA'

cwendt94 commented 5 years ago

I like it! I will look into that!

rhartman93 commented 5 years ago

Are you looking at docs for the api? I've been trying to find something to reference to try and find the proper endpoints , etc. This project has some free agency info: https://github.com/mkreiser/ESPN-Fantasy-Football-API but I'm not as familiar with javascript so having a hard time parsing out what they're doing

cwendt94 commented 5 years ago

ESPN doesn't document their API at all. I use chrome dev tools and basically see what requests their app and website make to the backend api. Also I think I see how to get free agents. However it only looks like you can get the current season free agents and not past seasons..

rhartman93 commented 5 years ago

I think you can pass a scoringPeriodId, although I'm not exactly sure what the proper use of that parameter is, I see you used 0 in fetch_players. Without setting it though I did get back basically the entire NFL so I'm assuming like you said that's this year's free agency since my league hasn't drafted yet

rhartman93 commented 5 years ago

Although I think even getting it for the current year has utility, it just would need to be documented as such

cwendt94 commented 5 years ago

Yeah, I am playing around with the scoringPeriodId for 2018 season and when looking through all the players it is showing how the rosters were at the end of the season. Even if I put scoringPeriodId=2 it shows players that my team had at the end of the season.

cwendt94 commented 5 years ago

Definitely! I like the idea of being able to see what players are on free agency! I can probably have this feature done by the end of tomorrow.

cwendt94 commented 5 years ago

Free agency feature is now in the latest package!

rhartman93 commented 5 years ago

This looks great, I'll test it out tonight

cwendt94 commented 5 years ago

Sounds good! Also I just found out a way that we can pass filters to order the free agents and set limits on how many free agents you want to see!

rhartman93 commented 5 years ago

Oh that would be great, I'd imagine sorting by scored points would be super useful

cwendt94 commented 5 years ago

Yeah, without the filters it seems like it shows free agents all the way at the bottom first.

cwendt94 commented 5 years ago

Filtering is also in the latest package!