Retrieve player fantasy points earned in each game for a given season and week (NFL) or date (NBA/MLB).
Usage
dk_get_player_fp(
timeframe,
season = as.numeric(format(Sys.Date(), "%Y")),
sport = c("nfl", "nba", "mlb"),
output = c("cleaned_json", "json", "response", "request"),
process_args = NULL,
...
)Arguments
- timeframe
integer. Either the week number for NFL, or a date of the form
20230312for MLB and NBA. If the timeframe format detected does not match the sport argument passed, an error is returned.- season
integer. optional. Defaults to the current season year.
- sport
character. Defaults to NFL.
- output
One of "cleaned_json" (the default), "json", "response", or "request". If "cleaned_json" then
tidyjson::spread_all()is used to parse the JSON body,- process_args
Optional list of arguments passed to
dk_req_process- ...
Arguments passed on to
dk_reqquery_paramsA list of query parameters passed to
[httr2::req_url_query].proxy_argsList of arguments to httr2::req_proxy
curl_optionsList of arguments to httr2::req_options
throttle_rateList of arguments to httr2::req_throttle
headersList of arguments to
httr2::req_headers()pathsList of arguments to
httr2::req_url_path_append()error_handling_optionsList of arguments to
httr2::req_error()retry_optionsList of arguments passed to
httr2::req_retry()base_urlBase URL for request.
methodCustom HTTP method
