Documentation
REST API - Agencies and Operators
Last updated
Agencies and Operators
Operators and agencies are two means of grouping together stops, routes, trips, and other data for a single organization that offers transit service. For more information on the distinction, see agencies and operators.
Request overview
The REST API provides access to both agencies and operators, with results based on agency and operator GraphQL queries.
Agencies
GEThttps://transit.land/api/v2/rest/agencies
- GET
https://transit.land/api/v2/rest/agencies.{format}Request agencies in specified format - GET
https://transit.land/api/v2/rest/agencies/{agency_key}Request an agency by ID or Onestop ID - GET
https://transit.land/api/v2/rest/agencies/{agency_key}.{format}Request an agency by ID or Onestop ID in specified format
Request
agency_optional stringkey - Agency lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs agency_id>' key, or a Onestop ID
afteroptional integer (int32)- Pagination cursor value. This should be treated as an opaque value created by the server and returned as the link to the next result page, which may be empty. For historical reasons, this is based on the integer record ID values, but that should not be assumed to be the case in the future.
radiusoptional number- Search for agencies geographically, based on stops at this location; radius is in meters, requires lon and lat
bboxoptional string- Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated string
license_optional stringcommercial_ use_ allowed - Filter entities by feed license 'commercial_use_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
Allowed:
yes,no,unknown,exclude_no license_optional stringcreate_ derived_ product - Filter entities by feed license 'create_derived_product' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
Allowed:
yes,no,unknown,exclude_no
Response
agenciesarray of Agency- List or search for Agencies (each an
agency.txtrecord from a specific FeedVersion); defaults to currently active feed versions when none is specifiedagencies.agency_stringtimezone - GTFS
agency.agency_timezone; stop times use this timezone unless overridden bystop_timezone agencies.agency_nullable stringlang - GTFS
agency.agency_lang; primary language used by this transit agency, as a BCP 47 language tag agencies.agency_nullable stringphone - GTFS
agency.agency_phone; voice telephone number for the agency's customer service agencies.agency_nullable stringfare_ url - GTFS
agency.agency_fare_url; URL of a web page where a rider can purchase tickets or passes agencies.agency_nullable string (email)email - GTFS
agency.agency_email; email address actively monitored by the agency's customer service department agencies.cemv_nullable integersupport - GTFS
agency.cemv_support; whether riders can use a contactless EMV (cEMV) card or mobile device as fare media for trips associated with this agency [0=no information, 1=supported, 2=not supported] agencies.route_array of integerstypes - The distinct raw GTFS route types of this agency's routes, in ascending order
agencies.route_array of integerstypes_ basic - The distinct basic GTFS route types of this agency's routes, in ascending order: each extended route type is replaced by the basic type it is a kind of, so an agency running both 700 and 702 reports 3 once
agencies.alertsnullable array of Alert- GTFS-RT service alerts for this agency; pass
active: trueto return only currently active alerts
Operators
GEThttps://transit.land/api/v2/rest/operators
- GET
https://transit.land/api/v2/rest/operators.{format}Request operators in specified format - GET
https://transit.land/api/v2/rest/operators/{operator_key}Request an operator by ID or Onestop ID - GET
https://transit.land/api/v2/rest/operators/{operator_key}.{format}Request an operator by ID or Onestop ID in specified format
Request
tag_optional stringkey - Search for operators with a tag. Combine with tag_value also query for the value of the tag.
afteroptional integer (int32)- Pagination cursor value. This should be treated as an opaque value created by the server and returned as the link to the next result page, which may be empty. For historical reasons, this is based on the integer record ID values, but that should not be assumed to be the case in the future.
radiusoptional number- Search for operators geographically, based on stops at this location; radius is in meters, requires lon and lat
bboxoptional string- Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated string
license_optional stringcommercial_ use_ allowed - Filter entities by feed license 'commercial_use_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
Allowed:
yes,no,unknown,exclude_no license_optional stringcreate_ derived_ product - Filter entities by feed license 'create_derived_product' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
Allowed:
yes,no,unknown,exclude_no