Contents
REST API - Feeds
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.
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 specified format
Parameter | Type | Description | Example |
---|---|---|---|
id | integer 0 ... unlimited | Search for a specific internal ID | |
feed_key | string | Feed lookup key; can be an integer ID or a Onestop ID | |
after | integer | Return records past this record ID | |
limit | integer 0 ... 100 | Maximum number of records to return | limit=1 |
format | enum | 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 | Type of data contained in this feed | spec=gtfs |
fetch_error | string enum | 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 |
radius | number 0 ... 10000 | Search for feeds geographically; radius is in meters, requires lon and lat | lon=-122&lat=37&radius=1000 |
lon | number -180 ... 180 | Longitude | |
lat | number -90 ... 90 | Latitude | |
bbox | string | Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated string | bbox=-122.269,37.807,-122.267,37.808 |
license_commercial_use_allowed | enum | 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'. | |
license_share_alike_optional | enum | 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'. | |
license_create_derived_product | enum | 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'. | |
license_redistribution_allowed | enum | 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'. | |
license_use_without_attribution | enum | 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'. |
Response format
Array of objects
Description Distributed mobility data registry (DMFR) feed
Reference DMFR Schema
id
(integer)
(integer)
Unique integer ID
onestop_id
(string)
(string)
Onestop ID for this feed
Examplef-9q9-bart
name
(string)
(string)
A common name for this feed
ExampleBay Area Rapid Transit
spec
(string)
(string)
Type of data contained in this feed: GTFS, GTFS-RT, GBFS, or MDS
languages
(string array)
(string array)
Language(s) included in this feed
Example{ "0": "en-US" }
feed_versions
(object array)
(object array)
A subset of fields for the feed versions associated with this feed
urls
(object)
(object)
URLs that provide data associated with this feed
static_current
(string)
(string)
URL for the static feed that represents today's service
Examplehttps://www.bart.gov/dev/schedules/google_transit.zip
static_historic
(string array)
(string array)
URLs for static feeds that represent past service that is no longer in effect
static_planned
(string)
(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)
(string)
URL for GTFS Realtime VehiclePosition messages
realtime_trip_updates
(string)
(string)
URL for GTFS Realtime TripUpdate messages
realtime_alerts
(string)
(string)
URL for GTFS Realtime Alert messages
gbfs_auto_discovery
(string)
(string)
URL for GBFS auto discovery
mds_provider
(string)
(string)
URL for MDS endpoint
license
(object)
(object)
License information for this feed, if present
spdx_identifier
(string)
(string)
SPDX identifier for a common license. See https://spdx.org/licenses/
ExampleCC-BY-4.0
url
(string)
(string)
URL for a custom license
Examplehttp://www.actransit.org/data-terms-and-conditions/
use_without_attribution
(string)
(string)
Are feed consumers allowed to use the feed contents without including attribution text in their app or map?
create_derived_product
(string)
(string)
Are feed consumers allowed to create and share derived products from the feed?
redistribution_allowed
(string)
(string)
Are feed consumers allowed to redistribute the feed in its entirety?
commercial_use_allowed
(string)
(string)
Are feed consumers allowed to use the feed for commercial purposes?
share_alike_optional
(string)
(string)
Are feed consumers allowed to keep their modifications of this feed private?
attribution_text
(string)
(string)
Feed consumers must include this particular text when using this feed
Exampledata provided by 511.org
attribution_instructions
(string)
(string)
Feed consumers must follow these instructions for how to provide attribution
ExampleYou must acknowledge the source of the provided data...
auth
(object)
(object)
Details on how to construct an HTTP request to access a protected resource
type
(string)
(string)
Method for inserting authorization secret into request
param_name
(string)
(string)
When type=query_param, this specifies the name of the query parameter. When type=header, this specifies the name of the header.
info_url
(string)
(string)
Website to visit to sign up for an account
feed_state
(object)
(object)
Details on the current state of this feed, such as active version, last fetch time, etc.
last_fetch_error
(string)
(string)
Error produced during the last fetch attempt. Empty string if no error.
Example404 error
last_fetched_at
(datetime)
(datetime)
Time of last attempted fetch
Example2019-11-15T00:45:55.409906
last_successful_fetch_at
(datetime)
(datetime)
Time of last successful fetch that returned valid data
Example2019-11-15T00:45:55.409906
feed_version
(object)
(object)
The subset of fields of the active feed version. See feed version documentation for full details.
geometry
(object)
(object)
Geometry in GeoJSON format
type
(string)
(string)
GeoJSON geometry type
ExampleLineString
coordinates
(number array)
(number array)
An array of coordinates; may be nested arrays if geometry is Polygon or MultiLineString
Example[ [ -122.496, 37.778 ], [ -122.425, 37.786 ] ]
Downloading source GTFS
See also downloading static GTFS feed versions.
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 redistribution is allowd by the source feed's license