read_crashapi | R Documentation |
An updated utility function using the httr2 package to read data from the CrashAPI using the API URL templates listed on the NHSTA website: https://crashviewer.nhtsa.dot.gov/CrashAPI
read_crashapi(
url = "https://crashviewer.nhtsa.dot.gov",
data = "crashes",
type = NULL,
format = "json",
results = TRUE,
...,
call = caller_env()
)
url |
Base url for CrashAPI. |
data |
Data (crashes, analytics, or fars), Default: 'crashes' |
type |
Type of API to use, Default: |
format |
Format to return, Default: 'json' |
results |
If |
... |
Additional parameters used in template (varies by type). |
call |
The execution environment of a currently
running function, e.g. |
Data frame with requested data or a formatted url (if results = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.