ptv_search | R Documentation |
There's only one search API call, and it covers stops, routes, and outlets. This function will return the response of this generic search. It is expected that other functions will take on of these three categories of search results, parse them, and return them to the user as a tibble.
ptv_search(
search_term,
latitude = NULL,
longitude = NULL,
max_distance = NULL,
route_types = NULL,
include_outlets = FALSE,
match_stop_by_suburb = FALSE,
match_route_by_suburb = FALSE,
match_stop_by_gtfs_stop_id = FALSE,
user_id = determine_user_id(),
api_key = determine_api_key()
)
search_term |
Character. Term used to perform search. |
latitude |
Numeric. Latitude in decimal degrees. For example, Flinders Street Station is at approximately -37.8183 latitude. |
longitude |
Numeric. Longitude in decimal degrees. For example, Flinders Street Station is at approximately 144.9671 longitude. |
max_distance |
Integer. Optionally filter by maximum distance from the given location, in metres. |
route_types |
Integer or character vector. Optionally filter by a vector
of route types. A route type can be provided either as a non-negative
integer code, or as a character: "Tram", "Train", "Bus", "Vline" or "Night
Bus". Character inputs are not case-sensitive. Use the
|
include_outlets |
Boolean. Optional. Affects search results. |
match_stop_by_suburb |
Boolean. Optional. Affects search results. |
match_route_by_suburb |
Boolean. Optional. Affects search results. |
match_stop_by_gtfs_stop_id |
Boolean. Optional. Affects search results. |
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 |
If the search term is numeric and/or less than 3 characters, the API will return only routes. By default, as little matching is done as possible, and as little as possible is returned. We rely on functions that call on this function to specify what is needed.
The response of the search
API call.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.