Get data using GET API.

tfnswapi_get(
  api,
  params = NULL,
  key = tfnswapi_get_api_key(),
  descriptor = transit_realtime.FeedMessage
)

tfnswapi_get_response(path, params = NULL, key = tfnswapi_get_api_key())

Arguments

api

Character. API name (e.g. 'carpark' for https://opendata.transport.nsw.gov.au/node/6223/exploreapi#!/carpark/GetCarPark).

params

a named list. Any parameters that the API accepts can be specified here.

key

Character (optional). An API key can be provided, else if emptied it will look for any previously registered API key.

descriptor

This field is only used if the response is of type application/x-google-protobuf. You must select one of transit_realtime variables. By default this is transit_realtime.FeedMessage.

path

Character.

Value

a response with parsed content.

Examples


if (FALSE) {

 # See what facilities are available
 tfnswapi_get("carpark")
 tfnswapi_get("carpark", params = list(facility = 2))

}