Skip to content
Documentation

REST API - Feed versions

Last updated

Feed versions

The REST API feed versions endpoint provides a fast and flexible way to browse static GTFS feed versions contained in Transitland's archive.

Request overview

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


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

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

Request

feed_version_keyoptional string
Feed version lookup key; can be an integer ID or a SHA1 value
feed_keyoptional string
Feed lookup key; can be an integer ID or Onestop ID
sha1optional string
Feed version SHA1
sha1_diroptional string
Feed version SHA1 of the top-level .txt files (sha1_dir)
feed_onestop_idoptional string
Feed OnestopID
fetched_beforeoptional string (datetime)
Filter for feed versions fetched earlier than given date time in UTC
fetched_afteroptional string (datetime)
Filter for feed versions fetched since given date time in UTC
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

radiusoptional number
Search for feed versions geographically; 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

Response

feed_versionsarray of FeedVersion
List or search for FeedVersions (specific archived import of a Feed)
feed_versions.idinteger
Internal integer ID
feed_versions.sha1string
SHA1 hash of the zip file

Example:ab5bdc8b6cedd06792d42186a9b542504c5eef9a

feed_versions.sha1_dirnullable string
SHA1 hash of the top-level .txt files, concatenated in filename order; stable across re-zipping, but other files such as locations.geojson are not included

Example:c1026b895dbe7476c0a6dcc1b82c909bfa952c63

feed_versions.fetched_atstring (datetime)
Time when the file was fetched from the URL

Example:2019-11-15T00:45:55.409906

feed_versions.urlstring
URL used to fetch the file
feed_versions.earliest_calendar_datestring (date)
The earliest date with scheduled service

Example:2020-01-01

feed_versions.latest_calendar_datestring (date)
The latest date with scheduled service

Example:2020-12-31

feed_versions.geometrynullable Polygon
Convex hull of all stop coordinates in this feed version
feed_versions.feedFeed
Feed associated with this feed version
feed_versions.filesarray of FeedVersionFileInfo
Metadata for each file in the GTFS archive
feed_versions.service_levelsarray of FeedVersionServiceLevel
Service levels (in seconds per day) for this feed version
feed_versions.feed_infosarray of FeedInfo
Records from this feed version's feed_info.txt
feed_versions.feed_version_gtfs_importnullable FeedVersionGtfsImport
Database import status

Downloading source GTFS

See also downloading static GTFS feed versions.

GEThttps://transit.land/api/v2/rest/feed_versions/{feed_version_key}/download

Download this feed version GTFS zip for this feed, if redistribution is allowed by the source feed's license. Available only using Transitland professional or enterprise plan API keys.

Request

feed_version_keystringrequired
Feed version lookup key; can be an integer ID or a SHA1 value

Response

Returns a file: application/octet-stream