REST API - Feed versions

Feed versions

The REST API feed versions endpoint provides a fast and flexible way to browse 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 specifed 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
jsongeojsongeojsonlpng
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
Feed versions
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 around all active stops in the feed version
feed
object: Feed
Feed associated with this feed version
onestop_id
string
OnestopID for this feed
name
string
A common name for this feed. Optional. Alternatively use associated_operators[].name
spec
object: FeedSpecTypes
Type of feed
EnumGTFSGTFS_RTGBFSMDS
files
array: FeedVersionFileInfo
Metadata for each text file present in the main directory of the zip archive
name
string
Name of the file
rows
integer
Number of rows in the file
sha1
string
SHA1 hash of the file
header
string
Normalized header row of the file, if CSV-like
csv_like
boolean
Is the file CSV-like?
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
Number of seconds of service scheduled on the Monday of this week
tuesday
integer
Number of seconds of service scheduled on the Tuesday of this week
wednesday
integer
Number of seconds of service scheduled on the Wednesday of this week
thursday
integer
Number of seconds of service scheduled on the Thursday of this week
friday
integer
Number of seconds of service scheduled on the Friday of this week
saturday
integer
Number of seconds of service scheduled on the Saturday of this week
sunday
integer
Number of seconds of service scheduled on the Sunday of this week
feed_infos
array: FeedInfo
Feed infos associated with this feed version, if imported
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
Current database import status of this feed version
in_progress
boolean
Is the import currently in-progress
success
boolean
Did the import complete successfully
exception_log
string
Exception log if any errors occurred during import
warning_count
Counts of warnings by file name
skip_entity_error_count
Counts of entities skipped due to errors
skip_entity_filter_count
Counts of entities skipped due to import filters
skip_entity_marked_count
Counts of entities skipped due to marker filters
interpolated_stop_time_count
integer
Number of stop times with arrival/departure times set by interpolation during import process

Downloading source GTFS

See also .

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.