Overview

Transport for Los Angeles, US (LA Metro) offers a developer portal providing programmatic access to public transportation data for the Los Angeles region. Established in 1993, LA Metro's developer resources are designed to facilitate the creation of applications that enhance rider experience, improve transit efficiency, and support urban planning initiatives. The core offerings include the General Transit Feed Specification (GTFS) Realtime API and GTFS Static Data, which are foundational for developers aiming to integrate LA Metro information into their projects. These resources are particularly well-suited for applications requiring real-time vehicle locations, service alerts, and detailed schedule information, enabling developers to build tools for real-time transit tracking, predictive arrival times, and interactive route mapping.

Developers can access comprehensive documentation on the Metro API overview page, which details the available endpoints, data formats, and authentication methods. The GTFS Realtime API provides live updates on bus and rail operations, including vehicle positions, service alerts, and trip updates, allowing applications to display dynamic information to users. For instance, a mobile application could use this API to show a user exactly where their bus is on a map and provide an estimated arrival time based on current traffic and vehicle speed. The GTFS Static Data, conversely, offers fixed schedule information, route definitions, stop locations, and fare structures, which are essential for planning tools and historical analysis.

The platform caters to a broad audience, from individual developers creating personal transit tools to established companies building commercial applications that rely on accurate public transport data. Its utility extends to urban planners, researchers, and data scientists who can leverage the comprehensive datasets for analytical purposes, such as studying ridership patterns or evaluating service performance. The availability of data through a free tier encourages innovation and broad adoption, supporting the development of a diverse ecosystem of transit-related applications within Los Angeles. The developer experience is supported by example requests in popular programming languages, simplifying the integration process for new users.

Key features

  • GTFS Realtime API: Provides real-time updates on LA Metro bus and rail services, including vehicle positions, trip updates (delays, cancellations), and service alerts (GTFS Realtime API documentation). This feed is critical for applications requiring dynamic, up-to-the-minute transit information.
  • GTFS Static Data: Offers comprehensive static data for LA Metro's entire system, including routes, stops, schedules, and fare information. This dataset is fundamental for route planning and displaying fixed transit information.
  • API Key Authentication: Secures access to the APIs, requiring developers to obtain and use an API key for all requests. This process helps manage usage and ensures data integrity.
  • Developer Portal: A centralized hub for documentation, API overviews, and resources to assist developers in integrating LA Metro data into their applications (LA Metro Developer Portal).
  • Example Code Snippets: Provides practical examples in JavaScript, Python, and cURL, illustrating how to make API requests and parse responses, accelerating the development process.

Pricing

Access to the Transport for Los Angeles, US APIs is provided free of charge. This allows developers to integrate real-time and static LA Metro data into their applications without incurring direct costs from the provider.

Service Cost Details As-of Date
GTFS Realtime API Access Free Full access to real-time vehicle positions, trip updates, and service alerts. 2026-05-28
GTFS Static Data Access Free Full access to static route, stop, schedule, and fare information. 2026-05-28

For more details on terms of use for the free access, consult the LA Metro Developer Terms of Use.

Common integrations

  • Mapping Services: Integration with mapping platforms like Google Maps Platform to visualize real-time vehicle locations and plan routes using LA Metro data. Developers can overlay transit lines and stop markers directly onto interactive maps.
  • Mobile Applications: Used in iOS and Android applications to provide users with real-time bus and train arrival predictions, service alerts, and personalized trip planning.
  • Data Visualization Tools: Connecting with business intelligence tools or custom dashboards to analyze transit performance, ridership trends, and service reliability using historical GTFS Static Data.
  • Smart City Platforms: Incorporating LA Metro data into broader urban management systems to monitor public transport efficacy and contribute to traffic management strategies.
  • Alert and Notification Systems: Building systems that send push notifications or SMS alerts to users regarding service disruptions, delays, or specific route changes, leveraging the GTFS Realtime API's service alert feature.

Alternatives

  • Open Transit Data: Many cities worldwide offer similar GTFS feeds for public transit systems, such as those available for New York City MTA or San Francisco Muni, providing comparable data structures for different geographies.
  • HERE Technologies: Offers a suite of location-based services, including public transport APIs that can provide route planning and real-time data for various global cities, often with commercial licensing models.
  • Mapbox: Provides tools for custom mapping and location data, allowing developers to build their own transit data visualizations, often requiring integration with external GTFS feeds.
  • Transit App: A consumer-facing application that aggregates transit data from multiple agencies globally, offering an existing solution for users rather than a developer API.
  • Citymapper: Another popular consumer app providing multimodal transport planning and real-time data, drawing from various public and private transit sources.

Getting started

To begin using the Transport for Los Angeles, US APIs, developers first need to register for an API key on the LA Metro Developer Portal registration page. Once registered and logged in, an API key will be provided for authenticating requests to the GTFS Realtime and GTFS Static endpoints. The following Python example demonstrates how to fetch GTFS Realtime data, specifically trip updates, from the LA Metro API using a developer's API key. This script makes a GET request to the specified endpoint and prints the raw Protobuf response, which can then be parsed using the appropriate GTFS Realtime libraries.

import requests

API_KEY = 'YOUR_API_KEY' # Replace with your actual API key
GTFS_REALTIME_ENDPOINT = 'https://api.metro.net/agencies/lametro-rail/gtfs-rt/trip-updates/'

headers = {
    'Authorization': f'apikey {API_KEY}'
}

try:
    response = requests.get(GTFS_REALTIME_ENDPOINT, headers=headers)
    response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)

    # GTFS Realtime data is typically in Protobuf format
    # For parsing, you would use a library like 'gtfs_realtime_pb2'
    # For this example, we'll just print a confirmation of success
    print(f"Successfully fetched GTFS Realtime data. Status code: {response.status_code}")
    print("Response content (first 200 bytes):", response.content[:200])

except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
except requests.exceptions.ConnectionError as conn_err:
    print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
    print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
    print(f"An unexpected error occurred: {req_err}")

Before running this code, ensure you have the requests library installed (pip install requests). For actual parsing of the GTFS Realtime Protobuf data, you would typically use the gtfs_realtime_pb2 module generated from the GTFS Realtime Protocol Buffer specification. This involves downloading the .proto file and compiling it into Python code. The LA Metro developer portal also provides example requests for other endpoints and data types, offering further guidance on different API interactions.