Skip to content
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

  • GEThttps://transit.land/api/v2/rest/agencies.{format}Request agencies in specified format
  • GEThttps://transit.land/api/v2/rest/agencies/{agency_key}Request an agency by ID or Onestop ID
  • GEThttps://transit.land/api/v2/rest/agencies/{agency_key}.{format}Request an agency by ID or Onestop ID in specified format

Request

agency_keyoptional string
Agency lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs agency_id>' key, or a Onestop ID
agency_idoptional string
Search for records with this GTFS agency_id (string)
agency_nameoptional string
Search for records with this GTFS agency_name
idoptional integer (int32)
Search for a specific internal ID
include_alertsoptional string
Include alerts from GTFS Realtime feeds

Allowed:true, false

include_routesoptional string
Include routes that serve this stop

Allowed:true, false

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.
limitoptional integer (int32)
Maximum number of records to return
formatoptional string
Response format

Allowed:json, geojson, geojsonl

onestop_idoptional string
Search for a specific Onestop ID
feed_version_sha1optional string
Search for records in this feed version
feed_onestop_idoptional string
Search for records in this feed
radiusoptional number
Search for agencies geographically, based on stops at this location; radius is in meters, requires lon and lat
lonoptional number
Longitude
latoptional number
Latitude
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
adm0_nameoptional string
Search by country name
adm0_isooptional string
Search by country 2 letter ISO 3166 code
adm1_nameoptional string
Search by state/province/division name
adm1_isooptional string
Search by state/province/division ISO 3166-2 code
city_nameoptional string
Search by city name
license_commercial_use_allowedoptional string
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_share_alike_optionaloptional string
Filter entities by feed license 'share_alike_optional' 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_create_derived_productoptional string
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

license_redistribution_allowedoptional string
Filter entities by feed license 'redistribution_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_use_without_attributionoptional string
Filter entities by feed license 'use_without_attribution' 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.txt record from a specific FeedVersion); defaults to currently active feed versions when none is specified
agencies.idinteger
Internal integer ID
agencies.agency_namestring
GTFS agency.agency_name
agencies.agency_idstring
GTFS agency.agency_id
agencies.onestop_idstring
Onestop ID for this agency (or its associated operator)
agencies.agency_urlstring
GTFS agency.agency_url
agencies.agency_timezonestring
GTFS agency.agency_timezone; stop times use this timezone unless overridden by stop_timezone
agencies.agency_langnullable string
GTFS agency.agency_lang; primary language used by this transit agency, as a BCP 47 language tag
agencies.agency_phonenullable string
GTFS agency.agency_phone; voice telephone number for the agency's customer service
agencies.agency_fare_urlnullable string
GTFS agency.agency_fare_url; URL of a web page where a rider can purchase tickets or passes
agencies.agency_emailnullable string (email)
GTFS agency.agency_email; email address actively monitored by the agency's customer service department
agencies.cemv_supportnullable integer
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.geometrynullable Polygon
Convex hull of all stops served by this agency
agencies.route_typesarray of integers
The distinct raw GTFS route types of this agency's routes, in ascending order
agencies.route_types_basicarray of integers
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.operatornullable Operator
Operator associated with this agency
agencies.alertsnullable array of Alert
GTFS-RT service alerts for this agency; pass active: true to return only currently active alerts
agencies.placesnullable array of AgencyPlace
Administrative places (city, state, country) matched to this agency by overlap with stop locations, ranked by association strength
agencies.feed_versionFeedVersion
Source feed version for this entity
agencies.routesarray of Route
Routes associated with this agency

Operators

GEThttps://transit.land/api/v2/rest/operators

  • GEThttps://transit.land/api/v2/rest/operators.{format}Request operators in specified format
  • GEThttps://transit.land/api/v2/rest/operators/{operator_key}Request an operator by ID or Onestop ID
  • GEThttps://transit.land/api/v2/rest/operators/{operator_key}.{format}Request an operator by ID or Onestop ID in specified format

Request

tag_keyoptional string
Search for operators with a tag. Combine with tag_value also query for the value of the tag.
tag_valueoptional string
Search for feeds tagged with a given value. Must be combined with tag_key.
onestop_idoptional string
Search for a specific Onestop ID
feed_onestop_idoptional string
Search for records in this feed
include_alertsoptional string
Include alerts from GTFS Realtime feeds

Allowed:true, false

idoptional integer (int32)
Search for a specific internal 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.
limitoptional integer (int32)
Maximum number of records to return
adm0_nameoptional string
Search by country name
adm0_isooptional string
Search by country 2 letter ISO 3166 code
adm1_nameoptional string
Search by state/province/division name
adm1_isooptional string
Search by state/province/division ISO 3166-2 code
city_nameoptional string
Search by city name
radiusoptional number
Search for operators geographically, based on stops at this location; radius is in meters, requires lon and lat
lonoptional number
Longitude
latoptional number
Latitude
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_commercial_use_allowedoptional string
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_share_alike_optionaloptional string
Filter entities by feed license 'share_alike_optional' 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_create_derived_productoptional string
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

license_redistribution_allowedoptional string
Filter entities by feed license 'redistribution_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_use_without_attributionoptional string
Filter entities by feed license 'use_without_attribution' 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

operatorsarray of Operator
List or search for Operators (higher-level groupings of agencies)
operators.idinteger
Internal integer ID
operators.onestop_idnullable string
Onestop ID for this operator. Format: o-geohash-name. Example: o-dr5r-nyct.
operators.namenullable string
Operator name
operators.short_namenullable string
Operator short name
operators.websitenullable string
Operator website
operators.tagsnullable Tags
Atlas tags providing additional metadata for this operator
operators.feedsnullable array of Feed
Feeds associated with this operator
operators.agenciesnullable array of Agency
Agencies for this operator from active feed versions