Supported Realtime Feed Types

This service supports the GTFS-Realtime data exchange format with the following types of information:

Protocol Buffer Specification

GTFS-Realtime uses Google Protocol Buffers: a language and platform-neutral mechanism for efficient serialization of structured data (smaller and faster than XML). The data model is defined in the gtfs-realtime.proto file, which declares all message element hierarchies and types (e.g., FeedMessage, FeedHeader, FeedEntity).

Feed Encoding & Access Method

All feeds are provided as Protocol Buffer binary payloads (Content-Type: application/x-protobuf) over HTTP. Consumers request specific feeds by supplying a feed label (configured logical key) and a feed type.

Request Pattern

GET /GtfsProtoBuf?FeedLabel={feedKey}&FeedType={Alerts|TripUpdates|VehiclePositions}

Feed Refresh Cadence

Feeds are refreshed at least every 30 seconds, or sooner when underlying data (e.g., vehicle position) changes. If no entity content changes, a new FeedHeader.timestamp is still emitted to assert that the snapshot remains valid at that moment.

Internal pruning logic may remove stale entities (expired alerts, inactive vehicles, completed trips) before serialization to keep payloads relevant and lean.

Conditional Retrieval: Last-Modified & If-Modified-Since

Each response supplies a Last-Modified header derived from the feed header's UNIX timestamp (converted to RFC1123 format). Clients are encouraged to send If-Modified-Since on subsequent requests; if the timestamp has not advanced, the service returns 304 Not Modified (no body), conserving bandwidth.

This conditional model helps both producers and consumers avoid redundant parsing and transmission of unchanged binary payloads.

Conditional Retrieval: ETag & If-None-Match

In addition to Last-Modified / If-Modified-Since, the feed endpoint supports ETag-based conditional retrieval:

Protocol Buffer Feed Endpoint Details

The GTFS-Realtime protocol buffer payloads are served by the /GtfsProtoBuf endpoint. Each request returns a binary FeedMessage (as defined in gtfs-realtime.proto) with Content-Type: application/x-protobuf.

Example URLs

/GtfsProtoBuf?FeedLabel=regional&FeedType=TripUpdates
/GtfsProtoBuf?FeedLabel=regional&FeedType=VehiclePositions
/GtfsProtoBuf?FeedLabel=agencyA&FeedType=Alerts

Response Status Codes

CodeMeaning
200 OKFeed returned successfully.
304 Not ModifiedETag or Last-Modified matched — reuse your cached payload.
400 Bad RequestMissing or invalid FeedLabel or FeedType.
404 Not FoundNo current feed for the given combination.
429 Too Many RequestsRequest frequency limit exceeded.
500 Internal Server ErrorUnexpected server-side failure.

Feed Freshness Strategy

Internally each feed tracks the originating GTFS-Realtime FeedHeader.timestamp. Even when no underlying entity (trip, vehicle, or alert) changes, a periodic refresh ensures consumers know the data is still valid as of the latest timestamp. Expiration logic (e.g., vehicle inactivity, alert aging, trip suppression) occurs before serialization.

Caching Guidance

Data Integrity

Each message is atomic: treat the entity list as the authoritative snapshot for the requested feed type at the given timestamp. Partial updates are not issued — consumers should replace their entire local state for that feed type on each successful fetch.