Submit a GET request to the PTV API
PTVGET(
request,
user_id = determine_user_id(),
api_key = determine_api_key(),
...
)
A HTTP response. Content can be accessed with httr::content
.
A request or path for the API, eg. "routes".
Integer or character. A user ID or devid provided by Public
Transport Victoria. Refer to ?ptvapi
for more details.
Character. An API key, with dashes, provided by Public
Transport Victoria. Refer to ?ptvapi
for more details.
Additional arguments passed to httr::GET
.
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.