Learn R Programming

nhlapi (version 0.1.4)

nhl_get_data: Get data from the API for one or more URLs

Description

Get data from the API for one or more URLs

Usage

nhl_get_data(urls, flatten = getOption("nhlapi_flatten"))

Arguments

urls

character(), vector of URLs to retrieve the data from.

flatten

logical(1), if TRUE (default) automatically flattens nested data frames into a single non-nested data frame.

Value

list, results retrieved using nhl_get_data_worker(). One element per url. The elements contain the retrieved data if retrieval succeeded, otherwise an nhl_get_data_error class object.

See Also

nhl_get_data_worker()

Examples

Run this code
# NOT RUN {
  nhl_get_data(c(
    "https://statsapi.web.nhl.com/api/v1/teams/1",
    "https://statsapi.web.nhl.com/api/v1/people/8477474"
  ))

  nhl_get_data(
    "https://statsapi.web.nhl.com/api/v1/teams/1",
    flatten = FALSE
  )
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab