Documentation

REST API - Feed versions

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.


Request parameters

GET/api/v2/rest/feed_versions Search for feed versions

GET/api/v2/rest/feed_versions.{format} Request feed versions in specified format

GET/api/v2/rest/feed_versions/{feed_version_key} Request a feed version by ID or SHA1

GET/api/v2/rest/feed_versions/{feed_version_key}.{format} Request a feed version by ID or SHA1 in specified format

GET/api/v2/rest/feeds/{feed_key}/feed_versions Request feed versions by feed ID or Onestop ID

ParameterTypeDescriptionExample
feed_version_keystring

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

Feed lookup key; can be an integer ID or Onestop ID
sha1string

Feed version SHA1sha1=e535eb2b3...
feed_onestop_idstring

Feed OnestopIDfeed_onestop_id=f-sf~bay~area~rg
fetched_beforestring

Filter for feed versions fetched earlier than given date time in UTCfetched_before=2023-01-01T00:00:00Z
fetched_afterstring

Filter for feed versions fetched since given date time in UTCfetched_after=2023-01-01T00:00:00Z
idinteger

Search for a specific internal ID
afterinteger

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.
limitinteger

Maximum number of records to returnlimit=1
formatstring enum
jsongeojsongeojsonl
Response formatformat=geojson
radiusnumber

Search radius (meters); requires lat and lonlon=-122.3&lat=37.8&radius=1000
lonnumber

Longitude
latnumber

Latitude
bboxstring

Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated stringbbox=-122.269,37.807,-122.267,37.808

Response format


feed_versions
array: FeedVersion
List or search for FeedVersions (specific archived import of a Feed)
id
integer
Internal integer ID
sha1
string
SHA1 hash of the zip file

Exampleab5bdc8b6cedd06792d42186a9b542504c5eef9a

fetched_at
string
Time when the file was fetched from the URL

Example2019-11-15T00:45:55.409906

url
string
URL used to fetch the file
earliest_calendar_date
string
The earliest date with scheduled service

Example2020-01-01

latest_calendar_date
string
The latest date with scheduled service

Example2020-12-31

geometry
Convex hull of all stop coordinates in this feed version
feed
object: Feed
Feed associated with this feed version
onestop_id
string
Onestop ID for this feed. Format: f-geohash-name. Example: f-9q9-bart.
name
string
A common name for this feed; alternatively use associated_operators[].name
spec
object: FeedSpecTypes
Type of feed: GTFS, GTFS_RT, GBFS, or MDS
EnumGTFSGTFS_RTGBFSMDS
files
array: FeedVersionFileInfo
Metadata for each file in the GTFS archive
name
string
GTFS file name (e.g. stops.txt)
rows
integer
Number of data rows in the file (CSV files only)
sha1
string
SHA1 hash of the file
header
string
Comma-joined column header row of the file (CSV files only)
csv_like
boolean
True if the file is parseable as CSV
size
integer
File size, in bytes
service_levels
array: FeedVersionServiceLevel
Service levels (in seconds per day) for this feed version
start_date
string
Start date of this week

Example2019-11-15

end_date
string
End date of this week

Example2019-11-15

monday
integer
Seconds of service scheduled on Monday
tuesday
integer
Seconds of service scheduled on Tuesday
wednesday
integer
Seconds of service scheduled on Wednesday
thursday
integer
Seconds of service scheduled on Thursday
friday
integer
Seconds of service scheduled on Friday
saturday
integer
Seconds of service scheduled on Saturday
sunday
integer
Seconds of service scheduled on Sunday
feed_infos
array: FeedInfo
Records from this feed version's feed_info.txt
default_lang
string
GTFS feed_info.default_lang
feed_contact_email
string
GTFS feed_info.feed_contact_email
feed_contact_url
string
GTFS feed_info.feed_contact_url
feed_end_date
string
GTFS feed_info.feed_end_date

Example2019-11-15

feed_lang
string
GTFS feed_info.feed_lang
feed_publisher_name
string
GTFS feed_info.feed_publisher_name
feed_start_date
string
GTFS feed_info.feed_start_date

Example2019-11-15

feed_publisher_url
string
GTFS feed_info.feed_publisher_url
feed_version_gtfs_import
object: FeedVersionGtfsImport
Database import status
in_progress
boolean
True if the import is currently running
success
boolean
True if the import completed successfully
exception_log
string
Error log accumulated during import; empty on success
warning_count
Counts of warnings raised during import, keyed by file name
skip_entity_error_count
Counts of entities skipped due to errors, keyed by file name
skip_entity_filter_count
Counts of entities skipped due to import filters, keyed by file name
skip_entity_marked_count
Counts of entities skipped by the marker filter, keyed by file name
interpolated_stop_time_count
integer
Number of stop_times whose arrival/departure times were filled in by interpolation during import

Downloading source GTFS

See also downloading static GTFS feed versions.

GET/api/v2/rest/feed_versions/{feed_version_key}/download Download feed version

ParameterTypeDescriptionExample
feed_version_keystring

Feed version lookup key; can be an integer ID or a SHA1 value
Description 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.