build_nhtsa_url {vindecodr}R Documentation

Build a NHTSA URL

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

build_nhtsa_url(endpoint, format = "json", ...)

build_vin_url(vin, ...)

build_vin_batch_url(vin, ...)

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

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

[Package vindecodr version 0.1.1 Index]