Returns detailed information on recalls in the Vehicle Recalls Database based on recall numbers(s).

recall_details(recall_number, api_key = NULL)

Arguments

recall_number

List of recall numbers.

api_key

API access key to use, if not set in environment.

Value

A tibble of detailed recall information from the Vehicle Recalls Database. Includes 15 columns.

Details

Queries the Vehicle Recalls Database API by recall number and returns detailed recall information for each number. Note that each recall number provided to the function results in a separate API call. Accordingly, the rate of API calls is limited to one call per second to stay within the API limit. For example, providing a list of 60 recall numbers to the function would take approximately 1 minute to complete.

An API key is required to run the function and query the Vehicle Recalls Database. The key can be acquired at https://tc.api.canada.ca/en/detail?api=VRDB.

The API key can be set in the environment using Sys.setenv(VRD_API = 'your_API_key_here') and will be used by the function, or can be passed into the function using the api_key argument.

Examples

if (FALSE) { recall_details(1977044) API_KEY <- "xxxxxxxxxxx" recall_details(c(2014216, 2013022), api_key = API_KEY) }