LTA Data Mall API User Guide

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 27

DataMall @
an LTA Open Data Initiative
API User Guide
& Documentation
Version 4.0
28 Jul 2017
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
2
Document Change Log
Version
No.
Change Details
Release Date
1.1
First release of document, reflecting specifications for each dataset.
04 Jun 2014
1.2
Amended attributes for all datasets, and added the update frequency for
each dataset in specification section.
15 Jun 2014
1.3
Inserted notes to denote fields that are new and upcoming; not yet
available on the data feed.
26 Jun 2014
1.4
Minor revisions (typo errors).
10 Mar 2015
1.5
Revisions to names of datasets, and removed listing for certain attributes
that are redundant at this point.
07 Apr 2015
2.0
Revised document for newly revamped DataMall.
- New Categorisation of Datasets
- Moved Park & Ride Location, Premium Bus Service, and Carpark Rates
to Static Datasets listed on MyTransport.SG.
13 Apr 2015
2.1
Corrected reference notes for Carpark Availability and ERP Rates.
14 Apr 2015
2.2
2.2.1
Added Bus Arrival, and Taxi Availability APIs
Amended Update Freqs for Bus Arrival and Taxi Availability
19 Apr 2015
03 Jun 2015
3.0
Bus Arrival API is now enhanced! Latest *beta* release includes:
- Additional 3rd set of ETA information
- Estimated location (coordinates) of buses
Look out for blue-highlights!
12 Dec 2015
3.1
Public-Transport (Bus) Related APIs are enhanced (version 2)!
- Bus Services and Bus Routes are now consolidated across
Operators, e.g. SBST routes and SMRT routes in 1 single API
- Attributes are renamed to be more meaningful
- Bus Stops now include location (lat/long) coordinates
Bug for Bus Arrival #VisitNumber fixed.
08 Mar 2016
3.2
Changes to Traffic Related APIs:
- URLs changed to point to version 2 of the APIs.
- VCCType renamed to VehicleType (ERP Rates)
- EstimatedTime renamed to EstTime (Estimated Travel Times)
- RoadID renamed to EventID (Road Openings and Road Works)
- ImageURL renamed to ImageLink (Traffic Images)
- Band renamed to SpeedBand (Traffic Speed Bands)
31 Mar 2016
3.3
Changes to API Response Size:
- Taxi Availability API now returns 500 records per call.
- Traffic Images API now returns 70 records per call.
- Changes are reflected on Page 5, and on respective API URLs.
08 Aug 2016
3.4
Changes to API authentication now requiring only AccountKey.
01 Nov 2016
3.5
Updated attribute description for location coordinates of Bus Arrival
API.
23 Nov 2016
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
3
3.6
Traffic Images API now returns all records per call.
14 Dec 2016
3.7
Updated guide to making API calls, using Postman.
05 Apr 2017
4.0
Bus Arrival API is now enhanced! Latest release includes:
- New Attribute Bus Type
- Inclusion of Short Working Trip (SWT) Supplementary Services
- Relegation of OriginCode and DestinationCode to vehicle level
- Removal of entire response structure from API during non-
operating hours
- Removal of Status Attribute
- Renaming of values for Load Attribute
- Renaming of SubsequentBus and SubsequentBus3 subset tags
- Renaming of BusStopID Parameter to BusStopCode
- Removal of SST Parameter. Timestamps are now in SST by default.
- Rehashed advisement on Front-End Implementation for clarity.
28 Jul 2017
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
4
TABLE OF CONTENTS
1. MAKING API CALLS ...................................................................................................................... 5
2. API DOCUMENTATION ................................................................................................................ 8
2.1 BUS ARRIVAL ......................................................................................................................... 9
2.2 BUS SERVICES ...................................................................................................................... 14
2.3 BUS ROUTES ........................................................................................................................ 15
2.4 BUS STOPS ........................................................................................................................... 16
2.5 TAXI AVAILABILITY .............................................................................................................. 17
2.6 CARPARK AVAILABILITY ..................................................................................................... 18
2.7 ERP RATES ............................................................................................................................ 19
2.8 ESTIMATED TRAVEL TIMES ................................................................................................ 20
2.9 FAULTY TRAFFIC LIGHTS .................................................................................................... 21
2.10 ROAD OPENINGS................................................................................................................ 22
2.11 ROAD WORKS ..................................................................................................................... 23
2.12 TRAFFIC IMAGES ................................................................................................................. 24
2.13 TRAFFIC INCIDENTS ........................................................................................................... 25
2.14 TRAFFIC SPEED BANDS ...................................................................................................... 26
2.15 VMS / EMAS ........................................................................................................................ 27
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
5
1. MAKING API CALLS
API calls need to be made programmatically in regular intervals to obtain the constant stream
of data for your respective development or research needs. For illustration purposes, the API
call below is being made via a third-party application Postman.
Steps to making an API call:
1. Download and install the Postman from https://www.getpostman.com/. Fire it up!
2. Make sure Http method is set to GET.
3. Enter the URL (refer to subsequent pages in this document) in the field request URL.
4. Enter your AccountKey under Headers.
5. (OPTIONAL STEP) The “accept” header allows you to specify the response format of
your API call. Default is JSON. Specify “application/atom+xml for XML.
6. Click on the Send button.
Figure 2-1
Figure 2-2 on the next page shows the JSON response of an API call made for the Traffic
Incidents dataset.
2
3
5
6
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
6
Figure 2-2: API (JSON) Response as shown on Postman.
With the exception of the following 3 APIs listed below (see Table 1), API responses returned
are limited to 50 records of the dataset per call. To retrieve subsequent records of the dataset,
you need to append the $skip operator to the API call (URL).
For example, to retrieve the next 50 records (51st to the 100th), the API call should be:
http://datamall2.mytransport.sg/ltaodataservice/TrafficIncidents?$skip=50
To retrieve the following set of 50 records, append ?$skip=100’, and so on. Just remember,
each URL call returns only a max of 50 records!
API
Response Size
Bus Arrival
N.A. Depends on parameter supplied.
Taxi Availability
500
Traffic Images
All records
Table 1: API Response Size
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
7
Here’s an example of how you can retrieve the data programmatically. This example is coded
in Python 2.7. As mentioned previously, this API call only returns the first 50 records.
import json
import urllib
from urlparse import urlparse
import httplib2 as http #External library
if __name__=="__main__":
#Authentication parameters
headers = { 'AccountKey' : '6HsAmP1e0R/EkEYWOcjKg==',
'accept' : 'application/json'} #this is by default
#API parameters
uri = 'http://datamall2.mytransport.sg/' #Resource URL
path = '/ltaodataservice/TrafficIncidents?'
#Build query string & specify type of API call
target = urlparse(uri + path)
print target.geturl()
method = 'GET'
body = ''
#Get handle to http
h = http.Http()
#Obtain results
response, content = h.request(
target.geturl(),
method,
body,
headers)
#Parse JSON to print
jsonObj = json.loads(content)
print json.dumps(jsonObj, sort_keys=True, indent=4)
#Save result to file
with open("traffic_incidents.json","w") as outfile:
#Saving jsonObj["d"]
json.dump(jsonObj, outfile, sort_keys=True, indent=4,
ensure_ascii=False)
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
8
2. API DOCUMENTATION
The following lists all real-time / dynamic datasets that are refreshed at regular intervals and
served out via APIs. Specification for each API can be found in the rest of this document.
Note: any attributes not specified in this document but found on the data feed, should be ignored.
Public-Transport Related (Total 5)
Description
1
Bus Arrival
Returns real-time Bus Arrival information for Bus Services at a
queried Bus Stop, including: Estimated Time of Arrival (ETA),
Estimated Location, Load info (i.e. how crowded the bus is).
2
Bus Services
Returns detailed service information for all buses currently in
operation, including:
first stop, last stop, peak / offpeak frequency of dispatch.
3
Bus Routes
Returns detailed route information for all services currently in
operation, including:
all bus stops along each route, first/last bus timings for each stop.
4
Bus Stops
Returns detailed information for all bus stops currently being
serviced by buses, including: Bus Stop Code, location coordinates.
5
Taxi Availability
Returns location coordinates of all Taxis that are currently available
for hire. Does not include "Hired" or "Busy" Taxis.
Traffic Related (Total 10)
Description
6
Carpark Availability
Returns no. of available lots for carparks in major shopping malls
and developments within Orchard, Marina, HarbourFront, Jurong
Lake District.
7
ERP Rates
Returns ERP rates of all vehicle types across all timings for each
zone.
8
Estimated Travel Times
Returns estimated travel times of expressways (in segments).
9
Faulty Traffic Lights
Returns alerts of traffic lights that are currently faulty, or currently
undergoing scheduled maintenance.
10
Road Openings
Returns all planned road openings.
11
Road Works
Returns all road works being / to be carried out.
12
Traffic Images
Returns links to images of live traffic conditions along expressways
and Woodlands & Tuas Checkpoints.
13
Traffic Incidents
Returns incidents currently happening on the roads, such as
Accidents, Vehicle Breakdowns, Road Blocks, Traffic Diversions etc.
14
Traffic Speed Bands
Returns current traffic speeds on expressways and arterial roads,
expressed in speed bands.
15
VMS / EMAS
Returns traffic advisories (via variable message services) concerning
current traffic conditions that are displayed on EMAS signboards
along expressways and arterial roads.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
9
2.1 BUS ARRIVAL
URL
http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2
Description
Returns real-time Bus Arrival information of Bus Services at a queried Bus
Stop, including Est. Arrival Time, Est. Current Location, Est. Current Load.
Update Freq
1 minute
Request
Parameters
Description
Mandatory
Example
BusStopCode
Bus stop reference code
Yes
83139
ServiceNo
Bus service number
No
15
Response
Attributes
Description
Example
ServiceNo
Bus service number
15
Operator
Public Transport Operator Codes:
SBST (for SBS Transit)
SMRT (for SMRT Corporation)
TTS (for Tower Transit Singapore)
GAS (for Go Ahead Singapore)
GAS
NextBus
Structural tags for all bus level attributes^ of the next 3 oncoming buses.
Note that if there is only one last bus left on the roads (e.g. at night),
attributes values in NextBus2 and NextBus3 will be empty / blank.
NextBus2
NextBus3
^ OriginCode
Reference code of the first bus stop where
this bus started its service
77009
^ DestinationCode
Reference code of the last bus stop where
this bus will terminate its service
77131
^ EstimatedArrival
Date-time of this bus’ estimated time of
arrival, expressed in the UTC standard,
GMT+8 for Singapore Standard Time (SST)
2017-04-29T07:20:24+08:00
^ Latitude
Current estimated location coordinates of
this bus at point of published data
1.42117943692586
^ Longitude
103.831477233098
^ VisitNumber
Ordinal value of the nth visit of this vehicle
at this bus stop; 1=1st visit, 2=2nd visit
1
^ Load
Current bus occupancy / crowding level:
SEA (for Seats Available)
SDA (for Standing Available)
LSD (for Limited Standing)
SEA
^ Feature
Indicates if bus is wheel-chair accessible:
WAB
(empty / blank)
WAB
^ Type
Vehicle type:
SD (for Single Deck)
DD (for Double Deck)
BD (for Bendy)
SD
Please note that Bus Arrival data (i.e. all attribute-value pairs above) will only appear on the API when
the buses are in service (i.e. on the roads). When not in operation, OR when the API service is undergoing
maintenance and temporarily unavailable, there will be no response returned on the API (not even the
attribute tags).Please refer to Advisement Pt. 1 in following section for more.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
10
SAMPLE API CALL & RESPONSE
API Call:
http://datamall2.mytransport.sg/ltaodataservice/BusArrival?BusStopCode=83139
API Response:
{
"odata.metadata":
"http://datamall2.mytransport.sg/ltaodataservice/$metadata#BusArrival/@Element",
"BusStopCode": "83139",
"Services": [
{
"ServiceNo": "15",
"Operator": "GAS",
"NextBus": {
"OriginCode": "77009",
"DestinationCode": "77009",
"EstimatedArrival": "2017-06-05T14:46:27+08:00",
"Latitude": "1.3143508333333334",
"Longitude": "103.906379",
"VisitNumber": "1",
"Load": "SDA",
"Feature": "WAB",
"Type": "SD"
},
"NextBus2": {
"OriginCode": "77009",
"DestinationCode": "77009",
"EstimatedArrival": "2017-06-05T14:57:09+08:00",
"Latitude": "1.334717",
"Longitude": "103.90723483333333",
"VisitNumber": "1",
"Load": "SDA",
"Feature": "WAB"
"Type": "SD"
},
"NextBus3": {
"OriginCode": "77009",
"DestinationCode": "77009",
"EstimatedArrival": "2017-06-05T15:00:20+08:00",
"Latitude": "1.3370036666666667",
"Longitude": "103.913939",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
}
},
{
"ServiceNo": "150",
"Operator": "SBST",
"NextBus": {
"OriginCode": "82009",
"DestinationCode": "82009",
"EstimatedArrival": "2017-06-05T14:54:06+08:00",
"Latitude": "1.319458",
"Longitude": "103.9012405",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
},
"NextBus2": {
"OriginCode": "82009",
"DestinationCode": "82009",
"EstimatedArrival": "2017-06-05T15:04:49+08:00",
"Latitude": "0",
"Longitude": "0",
"VisitNumber": "1",
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
11
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
},
"NextBus3": {
"OriginCode": "82009",
"DestinationCode": "82009",
"EstimatedArrival": "2017-06-05T15:19:49+08:00",
"Latitude": "0",
"Longitude": "0",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
}
},
{
"ServiceNo": "155",
"Operator": "SBST",
"NextBus": {
"OriginCode": "52009",
"DestinationCode": "84009",
"EstimatedArrival": "2017-06-05T14:55:12+08:00",
"Latitude": "1.3184713333333333",
"Longitude": "103.89202066666667",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
},
"NextBus2": {
"OriginCode": "52009",
"DestinationCode": "84009",
"EstimatedArrival": "2017-06-05T15:02:41+08:00",
"Latitude": "1.3186606666666667",
"Longitude": "103.88303666666667",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
},
"NextBus3": {
"OriginCode": "52009",
"DestinationCode": "84009",
"EstimatedArrival": "2017-06-05T15:20:22+08:00",
"Latitude": "1.3360038333333333",
"Longitude": "103.87798466666666",
"VisitNumber": "1",
"Load": "SEA",
"Feature": "WAB"
"Type": "SD"
}
}
]
}
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
12
ADVISEMENT ON FRONT-END IMPLEMENTATION (BUS APPS)
1. [EstimatedArrival] Display of Advisement Messages when there is NO Bus Arrival Data
In the event where data is not available (be it in partial or in full) on the API, you may want to display
some form of ‘status texts’ to advise your app users on what’s going on, as far as bus service
availability is concerned. To do this, you will need to take reference from two data points (1) the
presence or absence of Arrival data itself, and (2) the bus service operating hours at each bus
stop which you need to obtain via the Bus Routes API.
With those two data points gathered, you will arrive at the following possible scenarios:
#
Operation Status
Data Availability
Advisement Message
a.
Bus is in operation
Arrival data is available
(none required)
b.
Bus is in operation
Arrival data is NOT available
No Est. Available
c.
Bus is NOT in operation
Arrival data is NOT available
Not In Operation
d.
Bus is NOT in operation
Arrival data is available
(none required)
For scenarios (b) and (c), you may display advisement messages like those suggested in the table
above, or any other user-friendly and appropriate variants at your discretion.
Next, you should note that Arrival data may be available on the API even when bus services are
supposedly NOT in operation (as per scheduled operating hours) reflected as scenario (d) in the
table above. This happens,
a. before first bus(es) begin their service from Bus Interchanges / Depots in the mornings, and,
b. when last bus(es) at night are running behind schedule; slightly past operating hours.
Therefore, the general logic to be applied, is to always first display the Arrival data if it’s available
on the API, irrespective of the scheduled operating hours. Advisement messages like No Est.
Available and Not In Operation are applicable ONLY when there is no Arrival data on the API.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
13
2. [EstimatedArrival] Rounding of Seconds
All derived bus arrival duration should be rounded down to the nearest minute.
Derived duration: 3:49 mins
Display duration: “3 min”
Derived duration: 2:07 mins
Display duration: “2 min”
Derived duration: 1:59 mins
Display duration: “1 min”
Derived duration: 0:59 mins
Display duration: “Arr”
3. [Load] Colour Scheme Adoption
You may adopt this colour scheme to serve as visual indicators for the various loading values:
- [Green] Seats Available
- [Amber] Standing Available
- [Red] Limited Standing
You are given the flexibility for the manner in which you display the colours, i.e. colour bars, coloured
timings, and accompanied with legends where appropriate and/or necessary.
4. [Feature] Wheelchair Accessible Buses
You are given the flexibility to display any symbols or labels to denote oncoming buses that
are wheelchair accessible.
ADDITIONAL NOTE ON LOOP SERVICES THAT RUNS BOTH DIRECTIONS
Please note that some Loop Services are appended with ‘G’ or ‘W’ to denote their direction of travel.
You should account for and display these services individually 225G, 225W, 243G, 243W, 410G, 410W.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
14
2.2 BUS SERVICES
URL
http://datamall2.mytransport.sg/ltaodataservice/BusServices
Description
Returns detailed service information for all buses currently in
operation, including: first stop, last stop, peak / offpeak frequency of
dispatch.
Update Freq
Ad-Hoc
Response
Attributes
Description
Sample
ServiceNo
The bus service number
107M
Operator
Operator for this bus service
SBST
Direction
The direction in which the bus travels
(1 or 2), loop services only have 1
direction
1
Category
Category of the SBS bus service:
EXPRESS, FEEDER, INDUSTRIAL,
TOWNLINK, TRUNK, 2 TIER FLAT FEE,
FLAT FEE $1.10 (or $1.90, $3.50, $3.80)
TRUNK
OriginCode
Bus stop code for first bus stop
64009
DestinationCode
Bus stop code for last bus stop
(similar as first stop for loop services)
64009
AM_Peak_Freq
Freq of dispatch for AM Peak
0630H - 0830H (range in minutes)
14-17
AM_Offpeak_Freq
Freq of dispatch for AM Off-Peak
0831H - 1659H (range in minutes)
10-16
PM_Peak_Freq
Freq of dispatch for PM Peak
1700H - 1900H (range in minutes)
12-15
PM_Offpeak_Freq
Freq of dispatch for PM Off-Peak
after 1900H (range in minutes)
12-15
LoopDesc
Location at which the bus service
loops, empty if not a loop service.
Raffles Blvd
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
15
2.3 BUS ROUTES
URL
http://datamall2.mytransport.sg/ltaodataservice/BusRoutes
Description
Returns detailed route information for all services currently in operation,
including: all bus stops along each route, first/last bus timings for each stop.
Update Freq
Ad-Hoc
Response
Attributes
Description
Sample
ServiceNo
The bus service number
107M
Operator
Operator for this bus service
SBST
Direction
The direction in which the bus travels
(1 or 2), loop services only have 1
direction
1
StopSequence
The i-th bus stop for this route
28
BusStopCode
The unique 5-digit identifier for this
physical bus stop
01219
Distance
Distance travelled by bus from starting
location to this bus stop (in kilometres)
10.3
WD_FirstBus
Scheduled arrival of first bus on weekdays
2025
WD_LastBus
Scheduled arrival of last bus on weekdays
2352
SAT_FirstBus
Scheduled arrival of first bus on Saturdays
1427
SAT_LastBus
Scheduled arrival of last bus on Saturdays
2349
SUN_FirstBus
Scheduled arrival of first bus on Sundays
0620
SUN_LastBus
Scheduled arrival of last bus on Sundays
2349
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
16
2.4 BUS STOPS
URL
http://datamall2.mytransport.sg/ltaodataservice/BusStops
Description
Returns detailed information for all bus stops currently being serviced by
buses, including: Bus Stop Code, location coordinates.
Update Freq
Ad-Hoc
Response
Attributes
Description
Sample
BusStopCode
The unique 5-digit identifier for this
physical bus stop
01012
RoadName
The road on which this bus stop is
located
Victoria St
Description
Landmarks next to the bus stop (if
any) to aid in identifying this bus stop
Hotel Grand Pacific
Latitude
Location coordinates for this bus stop
1.29685
Longitude
103.853
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
17
2.5 TAXI AVAILABILITY
URL
http://datamall2.mytransport.sg/ltaodataservice/Taxi-Availability
Description
Returns location coordinates of all Taxis that are currently available for
hire. Does not include "Hired" or "Busy" Taxis.
Update Freq
1 min
Response
Attributes
Description
Sample
Latitude
Latitude location coordinates.
1.35667
Longitude
Longitude location coordinates.
103.93314
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
18
2.6 CARPARK AVAILABILITY
URL
http://datamall2.mytransport.sg/ltaodataservice/CarParkAvailability
Description
Returns no. of available lots for carparks in major shopping malls
and developments within Orchard, Marina, HarbourFront, Jurong
Lake District.
(Note: list of carparks available on this API is subset of those listed on
One.Motoring and MyTransport Portals)
Update Freq
1 minute
Response
Attributes
Description
Sample
CarParkID
A unique code for this carpark
1
Area
Area of development / building:
- Orchard
- Marina
- Harbfront
- JurongLakeDistrict
Marina
Development
Shopping mall or major landmark
where carpark is located
Suntec City
Latitude
Latitude map coordinates.
1.29375
Longitude
Longitude map coordinates.
103.85718
Lots
Number of lots available at point
of data retrieval.
352
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
19
2.7 ERP RATES
URL
http://datamall2.mytransport.sg/ltaodataservice/ERPRates
Description
Returns ERP rates of all vehicle types across all timings for each
zone.
Update Freq
Ad-Hoc
Response
Attributes
Description
Sample
VehicleType
Classification types:
- Passenger Cars
- Motorcycles
- Light Goods Vehicles
- Heavy Goods Vehicles
- Very Heavy Goods Vehicles
- Taxis
Passenger Cars/Light Goods
Vehicles/Taxis
DayType
Available types:
- Weekdays
- Saturdays
Weekdays
StartTime
Start time for this ERP rate
08:00
EndTime
End time for this ERP rate
08:05
ZoneID
Zone for this ERP rate
AY1
ChargeAmount
Chargeable amount
0.5
EffectiveDate
Rate is effective as of this date
(in YYYY-MM-DD format)
2016-02-01
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
20
2.8 ESTIMATED TRAVEL TIMES
URL
http://datamall2.mytransport.sg/ltaodataservice/EstTravelTimes
Description
Returns estimated travel times of expressways (in segments).
Update Freq
5 minutes
Response
Attributes
Description
Sample
Name
Expressway
AYE
Direction
Direction of travel:
1 Travelling from east to west,
or south to north.
2 Travelling from west to east,
or north to south.
1
FarEndPoint
The final end point of this whole
expressway in current direction
of travel
TUAS CHECKPOINT
StartPoint
Start point of this current
segment
AYE/MCE INTERCHANGE
EndPoint
End point of this current
segment
TELOK BLANGAH RD
EstTime
Estimated travel time in minutes
2
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
21
2.9 FAULTY TRAFFIC LIGHTS
URL
http://datamall2.mytransport.sg/ltaodataservice/FaultyTrafficLights
Description
Returns alerts of traffic lights that are currently faulty, or currently
undergoing scheduled maintenance.
Update Freq
2 minutes whenever there are updates
Response
Attributes
Description
Sample
AlarmID
Technical alarm ID
GL703034136
NodeID
A unique code to represent each
unique traffic light node
703034136
Type
Type of the technical alarm
- 4 (Blackout)
- 13 (Flashing Yellow)
13
StartDate
YYYY-MM-DD HH:MM:SS.ms
2014-04-12 01:58:00.0
EndDate
YYYY-MM-DD HH:MM:SS.ms
(empty field if this is not a
scheduled maintenance)
Message
Canning Message
(23/1)8:58 Flashing Yellow at
Bedok North Interchange/Bedok
North Street 1 Junc.
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
22
2.10 ROAD OPENINGS
URL
http://datamall2.mytransport.sg/ltaodataservice/RoadOpenings
Description
Returns all planned road openings.
Update Freq
24 hours whenever there are updates
Response
Attributes
Description
Sample
EventID
ID for this road opening event
RMAPP-201603-0900
StartDate
Start date for works to be
performed for this road opening
(in YYYY-MM-DD format)
2016-03-31
EndDate
End date for works to be
performed for this road opening
(in YYYY-MM-DD format)
2016-09-30
SvcDept
Department or company
performing this road work
SP POWERGRID LTD - CUSTOMER
PROJ (EAST)
RoadName
Name of new road to be opened
AH SOO GARDEN
Other
Additional information or
messages
For details, please call 62409237
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
23
2.11 ROAD WORKS
URL
http://datamall2.mytransport.sg/ltaodataservice/RoadWorks
Description
Returns all road works being / to be carried out.
Update Freq
24 hours whenever there are updates
Response
Attributes
Description
Sample
EventID
ID for this road work
RMAPP-201512-0217
StartDate
Start date for the works
performed for this road work
(in YYYY-MM-DD format)
2015-12-14
EndDate
End date for works performed
for this road work
(in YYYY-MM-DD format)
2016-07-31
SvcDept
Department or company
performing this road work
SP POWERGRID LTD - REGIONAL
NETWORK CENTRAL
RoadName
Name of road where work is
being performed.
ADAM DRIVE
Other
Additional information or
messages.
For details, please call 67273085
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
24
2.12 TRAFFIC IMAGES
URL
http://datamall2.mytransport.sg/ltaodataservice/Traffic-Images
Description
Returns links to images of live traffic conditions along expressways and
Woodlands & Tuas Checkpoints.
Update Freq
1 to 5 minutes
Response
Attributes
Description
Sample
CameraID
A unique ID for this
camera
5795
Latitude
Latitude map
coordinates
1.326024822
Longitude
Longitude map
coordinates
103.905625
ImageLink
Link for
downloading this
image.
https://s3-ap-southeast-
1.amazonaws.com/mtpdm/2016-03-29/18-
32/5795_1822_20160329182706_c3e176.jpg
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
25
2.13 TRAFFIC INCIDENTS
URL
http://datamall2.mytransport.sg/ltaodataservice/TrafficIncidents
Description
Returns incidents currently happening on the roads, such as
Accidents, Vehicle Breakdowns, Road Blocks, Traffic Diversions etc.
Update Freq
2 minutes whenever there are updates
Response
Attributes
Description
Sample
Type
Incident Types:
- Accident
- Road Works
- Vehicle Breakdown
- Weather
- Obstacle
- Road Block
- Heavy Traffic
- Misc.
- Diversion
- Unattended Vehicle
Vehicle Breakdown
Latitude
Latitude map coordinates for the
start point of this road incident
1.30398068448214
Longitude
Longitude map coordinates for
the start point of this incident
103.919182834377
Message
Description message for this
incident
(29/3)18:22 Vehicle breakdown on
ECP (towards Changi Airport) after
Still Rd Sth Exit. Avoid lane 3.
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
26
2.14 TRAFFIC SPEED BANDS
URL
http://datamall2.mytransport.sg/ltaodataservice/TrafficSpeedBands
Description
Returns current traffic speeds on expressways and arterial roads,
expressed in speed bands.
Update Freq
5 minutes
Response
Attributes
Description
Sample
LinkID
Unique ID for this stretch of road
103046935
RoadName
Road Name
SERANGOON ROAD
RoadCategory
A Expressways
B Major Arterial Roads
C Arterial Roads
D Minor Arterial Roads
E Small Roads
F Slip Roads
G No category info available
B
SpeedBand
Speed Band Information. Total: 4
1 indicates speed range from 0 < 20
2 indicates speed range from 20 < 40
3 indicates speed range from 40 < 60
4 indicates speed range > 60
2
MinimumSpeed
Minimum speed in KM/H
20
MaximumSpeed
Maximum speed in KM/H
39
Location
Latitude and Longitude map
coordinates for start and end
points for this stretch of road.
1.3220591510051254
103.86246461405193
1.3215993547809128
103.86315591911669
Note: any attributes not specified above but found on the data feed, should be ignored.
LTA DataMall | API User Guide & Documentation
Version 4.0 (28 Jul 2017)
27
2.15 VMS / EMAS
URL
http://datamall2.mytransport.sg/ltaodataservice/VMS
Description
Returns traffic advisories (via variable message services) concerning
current traffic conditions that are displayed on EMAS signboards
along expressways and arterial roads.
Update Freq
2 minutes
Response
Attributes
Description
Sample
EquipmentID
EMAS equipment ID
amvms_v9104
Latitude
Latitude map coordinates of
electronic signboard.
1.3927176306916775
Longitude
Longitude map coordinates of
electronic signboard.
103.82618266340947
Message
Variable Message being
displayed on the EMAS display.
VEH BREAKDOWN SH,AFT
U.THOMSON
Note: any attributes not specified above but found on the data feed, should be ignored.

Navigation menu