Overview
The Land Transport Authority (LTA) DataMall serves as a central repository for public transport and traffic data within Singapore, offering a suite of APIs designed for developers, researchers, and urban planners. Established in 1995, the LTA aims to develop and maintain Singapore's land transport system. The DataMall extends this mission by making operational data accessible, fostering innovation in areas such as real-time travel information, traffic management, and smart city applications. Developers can access critical datasets, including live bus arrival times, real-time traffic incident reports, current carpark availability across various locations, and taxi availability information.
The platform is particularly suited for applications requiring dynamic data feeds to enhance user experience or inform operational decisions. For instance, developers can create mobile applications that provide commuters with precise bus arrival predictions or integrate traffic incident data into navigation systems to suggest alternative routes. Urban planners and researchers can utilize historical and real-time data to analyze traffic patterns, assess the impact of new infrastructure, or model future transport demands. The LTA DataMall also supports the development of solutions for route optimization, assisting logistics companies and ride-sharing services in improving efficiency within Singapore's urban environment.
Access to the LTA DataMall APIs requires registration to obtain API keys, which helps manage usage and ensures compliance with the Personal Data Protection Act (PDPA). The developer resources page provides comprehensive documentation, including detailed API references, sample requests, and data schemas, to facilitate integration. This structured approach aims to lower the barrier to entry for developers while maintaining data integrity and security. By providing these resources, the LTA encourages the creation of innovative solutions that benefit both residents and visitors by improving transport efficiency and information dissemination across Singapore's land transport network.
Key features
- Bus Arrival API: Provides real-time estimated arrival times for buses at specific bus stops, including information on subsequent buses. This allows for the development of dynamic public transport information systems and mobile applications.
- Traffic Incidents API: Delivers up-to-date information on traffic incidents, road closures, and diversions across Singapore's road network. Useful for navigation apps and traffic monitoring dashboards.
- Real-time Carpark Availability API: Offers current availability status for carparks island-wide, including the number of vacant lots. This supports applications that help drivers locate available parking spaces efficiently.
- Taxi Availability API: Supplies data on the availability of taxis at various locations, assisting in the development of ride-hailing and taxi booking services.
- Train Service Alert API: Provides alerts regarding disruptions, delays, or early closures of train services, enabling commuters to stay informed about potential impacts on their journeys.
- Road Network API: Offers static data about Singapore's road network, including road names and geographical coordinates, which can be used for mapping and routing applications.
- Traffic Images API: Provides access to live images from traffic cameras positioned at key locations across Singapore, offering visual confirmation of real-time traffic conditions.
- ERP Rates API: Delivers information on Electronic Road Pricing (ERP) rates at various gantries, helping drivers plan routes to manage toll costs.
Pricing
The Land Transport Authority DataMall APIs are provided free of charge for all users. There are no subscription fees, usage-based charges, or tiered pricing models as of 2026-05-28. Developers can register and obtain API keys without incurring costs to access the available datasets.
| Service Tier | Features | Cost |
|---|---|---|
| All APIs | Access to all available LTA DataMall APIs, real-time data, full documentation, developer support. | Free |
For more details on API access and terms of use, refer to the official LTA DataMall developer resources.
Common integrations
- Mapping and Navigation Applications: Integrating LTA DataMall APIs with mapping platforms like Google Maps Platform allows developers to overlay real-time traffic conditions, bus routes, and carpark availability directly onto maps. This enhances user experience by providing comprehensive travel information within a single interface.
- Public Transport Information Displays: Digital signage systems at bus stops, train stations, or public venues can integrate the Bus Arrival API and Train Service Alert API to provide real-time updates to commuters.
- Smart City Dashboards: Urban management platforms can integrate various LTA DataMall APIs to create comprehensive dashboards for monitoring traffic flow, public transport performance, and urban mobility trends.
- Route Planning Tools: Logistics companies and ride-sharing services can integrate Traffic Incidents API and Road Network API into their route optimization algorithms to account for real-time road conditions and reduce travel times.
- Mobile Applications for Commuters: Developers can build dedicated mobile apps that consolidate information from multiple LTA DataMall APIs, offering features like personalized journey planning, real-time alerts, and carpark availability searches.
- Academic and Research Projects: Universities and research institutions often integrate LTA DataMall APIs into their studies on urban mobility, traffic engineering, and smart transportation systems, utilizing the data for simulations and analytical models.
Alternatives
- Moovit API: Offers global public transport data and journey planning capabilities, suitable for applications requiring international coverage and multimodal routing.
- Google Maps Platform: Provides a comprehensive suite of mapping, routing, and location-based services, including real-time traffic and public transit data for many regions worldwide.
- HERE Technologies: Specializes in location data and technology, offering APIs for mapping, routing, traffic, and public transport, with a focus on enterprise solutions and automotive applications.
Getting started
To begin using the LTA DataMall APIs, developers must first register for an account and obtain an API key from the official LTA DataMall developer resources page. Once registered, the API key is used to authenticate requests. The following example demonstrates how to fetch bus arrival times using a simple Python script and the requests library. This example targets the Bus Arrival API, which is one of the most frequently used services.
First, ensure you have the requests library installed:
pip install requests
Next, replace YOUR_API_KEY with your actual API key and BUS_STOP_CODE with the 5-digit code of the bus stop you wish to query (e.g., '83139' for a bus stop in Singapore). The BusStopCode parameter is mandatory for the Bus Arrival API.
import requests
import json
API_KEY = 'YOUR_API_KEY' # Replace with your actual API key
BUS_STOP_CODE = '83139' # Example: Bus stop code for 'Opp Blk 429' along Ang Mo Kio Ave 3
# LTA DataMall Bus Arrival API endpoint
url = f"http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2?BusStopCode={BUS_STOP_CODE}"
headers = {
'AccountKey': API_KEY,
'accept': 'application/json'
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
data = response.json()
if data and data.get('value'):
print(f"Bus Arrival Information for Bus Stop Code: {BUS_STOP_CODE}")
for bus_service in data['value']:
service_no = bus_service.get('ServiceNo', 'N/A')
next_bus_arrival = bus_service.get('NextBus', {}).get('EstimatedArrival', 'N/A')
next_bus_load = bus_service.get('NextBus', {}).get('Load', 'N/A')
next_bus_feature = bus_service.get('NextBus', {}).get('Feature', 'N/A')
print(f" Service: {service_no}")
print(f" Next Bus Arrival: {next_bus_arrival}")
print(f" Load: {next_bus_load} (S = Standing, SD = Seating, L = Limited Standing)")
print(f" Feature: {next_bus_feature} (WAB = Wheelchair Accessible Bus)")
# You can also get info for NextBus2 and NextBus3 similarly
# next_bus2_arrival = bus_service.get('NextBus2', {}).get('EstimatedArrival', 'N/A')
# print(f" Next Bus 2 Arrival: {next_bus2_arrival}")
else:
print(f"No bus arrival data found for bus stop code: {BUS_STOP_CODE}")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err} - {response.text}")
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}")
except json.JSONDecodeError:
print(f"Failed to decode JSON from response: {response.text}")
This script sends a GET request to the Bus Arrival API endpoint, including the necessary AccountKey in the headers. It then parses the JSON response and prints the estimated arrival times and other details for each bus service at the specified bus stop. The error handling ensures that network issues or invalid responses are caught gracefully. For a complete list of parameters and response formats, consult the LTA DataMall API documentation.