wmata_api | R Documentation |
Use httr::GET()
to make a request to the WMATA API and return the parsed
list from the JSON data. The function uses httr::RETRY()
, so the call will
repeat up to three times if there is a failure (often from a rate limit).
wmata_api(path, query = NULL, ..., level, api_key = wmata_key())
path |
The path to an API endpoint (e.g., "Bus.svc/json/jStopSchedule") |
query |
Additional queries also passed, possibly your key if need be. |
... |
Arguments passed to |
level |
If parsed JSON is a list, select only this element. Useful if the list is length one containing a data frame or some other object. |
api_key |
Subscription key which provides access to this API. Defaults
|
This function was modified from 'zamorarr/wmata' on GitHub: https://github.com/zamorarr/wmata/blob/master/R/api.r
A single JSON string.
## Not run:
wmata_api("Rail.svc/json/jLines", query = list(LineCode = "RD"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.