REST API - Feeds

Transitland is built on publicly available GTFS data contributed by our user community to the Transitland Atlas.

Feeds contain details on how to access transit information, including URLs to data sources in various formats (GTFS, GTFS-RT, GBFS, etc), license information, related feeds, details on how to make authorized requests, and feed version archives. Feed versions are archived (as .zip files) and imported into the Transitland database for querying agencies, stops, routes, trips, etc.

Feed license information

To learn more about how Transitland classifies the licenses associated with a feed, see this overview of Transitland legal and licensing issues.

Request overview

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


Request parameters

GET /api/v2/rest/feeds Feeds — Search for feeds

GET /api/v2/rest/feeds.{format} Request feeds in specified format

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

GET /api/v2/rest/feeds/{feed_key}.{format} Request a feed by ID or Onestop ID in format

Parameter Type Description Example
id integer
0 ... unlimited
Search for a specific internal ID
feed_key string

Equivalent to id (if an integer) or onestop_id (if string)
after integer

Return records past this record ID
limit integer
0 ... 100
Maximum number of records to return limit=1
format enum
jsongeojsonpng
Response format format=geojson
search string

Full text search search=caltrain
onestop_id string

Search for a specific Onestop ID onestop_id=f-9q9-caltrain
spec string enum
gtfsgtfs-rtgbfsmds
Type of data contained in this feed spec=gtfs
fetch_error string enum
truefalse
Search for feeds with or without a fetch error fetch_error=true
tag_key string

Search for feeds with a tag. Combine with tag_value also query for the value of the tag. tag_key=gtfs_data_exchange
tag_value string

Search for feeds tagged with a given value. Must be combined with tag_key. tag_key=unstable_url&tag_value=true

Response format

Array of objects
Description: Distributed mobility data registry (DMFR) feed
Reference: DMFR Schema
id
(int64)
Unique integer ID

Example:123

onestop_id
(string)
OnestopID for this feed

Example:f-9q9-bart

name
(string)
A common name for this feed

Example:Bay Area Rapid Transit

spec
(string)
Type of data contained in this feed: GTFS, GTFS-RT, GBFS, or MDS
Enum: gtfsgtfs-rtgbfsmds
feed_namespace_id
(string)
Feeds that share the same feed_namespace_id value can be combined without needing to rewrite entity IDs. (Optionally can be an operator Onestop ID)

Example:o-9q9-bart

associated_feeds
(string array)
List of associated feeds, using IDs internal to this DMFR instance. For example to one or more GTFS feeds associated with an GTFS-RT feed
languages
(string array)
Language(s) included in this feed

Example:{ "0": "en-US" }

urls
(object)
URLs that provide data associated with this feed
static_current
(string)
URL for the static feed that represents today's service

Example:https://www.bart.gov/dev/schedules/google_transit.zip

static_hstoric
(string array)
URLs for static feeds that represent past service that is no longer in effect
static_planned
(string)
URLs for static feeds that represent service planned for upcoming dates. Typically used to represent calendar/service changes that will take effect few weeks or months in the future
realtime_vehicle_positions
(string)
URL for GTFS Realtime VehiclePosition messages
realtime_trip_updates
(string)
URL for GTFS Realtime TripUpdate messages
realtime_alerts
(string)
URL for GTFS Realtime Alert messages
license
(object)
License information for this feed, if present
spdx_identifier
(string)
SPDX identifier for a common license. See https://spdx.org/licenses/

Example:CC-BY-4.0

url
(string)
URL for a custom license

Example:http://www.actransit.org/data-terms-and-conditions/

use_without_attribution
(string)
Are feed consumers allowed to use the feed contents without including attribution text in their app or map?
Enum: yesnounknown
create_derived_product
(string)
Are feed consumers allowed to create and share derived products from the feed?
Enum: yesnounknown
redistribution_allowed
(string)
Are feed consumers allowed to redistribute the feed in its entirety?
Enum: yesnounknown
commercial_use_allowed
(string)
Are feed consumers allowed to use the feed for commercial purposes?
Enum: yesnounknown
share_alike_optional
(string)
Are feed consumers allowed to keep their modifications of this feed private?
Enum: yesnounknown
attribution_text
(string)
Feed consumers must include this particular text when using this feed

Example:data provided by 511.org

attribution_instructions
(string)
Feed consumers must follow these instructions for how to provide attribution

Example:You must acknowledge the source of the provided data...

auth
(object)
Details on how to construct an HTTP request to access a protected resource
type
(string)
Method for inserting authorization secret into request
Enum: headerbasic_authquery_parampath_segment
param_name
(string)
When type=query_param, this specifies the name of the query parameter
info_url
(string)
Website to visit to sign up for an account
geometry
(object)
Geometry in GeoJSON format
type
(string)
GeoJSON geometry type

Example:LineString

coordinates
(number array)
An array of GeoJSON coordinates

Example:[ [ -122.496, 37.778 ], [ -122.425, 37.786 ] ]

feed_state
(object)
Details on the current state of this feed, such as active version, last fetch time, etc.
last_fetch_error
(string)
Error produced during the last fetch attempt. Empty string if no error.

Example:404 error

last_fetched_at
(datetime)
Time of last attempted fetch

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

last_successful_fetch_at
(datetime)
Time of last successful fetch that returned valid data

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

feed_version
(object)
The subset of fields of the active feed version. See feed version documentation for full details.
feed_versions
(object array)
A subset of fields for the feed versions associated with this feed

Downloading source GTFS

GET /api/v2/rest/feeds/{feed_key}/download_latest_feed_version Download latest feed version for this feed

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