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

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn 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

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA 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

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
direction_idpath0 | 1requiredGTFS 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
direction_idspathstring 0,1requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA 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

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
trip_idpathstring 12053339requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
trip_idpathstring 12053339requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
service_idpathstring 1requiredA service_id from calendar.txt.
direction_idpath0 | 1requiredGTFS 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.

NameInTypeRequiredDescription
service_idpathstring 1requiredA 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.

NameInTypeRequiredDescription
shape_idpathstring 102requiredA 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

NameInTypeRequiredDescription
stop_idpathstring 390requiredA 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

NameInTypeRequiredDescription
stop_idpathstring 390requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
trip_idpathstring 12053339requiredA 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.

NameInTypeRequiredDescription
agency_idpathstring SFMTArequiredAn agency_id from the feed.
route_idpathstring 1requiredA route_id from the feed.
trip_idpathstring 12053339requiredA 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.

NameInTypeRequiredDescription
shape_idpathstring 102requiredA 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.

NameInTypeRequiredDescription
stop_idpathstring 390requiredA 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.

NameInTypeRequiredDescription
stop_idpathstring 390requiredA 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.

NameInTypeRequiredDescription
stop_idpathstring 390requiredA 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.

NameInTypeRequiredDescription
stop_idpathstring 17948requiredThe 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.

NameInTypeRequiredDescription
route_idpathstring 1requiredA 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.

NameInTypeRequiredDescription
entity_typepathstop | stops | route | routes | trip | trips | agency | agencies stopsrequiredThe 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_idpathstring 17948requiredIdentifier 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.

NameInTypeRequiredDescription
entity_typepathstops | routes | trips | agency stopsrequiredThe GTFS entity type the annotation is attached to, matching the type used when the annotation was created.
entity_idpathstring 7948requiredIdentifier 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.

FieldTypeDescription
metaMeta
dataobjectThe payload; shape depends on the resource.

Meta

Counts, paging state and related links.

FieldTypeDescription
totalCountintegerTotal items matching the request, ignoring paging.
dataCountintegerItems in this response.
limitintegerPage size in effect. 0 where paging does not apply.
offsetintegerItems skipped.
linksLinks
last_fetchedintegerRealtime resources only. Unix timestamp of the last successful poll of the upstream GTFS-Realtime feed.

Error

Error document returned for 4xx and 5xx responses.

FieldTypeDescription
messagestringHuman-readable explanation.

ResourceDescriptor

One resource advertised by the API root.

FieldTypeDescription
idstringInternal plugin id.
labelstringHuman-readable name.
uri_templatestringRFC 6570 URI template for the resource.

Feed

An imported GTFS feed.

FieldTypeDescription
namestringName given at import
aliasstringAlias used in paths.
linkstringThe feed's own resource.

Agency

A row of agency.txt.

FieldTypeDescription
labelstringHuman-readable label for the row.
agency_idstring
agency_namestring
agency_urlstring
agency_timezonestring
agency_langstring or null
agency_phonestring or null
agency_fare_urlstring or null
agency_emailstring or null
linksLinks

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.

FieldTypeDescription
labelstring
route_idstring
agency_idstring
route_short_namestring or nullPublic-facing designation, e.g. "38R".
route_long_namestring or null
route_descstring or null
route_typestringGTFS route type as a string, e.g. "3" for bus.
route_urlstring or null
route_colorstring or nullSix-digit hex, no leading "#".
route_text_colorstring or null
route_sort_orderstring or null
continuous_pickupstring or null
continuous_drop_offstring or null
network_idstring or null
linksLinks

Stop

A row of stops.txt.

FieldTypeDescription
labelstring
stop_idstring
stop_codestring or nullRider-facing code
stop_namestring
stop_descstring or null
stop_latstringLatitude as a string.
stop_lonstringLongitude as a string.
zone_idstring or null
stop_urlstring or null
location_typestring or null
parent_stationstring or null
stop_timezonestring or null
wheelchair_boardingstring or null
platform_codestring or null
tts_stop_namestring or nullPronunciation hint for speech output.
level_idstring or null
linksLinks

Trip

A row of trips.txt.

FieldTypeDescription
labelstring
trip_idstring
route_idstring
service_idstring
trip_headsignstring or nullDestination shown to riders.
trip_short_namestring or null
direction_idstring or null
block_idstring or null
shape_idstring or null
wheelchair_accessiblestring or null
bikes_allowedstring or null
linksLinks

StopTime

A row of stop_times.txt.

FieldTypeDescription
labelstring
trip_idstring
arrival_timestring or nullMay exceed 24h, e.g. "25:10:00".
departure_timestring or null
stop_idstring
location_group_idstring or null
stop_sequencestringOrder within the trip
stop_headsignstring or null
start_pickup_drop_off_windowstring or null
end_pickup_drop_off_windowstring or null
pickup_typestring or null
drop_off_typestring or null
continuous_pickupstring or null
continuous_drop_offstring or null
shape_dist_traveledstring or null
timepointstring or null
pickup_booking_rule_idstring or null
drop_off_booking_rule_idstring or null
linksLinks or nullPresent when listed for a stop; a trip's own stop times omit it.

Direction

A direction a route operates in.

FieldTypeDescription
labelstring
route_idstring
direction_idstring
directionstringName of the direction.
routeRoute or nullThe 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.
serviceService or nullThe service calendar, where the deployment resolves one. Often null.
linksLinks

Service

A service calendar: which days it runs, over what date range, and the dates that deviate.

FieldTypeDescription
labelstring
service_idstring
mondaystring"1" when service runs, "0" when not.
tuesdaystring
wednesdaystring
thursdaystring
fridaystring
saturdaystring
sundaystring
start_datestringFirst day of service, ISO 8601 — not GTFS YYYYMMDD.
end_datestringLast day of service, ISO 8601.
exceptionsarray of objectDates that deviate, from calendar_dates.txt. Returned by the single-service resource; the collection omits it.
linksLinks

ShapeStub

Item shape returned by the shapes collection — an identifier and a link to its points, not the geometry itself.

FieldTypeDescription
shape_idstring
linksLinks

ShapePoint

One point of a shape, from shapes.txt.

FieldTypeDescription
labelstring
shape_idstring
shape_pt_latstring
shape_pt_lonstring
shape_pt_sequencestring
shape_dist_traveledstring 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.

FieldTypeDescription
agency_idstring
route_idstring
service_idstring
direction_idstring
scheduleobjectThe grid itself.

ScheduleTrip

ScheduleCell

One call in a timetable grid.

FieldTypeDescription
stop_idintegerThe stop for this cell. Note this is an integer here, while Stop.stop_id elsewhere in the API is a string.
arrival_timestringArrival formatted for display.
arrival_time_secondsintegerThe 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.

FieldTypeDescription
typeFeature
propertiesobject or nullIdentity 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.
geometryobject

TripUpdate

A GTFS-Realtime TripUpdate. Field names follow the Protobuf schema in camelCase.

FieldTypeDescription
tripRtTripDescriptor
vehicleRtVehicleDescriptor
stopTimeUpdatearray of objectPredictions for the stops ahead on this trip.
timestampstringUnix timestamp of this update

RtTripDescriptor

GTFS-Realtime TripDescriptor — which scheduled trip an update refers to. Shared by trip updates and vehicle positions.

FieldTypeDescription
tripIdstring
routeIdstring
directionIdintegerDirection as an integer here, unlike the string on static trips.
startDatestringService date the trip started, YYYYMMDD.
scheduleRelationshipstringHow this trip relates to the schedule.
tripHeadsignstring or null

RtVehicleDescriptor

GTFS-Realtime VehicleDescriptor — which vehicle is running the trip.

FieldTypeDescription
idstringAgency's vehicle identifier.
labelstring or nullFleet number shown to riders.
licensePlatestring or nullOften an empty string where the agency does not publish it.

StopTimeEvent

A predicted arrival or departure.

FieldTypeDescription
timestringPredicted Unix timestamp
delayintegerSeconds behind schedule; negative is early. Absent when not published.

VehiclePosition

A GTFS-Realtime VehiclePosition.

FieldTypeDescription
tripRtTripDescriptor
vehicleRtVehicleDescriptor
positionobjectCoordinates here are numbers, not strings.
currentStopSequenceinteger
currentStatusstringWhere the vehicle is relative to stopId — GTFS-Realtime's VehicleStopStatus enum.
stopIdstring
timestampstring
occupancyStatusstringGTFS-Realtime occupancy enum, where the agency publishes it.

Alert

A GTFS-Realtime Alert. Text fields are TranslatedStrings; pick the translation matching your locale.

FieldTypeDescription
idstring
headerTextTranslatedString
descriptionTextTranslatedString
informedEntityarray of objectThe stops, routes or trips this alert applies to.

TranslatedString

GTFS-Realtime translated text.

FieldTypeDescription
translationarray of object

Annotation

An operator note or override attached to a GTFS entity.

FieldTypeDescription
idinteger
annotation_typecomment | overridecomment adds a message; override redirects predictions to another entity.
entity_typestring
entity_idstring
secondary_entity_typestring or nullNarrows the annotation, e.g. one route at one stop.
secondary_entity_idstring or null
bodystringProcessed HTML.
override_entity_idstring or nullReplacement entity, for overrides.
activebooleanWhether 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.

NameInTypeRequiredDescription
feed_aliaspathstring autumn-2026requiredAlias of the feed to read, from /feeds. A deployment may host several feed versions at once.
limitqueryinteger default 500optionalItems per page. Collections default to 500.
offsetqueryinteger default 0optionalItems to skip. Prefer following meta.links.next.
_formatqueryjson default jsonoptionalResponse 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.