Reference · built on requestCommons signalTransit, roads & mobility

LA Metro Real Time API

GTFS-realtime positions and trip updates for Metro bus and rail via Swiftly, a bus cancellations feed, and GTFS schedules.

About

The Los Angeles County Metropolitan Transportation Authority publishes its real-time data on developer.metro.net. GTFS-realtime Vehicle Positions, Trip Updates and Alerts are served through Swiftly under two agency keys, lametro for bus and lametro-rail for rail, in protobuf or JSON. A beta Bus Cancellations API lists scheduled cancellations by line. Static GTFS for bus and rail lives on GitLab.

An operator reads cancellations and trip updates for the lines your people ride and proposes a coverage change or a shuttle hold, which you approve.

This is a reference listing. It documents what Fibric would read from LA Metro Real Time API and what it could propose, based on the publisher's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • GTFS-realtime Vehicle Positions through Swiftly, updated every 5 seconds, for agencyKey lametro (bus) and lametro-rail (rail)
  • GTFS-realtime Trip Updates every 10 seconds, and Alerts, in protobuf or JSON
  • Bus Cancellations (beta): canceled_service_summary, canceled_service/all, canceled_service/line/{line}, updated roughly every 5 minutes
  • Bus GTFS from gitlab.com/LACMTA/gtfs_bus: a weekly-updated-service branch and a master branch with error fixes and shuttle service
  • Rail GTFS from gitlab.com/LACMTA/gtfs_rail, updated daily, Tuesday to Saturday mornings, with temporary service changes
  • GIS shapefiles for Metro Rail, fixed-guideway bus lines, and Metro-owned railroad rights-of-way

Proposed actions

Read-only. This feed informs operators; it changes nothing.

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Spot a cancelled bus before the shift starts

    Read canceled_service/line/{line} for the lines your staff ride. When a trip inside their commute window is cancelled, the operator proposes a late-start allowance or an open-shift offer and cites the trip.

    With Shift Coverage, No-Show Response

  • Hold a shuttle for the next rail trip

    Poll Trip Updates for lametro-rail at your nearest station. When the next arrival slips past the shuttle time, the operator proposes a later departure and shows the update it used.

    With Shuttle Timing

  • Count cancellations in the morning brief

    Each morning the operator reads canceled_service_summary and lists the lines with cancellations, with counts per line, in the brief.

    With Morning Brief

Requirements

  • A Swiftly API key and the agencyKey for the mode you watch: lametro for bus, lametro-rail for rail
  • A protobuf or JSON reader; Swiftly serves both formats
  • Metro line numbers for the cancellations feed and GTFS route ids for the realtime feeds
  • Acknowledgement of Metro as the provider; the terms bar use inside advertisements
Authentication
A free Swiftly API key, requested through the form linked from Metro's Real Time APIs page, for the GTFS-realtime feeds. The Bus Cancellations endpoints and the GTFS files need no key.

Limits

  • The cancellations feed lists scheduled cancellations only, such as operator call-outs; a bus that breaks down mid-trip does not appear
  • Lines run by contracted services are excluded from cancellations: 96, 125, 128, 130, 167, 177, 205, 218, 232, 256, 266, 501, 577, 603, 605
  • The cancellations API is beta; Metro says its URLs and field names may change
  • Polling faster than 5 seconds for positions or 10 seconds for trip updates gives limited value; Metro does not guarantee accuracy or timeliness

Access and pricing

Reference listing. Public feed access is separate from Fibric integration. If you request this feed, your quote covers the build, usage, and support.

Request LA Metro Real Time API ↗

Questions and answers

Where does the API key come from?
From Swiftly, not from Metro. Metro's Real Time APIs page links Swiftly's API Key Request Form and Swiftly's API documentation; endpoint paths and the key header are defined there. The Bus Cancellations endpoints and the GTFS downloads answer without a key.
How often does each feed update?
Vehicle Positions every 5 seconds and Trip Updates every 10 seconds, per Metro. Bus cancellations refresh roughly every 5 minutes. Rail GTFS updates daily, Tuesday to Saturday mornings; the bus GTFS weekly-updated-service branch updates weekly, and Metro runs major shake-ups in June and December.
Does the cancellations feed list every cancelled bus?
No. It covers scheduled cancellations only, for example when an operator calls out sick and the assigned trips are dropped. Unplanned events such as breakdowns are not included, and lines run by contracted services are excluded.
Ask about LA Metro Real Time API

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.