msf_get_results: Interface with the MySportsFeeds API

Description Usage Arguments Value Examples

View source: R/msf_get_results.R

Description

Return data from the MySportsFeeds API

Usage

1
2
3
4
5
6
7
8
msf_get_results(
  version = "1.2",
  league,
  season,
  feed,
  params = list(),
  verbose = FALSE
)

Arguments

version

character. The version of the API. Defaults to "1.2".

league

character. The league abbreviation. (e.g. - "nhl", "nfl", "nba", "mlb")

season

character. The applicable season. (e.g. - "2016-2017-regular")

feed

character. The name of the requested feed. (e.g. - "player_gamelogs")

params

list. A list that defines additional parameters. Default is empty list.

verbose

logical. For debugging, prints status messages to the console, which can be helpful for walking through results. Default is TRUE.

Value

a list.

Response Codes:

200: Request was successful

204: Feed content not found. There is no available content for the feed as of yet.

304: This response code coincides with the optional URL parameter.

400: This indicates that some part of the request is malformed.

401: Not authenticated.

403: Not authorized. You might be trying to access a feed without the correct subscription.

429: Too many requests.

500: An internal error has occured and has been logged for further inspection. Let us know if you're receiving this response unexpectedly!

499,502,503: These usually mean we're in the process of publishing system updates. It should resolve in a matter of a few seconds. If you are seeing this consistently please contact us.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
authenticate_v1_x("your_username", "your_password")
results <- msf_get_results(version = "1.2",
                           league = "nhl",
                           season = "2016-2017-regular",
                           feed = "player_gamelogs",
                           params = list()
                           verbose = TRUE)

## End(Not run)

MySportsFeeds/mysportsfeeds-r documentation built on March 10, 2021, 6:20 p.m.