API reference
Static GTFS and GTFS-Realtime data served as JSON. Version 2.0.
Base URL https://{host}/gtfs/api/v2
Every endpoint is a public read returning the same
meta/data envelope. Authentication, errors, caching,
realtime scoping and versioning are covered in the
notes at the foot of this page.
Discovery
Finding out what a deployment serves.
GET/
List every resource the deployment serves
Returns each REST resource with its URI template. Useful for discovering the surface of an unfamiliar deployment.
Also takes _format.
Returns array of ResourceDescriptor inside the standard envelope.
Example response
{
"meta": {
"totalCount": 24,
"dataCount": 24,
"limit": 0,
"offset": 0
},
"data": [
{
"id": "gtfs_stop_resource",
"label": "GTFS stop REST",
"uri_template": "https://transit.example.gov/gtfs/api/v2/feeds/{feed_alias}/stops/{stop_id}"
}
]
}GET/feeds
List available feeds
Every feed loaded into the deployment, with its alias.
Also takes _format.
Returns array of Feed inside the standard envelope.
Example response
{
"meta": {
"totalCount": 2,
"dataCount": 2,
"links": {
"self": "https://transit.example.gov/gtfs/api/v2/feeds",
"next": false,
"previous": false
},
"limit": 0,
"offset": 0
},
"data": [
{
"name": "Autumn 2026 service change",
"alias": "autumn-2026",
"link": "https://transit.example.gov/gtfs/api/v2/feeds/autumn-2026"
}
]
}GET/feeds/{feed_alias}
Describe one feed
Feed metadata, plus links to its collections in meta.links.
Also takes feed_alias, _format.
Returns Feed inside the standard envelope.
Static GTFS
Scheduled service, imported from the agency's GTFS feed.
GET/feeds/{feed_alias}/agencies
List agencies
Contents of agency.txt.
Also takes feed_alias, limit, offset, _format.
Returns array of Agency inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}
Get one agency
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
Also takes feed_alias, _format.
Returns Agency inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes
List routes
Contents of routes.txt for one agency.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Route inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}
Get one route
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
Also takes feed_alias, _format.
Returns Route inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/geojson
Get a route's shape as GeoJSON
A GeoJSON Feature whose geometry is a MultiLineString covering every shape the route's trips reference. Route identity and styling (route_color, route_text_color) travel in properties, ready to hand to a map library.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
Also takes feed_alias, _format.
Returns GeoJsonFeature inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/directions
List a route's directions
The directions the route operates in, derived from its trips. Direction names come from the feed where present.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
Also takes feed_alias, _format.
Returns array of Direction inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/directions/{direction_id}
Get one direction of a route
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
direction_id | path | 0 | 1 | required | GTFS direction id. |
Also takes feed_alias, _format.
Returns Direction inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/stops/{direction_ids}
List the stops a route serves
Stops along the route, in service order, for one or more directions.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
direction_ids | path | string 0,1 | required | A direction id, or several separated by commas. |
Also takes feed_alias, limit, offset, _format.
Returns array of Stop inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/trips
List a route's trips
Contents of trips.txt for this route. Large routes run to thousands of trips; page with limit and offset.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Trip inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/trips/{trip_id}
Get one trip
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
trip_id | path | string 12053339 | required | A trip_id from the feed. |
Also takes feed_alias, _format.
Returns Trip inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/trips/{trip_id}/stop_times
List a trip's stop times
Contents of stop_times.txt for the trip, in stop_sequence order. Times may exceed 24 hours ("25:10:00") for service running past midnight, per the GTFS specification.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
trip_id | path | string 12053339 | required | A trip_id from the feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of StopTime inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/schedules/{service_id}/{direction_id}
Get a route timetable
A timetable for one route, service and direction: the ordered stops and the trips that call at them, assembled ready to render as a grid.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
service_id | path | string 1 | required | A service_id from calendar.txt. |
direction_id | path | 0 | 1 | required | GTFS direction id. |
Also takes feed_alias, _format.
Returns Schedule inside the standard envelope.
Example response
{
"meta": {
"totalCount": 0,
"dataCount": 0,
"limit": 500,
"offset": 0
},
"data": {
"agency_id": "SFMTA",
"route_id": "1",
"service_id": "2",
"direction_id": "0",
"schedule": {
"stops": [
{
"label": "Clay St & Drumm St (4015)",
"stop_id": "4015",
"stop_name": "Clay St & Drumm St"
},
{
"label": "Sacramento St & Kearny St (3892)",
"stop_id": "3892",
"stop_name": "Sacramento St & Kearny St"
}
],
"trips": [
{
"label": "Geary + 33rd Avenue",
"trip_id": "12053368",
"route_id": "1",
"service_id": "2",
"direction_id": "0",
"stop_times": [
null,
{
"stop_id": 3892,
"arrival_time": "4:38am",
"arrival_time_seconds": 16680
}
]
}
]
}
}
}GET/feeds/{feed_alias}/services
List service calendars
Service calendars from calendar.txt. Each item carries the weekly pattern and date range; fetch a single service to add its exceptions from calendar_dates.txt.
Also takes feed_alias, limit, offset, _format.
Returns array of Service inside the standard envelope.
GET/feeds/{feed_alias}/services/{service_id}
Get one service calendar
The weekly service pattern, the date range it applies over, and any exceptions from calendar_dates.txt.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
service_id | path | string 1 | required | A service_id from calendar.txt. |
Also takes feed_alias, _format.
Returns Service inside the standard envelope.
GET/feeds/{feed_alias}/shapes/{shape_id}
Get a shape's points
The ordered points of one shape from shapes.txt. For route geometry ready to draw, prefer the route GeoJSON resource.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
shape_id | path | string 102 | required | A shape_id from the feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of ShapePoint inside the standard envelope.
GET/feeds/{feed_alias}/stops
List stops
Contents of stops.txt. Systems commonly have thousands of stops and the default page is 500; follow meta.links.next to page through.
Also takes feed_alias, limit, offset, _format.
Returns array of Stop inside the standard envelope.
GET/feeds/{feed_alias}/stops/{stop_id}
Get one stop
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 390 | required | A stop_id from the static feed. |
Also takes feed_alias, _format.
Returns Stop inside the standard envelope.
GET/feeds/{feed_alias}/stops/{stop_id}/routes
List the routes calling at a stop
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 390 | required | A stop_id from the static feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Route inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/wkt
Get a route's shape as WKT
The same geometry as the GeoJSON resource, as a Well-Known Text MULTILINESTRING. Useful for loading straight into PostGIS or another geospatial tool. The payload is a bare string, not an object.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
Also takes feed_alias, _format.
Example response
{
"meta": {
"totalCount": 0,
"dataCount": 0,
"limit": 500,
"offset": 0
},
"data": "MULTILINESTRING((-122.397 37.7954,-122.3968 37.7955))"
}GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/trips/{trip_id}/geojson
Get a trip's shape as GeoJSON
A GeoJSON Feature for one trip's path — a LineString, where the route resource returns a MultiLineString covering every variant. properties carries the trip's identity and headsign.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
trip_id | path | string 12053339 | required | A trip_id from the feed. |
Also takes feed_alias, _format.
Returns GeoJsonFeature inside the standard envelope.
GET/feeds/{feed_alias}/agencies/{agency_id}/routes/{route_id}/trips/{trip_id}/stops
List the stops a trip calls at
Stops on this trip, in stop_sequence order.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agency_id | path | string SFMTA | required | An agency_id from the feed. |
route_id | path | string 1 | required | A route_id from the feed. |
trip_id | path | string 12053339 | required | A trip_id from the feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Stop inside the standard envelope.
GET/feeds/{feed_alias}/shapes
List shape ids
Every shape_id in the feed, with a link to its points. Identifiers only — fetch a shape for its geometry.
Also takes feed_alias, limit, offset, _format.
Returns array of ShapeStub inside the standard envelope.
GET/feeds/{feed_alias}/shapes/{shape_id}/geojson
Get a shape as GeoJSON
A GeoJSON Feature whose geometry is the shape's LineString. Carries no properties; the shape id is in the request.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
shape_id | path | string 102 | required | A shape_id from the feed. |
Also takes feed_alias, _format.
Returns GeoJsonFeature inside the standard envelope.
GET/feeds/{feed_alias}/stops/{stop_id}/directions
List the route directions serving a stop
Every route-and-direction combination that calls at this stop. Each item embeds the full route, so a departure board can be built from one request.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 390 | required | A stop_id from the static feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Direction inside the standard envelope.
GET/feeds/{feed_alias}/stops/{stop_id}/trips
List the trips calling at a stop
Every trip that stops here. Busy stops run to thousands of trips across all service days; page with limit and offset.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 390 | required | A stop_id from the static feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of Trip inside the standard envelope.
GET/feeds/{feed_alias}/stops/{stop_id}/stop_times
List scheduled calls at a stop
Every scheduled arrival and departure at this stop, across all trips and service days — the timetable for one stop. Filter by service day using the service_id on the referenced trips.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 390 | required | A stop_id from the static feed. |
Also takes feed_alias, limit, offset, _format.
Returns array of StopTime inside the standard envelope.
Realtime
GTFS-Realtime, decoded from Protobuf and served as JSON.
GET/rt/tripupdates/{stop_id}
Predicted arrivals and departures at a stop
GTFS-Realtime TripUpdate entities affecting this stop, decoded from Protobuf.
Realtime feeds may identify stops differently from the static feed — many agencies publish stop_code in realtime and stop_id in the schedule. Use the identifier your realtime feed uses.
meta.last_fetched is the Unix timestamp of the last successful poll of the upstream feed. Compare it against your own clock to decide whether a prediction is still trustworthy.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stop_id | path | string 17948 | required | The stop identifier as it appears in the realtime feed. |
Also takes _format.
Returns array of TripUpdate inside the standard envelope.
Example response
{
"meta": {
"totalCount": 16,
"dataCount": 16,
"limit": 500,
"offset": 0,
"last_fetched": 1787101680
},
"data": [
{
"trip": {
"tripId": "12066664_M21",
"routeId": "25",
"directionId": 0,
"startDate": "20260818",
"scheduleRelationship": "SCHEDULED",
"tripHeadsign": "Treasure Island"
},
"vehicle": {
"id": "8744",
"label": "8744",
"licensePlate": ""
},
"stopTimeUpdate": [
{
"stopSequence": 1,
"stopId": "17948",
"departure": {
"delay": 0,
"time": "1787101800"
}
},
{
"stopSequence": 2,
"stopId": "18000",
"arrival": {
"delay": 117,
"time": "1787102517"
}
}
],
"timestamp": "1787101656"
}
]
}GET/rt/vehicles/{route_id}
Live vehicle positions on a route
GTFS-Realtime VehiclePosition entities for the route, with coordinates, bearing and speed where the agency publishes them.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
route_id | path | string 1 | required | A route_id from the feed. |
Also takes _format.
Returns array of VehiclePosition inside the standard envelope.
Example response
{
"meta": {
"totalCount": 12,
"dataCount": 12,
"limit": 500,
"offset": 0,
"last_fetched": 1787102550
},
"data": [
{
"trip": {
"tripId": "12053257_M21",
"routeId": "1",
"directionId": 1,
"startDate": "20260818",
"scheduleRelationship": "SCHEDULED"
},
"vehicle": {
"id": "5737",
"label": "5737",
"licensePlate": ""
},
"position": {
"latitude": 37.795387,
"longitude": -122.39716,
"bearing": 75,
"speed": 0
},
"currentStopSequence": 48,
"stopId": "14015",
"currentStatus": "STOPPED_AT",
"timestamp": "1787102547",
"occupancyStatus": "EMPTY"
}
]
}GET/rt/alerts/{entity_type}/{entity_id}
Service alerts affecting an entity
GTFS-Realtime Alert entities whose informed entities include the one addressed. Returns an empty array when nothing is disrupted.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
entity_type | path | stop | stops | route | routes | trip | trips | agency | agencies stops | required | The kind of entity the alert is attached to. Singular and plural are both accepted — the server strips one trailing s — so stop and stops behave identically. |
entity_id | path | string 17948 | required | Identifier of that entity in the realtime feed. |
Also takes _format.
Returns array of Alert inside the standard envelope.
Example response
{
"meta": {
"totalCount": 1,
"dataCount": 1,
"limit": 500,
"offset": 0,
"last_fetched": 1787101680
},
"data": [
{
"id": "alert_4471",
"headerText": {
"translation": [
{
"text": "Route 17: weekend detour",
"language": "en"
},
{
"text": "Ruta 17: desv\u00edo de fin de semana",
"language": "es"
}
]
},
"descriptionText": {
"translation": [
{
"text": "Stops 4030-4034 are closed. Board at Elm St.",
"language": "en"
}
]
},
"informedEntity": [
{
"agencyId": "SFMTA",
"routeId": "17",
"stopId": null
}
]
}
]
}Display
Operator annotations and overrides attached to GTFS entities.
GET/display/annotations/{entity_type}/{entity_id}
Operator annotations for an entity
Notes and overrides staff have attached to a GTFS entity — a boarding change, a temporary closure, a message for one route at one stop.
Only annotations currently within their active time window are returned. body is text-format processed HTML.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
entity_type | path | stops | routes | trips | agency stops | required | The GTFS entity type the annotation is attached to, matching the type used when the annotation was created. |
entity_id | path | string 7948 | required | Identifier of that entity in the static feed. |
Also takes _format.
Returns array of Annotation inside the standard envelope.
Example response
{
"meta": {
"totalCount": 1,
"dataCount": 1,
"limit": 500,
"offset": 0
},
"data": [
{
"id": 12,
"annotation_type": "override",
"entity_type": "stop",
"entity_id": "4021",
"secondary_entity_type": "route",
"secondary_entity_id": "17",
"body": "<p>Board across the street this weekend.</p>",
"override_entity_id": "4099",
"active": true
}
]
}Schemas
The shapes referenced above.
Envelope
The wrapper every successful response shares. data is an object for single resources and an array for collections.
| Field | Type | Description |
|---|---|---|
meta | Meta | |
data | object | The payload; shape depends on the resource. |
Meta
Counts, paging state and related links.
| Field | Type | Description |
|---|---|---|
totalCount | integer | Total items matching the request, ignoring paging. |
dataCount | integer | Items in this response. |
limit | integer | Page size in effect. 0 where paging does not apply. |
offset | integer | Items skipped. |
links | Links | |
last_fetched | integer | Realtime resources only. Unix timestamp of the last successful poll of the upstream GTFS-Realtime feed. |
Links
Related resources. Absent keys mean the relation does not apply.
next and previous are false rather than null when there is no further page — test truthiness, not presence.
| Field | Type | Description |
|---|---|---|
self | string | This resource. |
next | string or false | Next page, or false. |
previous | string or false | Previous page, or false. |
feed | string | The feed this belongs to. |
list | string | The collection this item came from. |
Error
Error document returned for 4xx and 5xx responses.
| Field | Type | Description |
|---|---|---|
message | string | Human-readable explanation. |
ResourceDescriptor
One resource advertised by the API root.
| Field | Type | Description |
|---|---|---|
id | string | Internal plugin id. |
label | string | Human-readable name. |
uri_template | string | RFC 6570 URI template for the resource. |
Feed
An imported GTFS feed.
| Field | Type | Description |
|---|---|---|
name | string | Name given at import |
alias | string | Alias used in paths. |
link | string | The feed's own resource. |
Agency
A row of agency.txt.
| Field | Type | Description |
|---|---|---|
label | string | Human-readable label for the row. |
agency_id | string | |
agency_name | string | |
agency_url | string | |
agency_timezone | string | |
agency_lang | string or null | |
agency_phone | string or null | |
agency_fare_url | string or null | |
agency_email | string or null | |
links | Links |
Route
A row of routes.txt.
Deployments may enrich route payloads with their own fields through hook_gtfs_route_data_alter() — an agency logo URL, a route map image. Treat unrecognised keys as additive rather than an error.
| Field | Type | Description |
|---|---|---|
label | string | |
route_id | string | |
agency_id | string | |
route_short_name | string or null | Public-facing designation, e.g. "38R". |
route_long_name | string or null | |
route_desc | string or null | |
route_type | string | GTFS route type as a string, e.g. "3" for bus. |
route_url | string or null | |
route_color | string or null | Six-digit hex, no leading "#". |
route_text_color | string or null | |
route_sort_order | string or null | |
continuous_pickup | string or null | |
continuous_drop_off | string or null | |
network_id | string or null | |
links | Links |
Stop
A row of stops.txt.
| Field | Type | Description |
|---|---|---|
label | string | |
stop_id | string | |
stop_code | string or null | Rider-facing code |
stop_name | string | |
stop_desc | string or null | |
stop_lat | string | Latitude as a string. |
stop_lon | string | Longitude as a string. |
zone_id | string or null | |
stop_url | string or null | |
location_type | string or null | |
parent_station | string or null | |
stop_timezone | string or null | |
wheelchair_boarding | string or null | |
platform_code | string or null | |
tts_stop_name | string or null | Pronunciation hint for speech output. |
level_id | string or null | |
links | Links |
Trip
A row of trips.txt.
| Field | Type | Description |
|---|---|---|
label | string | |
trip_id | string | |
route_id | string | |
service_id | string | |
trip_headsign | string or null | Destination shown to riders. |
trip_short_name | string or null | |
direction_id | string or null | |
block_id | string or null | |
shape_id | string or null | |
wheelchair_accessible | string or null | |
bikes_allowed | string or null | |
links | Links |
StopTime
A row of stop_times.txt.
| Field | Type | Description |
|---|---|---|
label | string | |
trip_id | string | |
arrival_time | string or null | May exceed 24h, e.g. "25:10:00". |
departure_time | string or null | |
stop_id | string | |
location_group_id | string or null | |
stop_sequence | string | Order within the trip |
stop_headsign | string or null | |
start_pickup_drop_off_window | string or null | |
end_pickup_drop_off_window | string or null | |
pickup_type | string or null | |
drop_off_type | string or null | |
continuous_pickup | string or null | |
continuous_drop_off | string or null | |
shape_dist_traveled | string or null | |
timepoint | string or null | |
pickup_booking_rule_id | string or null | |
drop_off_booking_rule_id | string or null | |
links | Links or null | Present when listed for a stop; a trip's own stop times omit it. |
Direction
A direction a route operates in.
| Field | Type | Description |
|---|---|---|
label | string | |
route_id | string | |
direction_id | string | |
direction | string | Name of the direction. |
route | Route or null | The full route, embedded when the direction is reached through a stop, so a departure board needs one request. Absent on a route's own directions. |
service | Service or null | The service calendar, where the deployment resolves one. Often null. |
links | Links |
Service
A service calendar: which days it runs, over what date range, and the dates that deviate.
| Field | Type | Description |
|---|---|---|
label | string | |
service_id | string | |
monday | string | "1" when service runs, "0" when not. |
tuesday | string | |
wednesday | string | |
thursday | string | |
friday | string | |
saturday | string | |
sunday | string | |
start_date | string | First day of service, ISO 8601 — not GTFS YYYYMMDD. |
end_date | string | Last day of service, ISO 8601. |
exceptions | array of object | Dates that deviate, from calendar_dates.txt. Returned by the single-service resource; the collection omits it. |
links | Links |
ShapeStub
Item shape returned by the shapes collection — an identifier and a link to its points, not the geometry itself.
| Field | Type | Description |
|---|---|---|
shape_id | string | |
links | Links |
ShapePoint
One point of a shape, from shapes.txt.
| Field | Type | Description |
|---|---|---|
label | string | |
shape_id | string | |
shape_pt_lat | string | |
shape_pt_lon | string | |
shape_pt_sequence | string | |
shape_dist_traveled | string or null |
Schedule
A timetable for one route, service and direction, pre-assembled as a grid: schedule.stops are the rows and schedule.trips the columns.
Each trip's stop_times array is positionally aligned to schedule.stops and always the same length: index *n* is that trip's call at stops[n], or null where the trip skips it. Render the grid by walking the two in step — do not match on stop_id.
| Field | Type | Description |
|---|---|---|
agency_id | string | |
route_id | string | |
service_id | string | |
direction_id | string | |
schedule | object | The grid itself. |
ScheduleTrip
ScheduleCell
One call in a timetable grid.
| Field | Type | Description |
|---|---|---|
stop_id | integer | The stop for this cell. Note this is an integer here, while Stop.stop_id elsewhere in the API is a string. |
arrival_time | string | Arrival formatted for display. |
arrival_time_seconds | integer | The same arrival as seconds after midnight, for sorting and comparison. Values above 86400 are service past midnight. |
GeoJsonFeature
A GeoJSON Feature (RFC 7946). Coordinates are [longitude, latitude] and are real numbers, unlike the string coordinates on static resources.
Geometry and properties depend on which resource produced it: a route returns a MultiLineString covering every shape its trips use, with route identity and styling in properties; a trip returns the LineString it follows, with trip identity; a shape returns its LineString and no properties at all.
| Field | Type | Description |
|---|---|---|
type | Feature | |
properties | object or null | Identity and styling for the feature. Route features carry the route fields below; trip features carry trip_id, route_id, service_id, trip_headsign and block_id; shape features carry none. |
geometry | object |
TripUpdate
A GTFS-Realtime TripUpdate. Field names follow the Protobuf schema in camelCase.
| Field | Type | Description |
|---|---|---|
trip | RtTripDescriptor | |
vehicle | RtVehicleDescriptor | |
stopTimeUpdate | array of object | Predictions for the stops ahead on this trip. |
timestamp | string | Unix timestamp of this update |
RtTripDescriptor
GTFS-Realtime TripDescriptor — which scheduled trip an update refers to. Shared by trip updates and vehicle positions.
| Field | Type | Description |
|---|---|---|
tripId | string | |
routeId | string | |
directionId | integer | Direction as an integer here, unlike the string on static trips. |
startDate | string | Service date the trip started, YYYYMMDD. |
scheduleRelationship | string | How this trip relates to the schedule. |
tripHeadsign | string or null |
RtVehicleDescriptor
GTFS-Realtime VehicleDescriptor — which vehicle is running the trip.
| Field | Type | Description |
|---|---|---|
id | string | Agency's vehicle identifier. |
label | string or null | Fleet number shown to riders. |
licensePlate | string or null | Often an empty string where the agency does not publish it. |
StopTimeEvent
A predicted arrival or departure.
| Field | Type | Description |
|---|---|---|
time | string | Predicted Unix timestamp |
delay | integer | Seconds behind schedule; negative is early. Absent when not published. |
VehiclePosition
A GTFS-Realtime VehiclePosition.
| Field | Type | Description |
|---|---|---|
trip | RtTripDescriptor | |
vehicle | RtVehicleDescriptor | |
position | object | Coordinates here are numbers, not strings. |
currentStopSequence | integer | |
currentStatus | string | Where the vehicle is relative to stopId — GTFS-Realtime's VehicleStopStatus enum. |
stopId | string | |
timestamp | string | |
occupancyStatus | string | GTFS-Realtime occupancy enum, where the agency publishes it. |
Alert
A GTFS-Realtime Alert. Text fields are TranslatedStrings; pick the translation matching your locale.
| Field | Type | Description |
|---|---|---|
id | string | |
headerText | TranslatedString | |
descriptionText | TranslatedString | |
informedEntity | array of object | The stops, routes or trips this alert applies to. |
TranslatedString
GTFS-Realtime translated text.
| Field | Type | Description |
|---|---|---|
translation | array of object |
Annotation
An operator note or override attached to a GTFS entity.
| Field | Type | Description |
|---|---|---|
id | integer | |
annotation_type | comment | override | comment adds a message; override redirects predictions to another entity. |
entity_type | string | |
entity_id | string | |
secondary_entity_type | string or null | Narrows the annotation, e.g. one route at one stop. |
secondary_entity_id | string or null | |
body | string | Processed HTML. |
override_entity_id | string or null | Replacement entity, for overrides. |
active | boolean | Whether it is within its time window now. |
Common parameters
These repeat across most endpoints, so each endpoint above lists only the parameters specific to it and then names which of these it also takes.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
feed_alias | path | string autumn-2026 | required | Alias of the feed to read, from /feeds. A deployment may host several feed versions at once. |
limit | query | integer default 500 | optional | Items per page. Collections default to 500. |
offset | query | integer default 0 | optional | Items to skip. Prefer following meta.links.next. |
_format | query | json default json | optional | Response format. Send Accept: application/json instead if you prefer; one or the other is required. |
Notes
The read API exposed by a gtfs.media deployment. Static GTFS files are modelled as addressable resources under a feed alias; GTFS-Realtime feeds are decoded server-side and republished as JSON.
Every response uses the same envelope — a meta object and a data payload — so a client written against one resource can read them all.
Authentication: none. Every endpoint here is a public read. A stock deployment grants them to anonymous users through Drupal's permission system, so no key, token or header is required. An operator can restrict any resource per role, in which case that endpoint returns 403 for clients without the permission.
Errors. A missing feed, entity or route returns 404 with an error document — {"message": "..."} — rather than the usual envelope. There is no 400: a malformed path segment is treated as "matches nothing", so a nonsensical direction_id or entity_type returns 200 with an empty data array rather than an error. Check meta.dataCount rather than relying on a status code to tell you a filter was wrong.
Rate limiting: none. A stock deployment applies no request quota. The upstream 511-style aggregators some deployments pull from do impose their own limits, but that is between the deployment and its source, not between you and this API.
Caching and polling. Realtime responses are explicitly uncacheable, so poll them directly; static responses carry whatever max-age the deployment sets (commonly a few minutes). Each realtime feed re-fetches from upstream on its own refresh_interval, 60 seconds by default, and meta.last_fetched reports when that last succeeded. Polling faster than the refresh interval returns the same payload, so 10–30 seconds is a sensible client interval and anything under 10 is waste. A display requesting data also triggers an async upstream refresh when the feed is stale, so active screens keep feeds warm.
CORS: not enabled by default. A stock deployment sends no Access-Control-Allow-* headers, so browser code must be same-origin with the API — which is how the platform's own displays and embeds work. To read it from another origin, the operator enables Drupal's cors.config in services.yml, or fronts the API with a proxy that adds the headers.
Realtime is not feed-scoped. Static paths sit under a feed_alias; /rt/* paths do not. A realtime resource reads every configured feed of its type and merges the results. Where a deployment hosts several feeds whose stop_id or route_id values collide, matches from all of them come back together, so filter on the returned trip/vehicle fields if you need to tell them apart.
Numbers arrive as strings. GTFS values are served as they appear in the feed, so stop_lat, route_type, stop_sequence and similar fields are JSON strings ("37.7212", "3", "1"), not numbers. Realtime payloads are mixed: coordinates and delay are real numbers, but timestamp on trip updates and vehicle positions is a string, while meta.last_fetched is an integer. Parse defensively rather than assuming a type per name.
Dates are ISO 8601, not GTFS. start_date, end_date and the dates on service exceptions come back as "2026-07-23T00:00:00", not the YYYYMMDD form used inside calendar.txt. Times of day keep their GTFS form and may exceed 24 hours ("25:10:00") for service running past midnight.
Feeds are versioned side by side. A deployment can host several feeds at once, each with its own alias; every static path is scoped to one.
Versioning. v1 was internal and never published. v2 is stable and add-only: new resources and new fields may appear, but existing ones will not change shape or disappear. Anything genuinely breaking would ship as v3, if it ever happens.
This document describes the surface of a stock deployment. Agency-specific modules may add resources and fields beyond it.
Put your feed to work.
Every display and map on this platform reads the endpoints above. Yours can too.