Skip to content
Documentation

REST API - Feeds

Last updated

Feeds

The REST API feeds endpoint provides a fast and flexible way to browse source feeds registered in the Transitland platform.

Request overview

The feeds API provides a number of searching and filtering parameters; results are based on this GraphQL query.


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

  • GEThttps://transit.land/api/v2/rest/feeds.{format}Request feeds in specified format
  • GEThttps://transit.land/api/v2/rest/feeds/{feed_key}Request a feed by ID or Onestop ID
  • GEThttps://transit.land/api/v2/rest/feeds/{feed_key}.{format}Request a feed by ID or Onestop ID in specified format

Request

feed_keyoptional string
Feed lookup key; can be a Onestop ID or an internal database integer ID
specoptional string
Type of data contained in this feed

Allowed:gtfs, gtfs-rt, gbfs, mds

fetch_erroroptional string
Search for feeds with or without a fetch error

Allowed:true, false

tag_keyoptional string
Search for feeds 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.
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
formatoptional string
Response format

Allowed:json, geojson, geojsonl

onestop_idoptional string
Search for a specific Onestop ID
lonoptional number
Longitude
latoptional number
Latitude
radiusoptional number
Search for feeds geographically; 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_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

feedsarray of Feed
List or search for Feeds (metadata about data sources)
feeds.idinteger
Internal integer ID
feeds.specnullable string (FeedSpecTypes)
Type of feed: GTFS, GTFS_RT, GBFS, or MDS

Allowed:GTFS, GTFS_RT, GBFS, MDS

feeds.namenullable string
A common name for this feed; alternatively use associated_operators[].name
feeds.onestop_idstring
Onestop ID for this feed. Format: f-geohash-name. Example: f-9q9-bart.
feeds.languagesnullable array of strings
Language(s) included in this feed (BCP 47 tags)
feeds.tagsnullable Tags
Atlas tags providing additional metadata for this feed
feeds.urlsnullable FeedUrls
URLs associated with this feed
feeds.licensenullable FeedLicense
Feed license metadata
feeds.authorizationnullable FeedAuthorization
Authorization metadata for fetching data from this feed (e.g., API keys, headers)
feeds.feed_statenullable FeedState
Current state of this feed (e.g. the active feed version)
feeds.feed_versionsarray of FeedVersion
Versions of this feed that have been fetched, archived, and imported

Downloading latest static GTFS

See also downloading static GTFS feed versions.

GEThttps://transit.land/api/v2/rest/feeds/{feed_key}/download_latest_feed_version

Download the latest feed version GTFS zip for this feed, if redistribution is allowed by the source feed's license

Request

feed_keystringrequired
Feed lookup key; can be an integer ID or Onestop ID value

Response

Returns a file: application/octet-stream

Downloading latest GTFS Realtime

For more information about GTFS Realtime message types and fields, see the GTFS Realtime reference documentation.

GEThttps://transit.land/api/v2/rest/feeds/{feed_key}/download_latest_rt/{rt_type}.{format}

Download the latest snapshot of the specified GTFS Realtime feed, if redistribution is allowed by the source feed's license. Returns 404 if feed or message not found, 401 if redistribution not allowed.

Request

feed_keystringrequired
Feed lookup key; can be an integer ID or Onestop ID value
rt_typestringrequired
GTFS Realtime message types to download

Allowed:alerts, trip_updates, vehicle_positions

formatstringrequired
Output format (JSON, Protocol Buffers, or GeoJSON for vehicle positions)

Allowed:json, pb, geojson, geojsonl

Response

Returns a file: application/octet-stream