get_fares_metadata {bodsr}R Documentation

Return fares metadata from the 'BODS' API

Description

Return fares metadata from the 'BODS' API

Usage

get_fares_metadata(
  api_key = Sys.getenv("BODS_KEY"),
  limit = 25,
  noc = NULL,
  status = NULL,
  bounding_box = NULL
)

Arguments

api_key

API key for the 'BODS' dataset passed as a string. Can be obtained from the 'BODS' API login

limit

integer. Maximum number of records to return for a query. Defaults to 25

noc

string or vector of strings. Limit results to fares data sets for specified National Operator Codes. A full lookup of NOC to bus operator names can be seen using noc_lookup(). Defaults to NULL.

status

string. Limit results to fares data sets for specified status, accepted values are "published" or "inactive". Defaults to NULL.

bounding_box

vector of four numerics. Limit results to fares data sets that contain information for the area within the rectangular boundingBox you set using co-ordinates [minLatitude, maxLatitude, minLongitude, maxLongitude]. Defaults to NULL.

Value

Returns a data frame of fares metadata including links to data from the 'BODS' API.

Examples


## Not run: 
#Before running these examples, ensure you have an API key saved
#Return the first 25 results of fares metadata with no filters
get_fares_metadata()

#Return fares metadata for National Express
get_fares_metadata(noc = "NATX")

#Return only published fares metadata for Go Ahead
get_fares_metadata(noc = "BHBC", status = "published")

#Return fares metadata for the specified bounding box
get_fares_metadata(bounding_box = c(51.401, 51.509, 0.01, 0.201))

## End(Not run)

[Package bodsr version 0.1.0 Index]