build_nhtsa_url: Build a NHTSA URL

Description Usage Arguments Value Examples

View source: R/build_nhtsa_url.R

Description

A family of functions to build URLs for the National Highway Transportation Safety Administration (NHTSA) vehicle identification number (VIN) decoder API.

The build_nhtsa_url() function returns a closure containing the appropriate endpoint and file format request to pass to the NHTSA VIN API.

Usage

1
2
3
4
5

Arguments

endpoint

a string containing the appropriate endpoint. Candidate endpoints can be found at https://vpic.nhtsa.dot.gov/api/

format

the file format to return from the API, one of 'json', 'xml', or 'csv'. Defaults to 'json'.

...

additional arguments to passed on to derived builder functions

vin

a string containing the VIN to query.

Value

Examples

1
2
3
vin_url_xml <- build_nhtsa_url("/vehicles/DecodeVINValues/", format = "xml")
build_vin_url("3VWLL7AJ9BM053541")
build_vin_batch_url(c("3VWLL7AJ9BM053541", "JH4KA3140KC015221"))

vindecodr documentation built on Nov. 25, 2020, 5:07 p.m.