ffverse / ffscrapr

R API Client for Fantasy Football League Platforms
https://ffscrapr.ffverse.com
Other
81 stars 22 forks source link

Adding accuracy to ff_playerscores #74

Closed TheMathNinja closed 4 years ago

TheMathNinja commented 4 years ago

I'm wondering if ff_playerscores() can get an update by which we can separately specify start_week and end_week as function inputs (instead of just end week, as in the current function). Often times I'm interested in just looking at splits like first half/second half of season.

Additionally, I'm wondering if we can get full stat readouts in the case of MFL. In particular, I'm wondering if there's a way to either: a) Join the Passing Stats, Rushing Stats, etc. frames from "/options?O=08&SEARCHTYPE=ADVANCED&POSITION=QB&DISPLAY=Passers&L=[league_id]" into a single frame to read a player's stats in every possible category, or (even better)

b) Access stats stored by MFL which do not show up on these reports. In particular, is there a way to scrape IDP stats which also displays counts for PD, TFL yards, Sack Yards, etc.? (these are stored in MFL but not displayed at "https://www51.myfantasyleague.com/2020/top?L=[league_id]&SEARCHTYPE=ADVANCED&COUNT=32&YEAR=2019&START_WEEK=1&END_WEEK=21&CATEGORY=CONFERENCE00A&POSITION=QB&DISPLAY=Defenders&TEAM=*"

tanho63 commented 4 years ago

A few thoughts here:

ff_playerscores() actually returns ONLY for that specific week - see API docs here https://api.myfantasyleague.com/2020/api_info?STATE=test&CCAT=export&TYPE=playerScores. You can probably iterate it in a loop or a purrr-map to get specific week-ranges.

Stat readouts are generally not avail via MFL API because MFL is a free API and the sportradar api that's used to generate those stats is a paid product. You'd probably need to hit nflfastr for that

TheMathNinja commented 4 years ago

Good point about iterating. And sad about the API hiding all the good stuff. Back to copy-paste like the old days.

tanho63 commented 4 years ago

Possibly rvest?