PTVGET | R Documentation |
Submit a GET request to the PTV API
PTVGET(
request,
user_id = determine_user_id(),
api_key = determine_api_key(),
...
)
request |
A request or path for the API, eg. "routes". |
user_id |
Integer or character. A user ID or devid provided by Public
Transport Victoria. Refer to |
api_key |
Character. An API key, with dashes, provided by Public
Transport Victoria. Refer to |
... |
Additional arguments passed to |
A HTTP response. Content can be accessed with httr::content
.
You will need to obtain a user ID (also called a devid) and an API key from Public Transport Victoria. These are obtained by email. Instructions are available at https://www.ptv.vic.gov.au/footer/data-and-reporting/datasets/ptv-timetable-api/. You may pass these two pieces of information directly to the function, or you can set the PTV_USER_ID and PTV_API_KEY environment variables.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.