LTA Data Mall API User Guide
User Manual:
Open the PDF directly: View PDF .
Page Count: 55
Download | |
Open PDF In Browser | View PDF |
LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) DataMall @ an LTA Open Data Initiative API User Guide & Documentation Version 4.9 11 February 2019 Document Change Log LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Version 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 15 Jun 2014 No. each dataset in specification section. 1.3 Inserted notes to denote fields that are new and upcoming; not yet 26 Jun 2014 available on the data feed. 1.4 Minor revisions (typo errors). 10 Mar 2015 1.5 Revisions to names of datasets, and removed listing for certain attributes 07 Apr 2015 that are redundant at this point. 2.0 Revised document for newly revamped DataMall. - New Categorisation of Datasets - Moved Park & Ride Location, Premium Bus Service, and Carpark Rates 13 Apr 2015 to Static Datasets listed on MyTransport.SG. 2.1 Corrected reference notes for Carpark Availability and ERP Rates. 14 Apr 2015 2.2 Added Bus Arrival, and Taxi Availability APIs 19 Apr 2015 2.2.1 Amended Update Freqs for Bus Arrival and Taxi Availability 03 Jun 2015 3.0 Bus Arrival API is now enhanced! Latest *beta* release includes: 12 Dec 2015 - Additional 3rd set of ETA information - Estimated location (coordinates) of buses Look out for blue-highlights! 3.1 Public-Transport (Bus) Related APIs are enhanced (version 2)! - 08 Mar 2016 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. 3.2 3.3 3.4 Changes to Traffic Related APIs: 31 Mar 2016 - 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) Changes to API Response Size: 08 Aug 2016 - Taxi Availability API now returns 500 records per call. - Traffic Images API now returns 70 records per call. - Changes are reflected on Page 6, and on respective API URLs. Changes to API authentication – now requiring only AccountKey. 1 01 Nov 2016 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 3.5 Updated attribute description for location coordinates of Bus Arrival 23 Nov 2016 API. 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: 28 Jul 2017 - 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 nonoperating 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. 4.1 Minor revisions to sample Bus Arrival API response. 08 Sep 2017 4.2 Announcement on Changes to API Response Size is reflected on Page 6. 15 Sep 2017 4.3 Deployment date has postponed for the increase of API Response Size. 06 Oct 2017 Please refer to Page 6 for the latest announcement. 4.4 Response Size for all APIs (except Bus Arrival API) have been increased 16 Oct 2017 to 500 records per call. 4.5 Carpark Availability API is now enhanced! Latest release includes: 22 Jan 2018 - Includes HDB, LTA and URA carpark availability data (Soft released on - New Attribute – Lot Type, Agency - Combined Attribute: Location 31 Dec 2017) (previously Latitude and Longitude attributes) 4.6 New Train Service Alerts API is launched! It returns detailed information 19 Mar 2018 on train service unavailability during scheduled operating hours, such as affected Line and Stations etc. 4.7 4 New Passenger Volume APIs are launched! Aggregated passenger 17 Jul 2018 volume information such as number of trips, tap in and out by weekdays and weekends (inclusive of holidays) are returned. 1. By Bus Stops 2. By Origin-Destination Bus Stops 3. By Origin-Destination Train Stations 4. By Train Stations Sample output for Train Service Alerts API has been changed to Annex C. 4.8 Traffic Speed Band API is now enhanced! Latest release includes: 2 21 Sep 2018 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 4.9 Speeds are classified into 8 bands at 10km/h interval. Bicycle Parking is launched! This API returns the information of bicycle parking locations within a radius. 3 11 Feb 2019 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) TABLE OF CONTENTS 1. MAKING API CALLS ...................................................................................................................... 6 2. API DOCUMENTATION ................................................................................................................ 9 2.1 BUS ARRIVAL ....................................................................................................................... 11 2.2 BUS SERVICES...................................................................................................................... 16 2.3 BUS ROUTES ........................................................................................................................ 17 2.4 BUS STOPS ........................................................................................................................... 18 2.5 PASSENGER VOLUME BY BUS STOPS .............................................................................. 19 2.6 PASSENGER VOLUME BY ORIGIN DESTINATION BUS STOPS ...................................... 20 2.7 PASSENGER VOLUME BY ORIGIN DESTINATION TRAIN STATIONS ........................... 21 2.8 PASSENGER VOLUME BY TRAIN STATIONS .................................................................... 22 2.9 TAXI AVAILABILITY .............................................................................................................. 23 2.10 TRAIN SERVICE ALERTS...................................................................................................... 24 2.11 CARPARK AVAILABILITY ..................................................................................................... 26 2.12 ERP RATES............................................................................................................................ 27 2.13 ESTIMATED TRAVEL TIMES ................................................................................................ 28 2.14 FAULTY TRAFFIC LIGHTS .................................................................................................... 29 2.15 ROAD OPENINGS................................................................................................................ 30 2.16 ROAD WORKS ..................................................................................................................... 31 2.17 TRAFFIC IMAGES ................................................................................................................. 32 2.18 TRAFFIC INCIDENTS ........................................................................................................... 33 2.19 TRAFFIC SPEED BANDS ...................................................................................................... 34 2.20 VMS / EMAS ........................................................................................................................ 35 4 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.21 Bicycle Parking .................................................................................................................... 36 ANNEX A .......................................................................................................................................... 37 ANNEX B .......................................................................................................................................... 38 ANNEX C .......................................................................................................................................... 39 5 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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. 3 2 6 4 5 Figure 2-1 6 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Figure 2-2 below shows the JSON response of an API call made for the Traffic Incidents dataset. Figure 2-2: API (JSON) Response as shown on Postman. With the exception of the following Bus Arrival API listed below (see Table 1), API responses returned are limited to 500 records of the dataset per call. This number may be adjusted from time to time. 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 500 records (501st to the 1000th), the API call should be: http://datamall2.mytransport.sg/ltaodataservice/BusRoutes?$skip=500 To retrieve the following set of 500 records, append ‘?$skip=1000’, and so on. Just remember, each URL call returns only a max of 500 records! API Bus Arrival Train Service Alerts Passenger Volume related Response Size Not Applicable. Depends on parameter supplied. Not Applicable. Depends on the scenario. Returns one record per request. Table 1: API Response Size 7 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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 500 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/BusRoutes?' #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("bus_routes.json","w") as outfile: #Saving jsonObj["d"] json.dump(jsonObj, outfile, sort_keys=True, indent=4, ensure_ascii=False) 8 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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 10) 1 Bus Arrival 2 Bus Services 3 Bus Routes 4 Bus Stops 5 Passenger Volume by Bus Stops 6 7 Passenger Volume by Origin Destination Bus Stops Passenger Volume by Origin Destination Train Stations 8 Passenger Volume by Train Stations 9 Taxi Availability 10 Train Service Alerts Description 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). Returns detailed service information for all buses currently in operation, including: first stop, last stop, peak / offpeak frequency of dispatch. Returns detailed route information for all services currently in operation, including: all bus stops along each route, first/last bus timings for each stop. Returns detailed information for all bus stops currently being serviced by buses, including: Bus Stop Code, location coordinates. Returns tap in and tap out passenger volume by weekdays and weekends for individual bus stop. Returns number of trips by weekdays and weekends from the origin to destination bus stops. Returns number of trips by weekdays and weekends from the origin to destination train stations. Returns tap in and tap out passenger volume by weekdays and weekends for individual train station. Returns location coordinates of all Taxis that are currently available for hire. Does not include "Hired" or "Busy" Taxis. Returns detailed information on train service unavailability during scheduled operating hours, such as affected line and stations etc. Traffic Related (Total 10) Description 11 Carpark Availability Returns no. of available lots for HDB, LTA and URA carpark data. The LTA carpark data consist of major shopping malls and developments within Orchard, Marina, HarbourFront, Jurong Lake District. 12 ERP Rates 13 Estimated Travel Times 14 Faulty Traffic Lights 15 16 Road Openings Road Works 17 Traffic Images Returns ERP rates of all vehicle types across all timings for each zone. Returns estimated travel times of expressways (in segments). Returns alerts of traffic lights that are currently faulty, or currently undergoing scheduled maintenance. Returns all planned road openings. Returns all road works being / to be carried out. Returns links to images of live traffic conditions along expressways and Woodlands & Tuas Checkpoints. 9 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Traffic Related (Total 10) 18 Traffic Incidents 19 Traffic Speed Bands 20 VMS / EMAS 21 Description Returns incidents currently happening on the roads, such as Accidents, Vehicle Breakdowns, Road Blocks, Traffic Diversions etc. Returns current traffic speeds on expressways and arterial roads, expressed in speed bands. Returns traffic advisories (via variable message services) concerning current traffic conditions that are displayed on EMAS signboards along expressways and arterial roads. Active Mobility Related (Total 1) Description Bicycle Parking Returns the bicycle parking locations within a radius. 10 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.1 BUS ARRIVAL URL Description Update Freq http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2 Returns real-time Bus Arrival information of Bus Services at a queried Bus Stop, including Est. Arrival Time, Est. Current Location, Est. Current Load. 1 minute Request Parameters BusStopCode ServiceNo Description Mandatory Bus stop reference code Yes Bus service number No Response Attributes ServiceNo Operator Description Example Bus service number 15 Public Transport Operator Codes: GAS SBST (for SBS Transit) SMRT (for SMRT Corporation) TTS (for Tower Transit Singapore) GAS (for Go Ahead Singapore) 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. Reference code of the first bus stop where this 77009 bus started its service Reference code of the last bus stop where this 77131 bus will terminate its service Date-time of this bus’ estimated time of arrival, 2017-04-29T07:20:24+08:00 expressed in the UTC standard, GMT+8 for Singapore Standard Time (SST) Current estimated location coordinates of this 1.42117943692586 bus at point of published data 103.831477233098 NextBus NextBus2 NextBus3 ^ OriginCode ^ DestinationCode ^ EstimatedArrival ^ Latitude ^ Longitude ^ VisitNumber ^ Load ^ Feature ^ Type Ordinal value of the nth visit of this vehicle at this bus stop; 1=1st visit, 2=2nd visit Current bus occupancy / crowding level: SEA (for Seats Available) SDA (for Standing Available) LSD (for Limited Standing) Indicates if bus is wheel-chair accessible: WAB (empty / blank) Vehicle type: SD (for Single Deck) DD (for Double Deck) BD (for Bendy) Example 83139 15 1 SEA WAB 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. 11 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) SAMPLE API CALL & RESPONSE API Call: http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2?BusStopCode=83139 API Response: { "odata.metadata": "http://datamall2.mytransport.sg/ltaodataservice/$metadata#BusArrivalv2/@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", 12 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) "EstimatedArrival": "2017-06-05T15:04:49+08:00", "Latitude": "0", "Longitude": "0", "VisitNumber": "1", "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" } } ] } 13 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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. 14 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2. [EstimatedArrival] Rounding of Seconds All derived bus arrival duration should be rounded down to the nearest minute. 3. 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” [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. 15 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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 (1 or 2), loop services only have 1 direction Category Category of the SBS bus service: TRUNK EXPRESS, FEEDER, INDUSTRIAL, TOWNLINK, TRUNK, 2 TIER FLAT FEE, FLAT FEE $1.10 (or $1.90, $3.50, $3.80) OriginCode Bus stop code for first bus stop 64009 DestinationCode Bus stop code for last bus stop 64009 (similar as first stop for loop services) AM_Peak_Freq Freq of dispatch for AM Peak 14-17 0630H - 0830H (range in minutes) AM_Offpeak_Freq Freq of dispatch for AM Off-Peak 10-16 0831H - 1659H (range in minutes) PM_Peak_Freq Freq of dispatch for PM Peak 12-15 1700H - 1900H (range in minutes) PM_Offpeak_Freq Freq of dispatch for PM Off-Peak 12-15 after 1900H (range in minutes) LoopDesc Location at which the bus service loops, empty if not a loop service. 16 Raffles Blvd LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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 (1 or 2), loop services only have 1 direction StopSequence The i-th bus stop for this route 28 BusStopCode The unique 5-digit identifier for this 01219 physical bus stop Distance Distance travelled by bus from starting 10.3 location to this bus stop (in kilometres) 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 17 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 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 01012 physical bus stop RoadName The road on which this bus stop is Victoria St located Description Landmarks next to the bus stop (if Hotel Grand Pacific any) to aid in identifying this bus stop Latitude Longitude 1.29685 Location coordinates for this bus stop 18 103.853 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.5 PASSENGER VOLUME BY BUS STOPS URL Description Update Freq Parameters Date Attributes Link http://datamall2.mytransport.sg/ltaodataservice/PV/Bus Returns tap in and tap out passenger volume by weekdays and weekends for individual bus stop By 15th of every month, the passenger volume for previous month data will be generated Request Description Mandatory Request for files up to No last three months Response Example Description Link for downloading this file. Refer to sample output on Annex A for reference Link will expire after 5 minutes Example Date=201803 https://ltafarecard.s3.amazona ws.com/201803/transport_node _bus_201803.zip?x-amzsecuritytoken=FQoDYXdzEOf%2F%2F% 2F%2F%2F%2F%2F%2F%2F%... 19 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.6 PASSENGER VOLUME BY ORIGIN DESTINATION BUS STOPS URL Description Update Freq Parameters Date Attributes Link http://datamall2.mytransport.sg/ltaodataservice/PV/ODBus Returns number of trips by weekdays and weekends from origin to destination bus stops By 15th of every month, the passenger volume for previous month data will be generated Request Description Mandatory Request for files up to No last three months Response Example Description Link for downloading this file. Refer to sample output on Annex B for reference Link will expire after 5 minutes Example 20 Date=201804 https://ltafarecard.s3.amazonaws .com/201804/origin_destination_ bus_201804.zip?x-amz-securitytoken=FQoDYXdzEOf%2F%2... LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.7 PASSENGER VOLUME BY ORIGIN DESTINATION TRAIN STATIONS URL Description Update Freq Parameters Date Attributes Link http://datamall2.mytransport.sg/ltaodataservice/PV/ODTrain Returns number of trips by weekdays and weekends from origin to destination train stations By 15th of every month, the passenger volume for previous month data will be generated Request Description Mandatory Request for files up to No last three months Response Example Description Link for downloading this file. Refer to sample output on Annex B for reference Link will expire after 5 minutes Example 21 Date=201803 https://ltafarecard.s3.amazona ws.com/201803/origin_destinat ion_train_201803.zip?x-amzsecuritytoken=FQoDYXdzEOf%2F%2F% ... LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.8 PASSENGER VOLUME BY TRAIN STATIONS URL Description Update Freq Parameters Date Attributes Link http://datamall2.mytransport.sg/ltaodataservice/PV/Train Returns tap in and tap out passenger volume by weekdays and weekends for individual train station By 15th of every month, the passenger volume for previous month data will be generated Request Description Mandatory Request for files up to No last three months Response Example Description Link for downloading this file. Refer to sample output on Annex A for reference Link will expire after 5 minutes Example 22 Date=201805 https://ltafarecard.s3.amazona ws.com/201805/transport_node _train_201805.zip?x-amzsecuritytoken=FQoDYXdzEOf%2F%2F% 2F... LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.9 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 23 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.10 TRAIN SERVICE ALERTS URL Description Update Freq http://datamall2.mytransport.sg/ltaodataservice/TrainServiceAlerts Returns detailed information on train service unavailability during scheduled operating hours, such as affected line and stations etc. (ad-hoc) Request Parameters (none) Description - Attributes Status Description Indicates if train service is unavailable: 1 (for Normal Train Service) 2 (for Disrupted Train Service) Train network line affected: Line Direction Stations FreePublicBus FreeMRTShuttle Mandatory Response Example Example 2 NEL CCL (for Circle Line) CEL (for Circle Line Extension – BayFront, Marina Bay) CGL (for Changi Extension – Expo, Changi Airport) DTL (for Downtown Line) EWL (for East West Line) NEL (for North East Line) NSL (for North South Line) PEL (for Punggol LRT East Loop) PWL (for Punggol LRT West Loop) SEL (for Sengkang LRT East Loop) SWL (For Sengkang LRT West Loop) BPL (for Bukit Panjang LRT) Indicates direction of service unavailability on the affected line: Both (towards station name) Indicates the list of affected stations on the affected line. Indicates the list of affected stations where free boarding onto normal public bus services are available. (station code) Free bus service island wide Indicates the list of affected stations where free MRT shuttle services^ are available. (station code) EW21|CC22,EW23,EW24|NS1, EW27;NS9,NS13,NS16,NS17|CC15; EW8|CC9,EW5,EW2;NS1|EW24,NS4|BP1* 24 Punggol NE1,NE3,NE4,NE5,NE6 NE1,NE3,NE4,NE5,NE6 NE1,NE3,NE4,NE5,NE6 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) MRTShuttleDirection Message Indicates the direction of free MRT shuttle services available: Both (towards station name) Travel advisory notification service for train commuters, published by LTA. This notice is also broadcasted to commuters via the Find-My-Way module in MyTransport mobile app. Content CreatedDate Punggol 1710hrs: NEL – No train service between Harbourfront to Dhoby Ghaut stations towards Punggol station due to a signalling fault. Free bus rides are available at designated bus stops. 2017-12-01 17:54:21 Note: This API relies on the static master list of Train Station Codes, Train Line Codes and Train Shuttle Service Direction which can be obtained on DataMall Portal . The Train Station Codes and Train Line Codes files are under Public Transport section. The Train Shuttle Service Direction information can be found in Train Line Codes file. During train unavailability, following attributes will be mandatory. Status Line Direction Stations Each line that is affected will be published as separate clusters within the single API response. Refer to sample output on Annex C for reference. ^Free MRT Shuttle services will ferry commuters from station to station along the affected stretch. *There are scenarios which MRT Shuttle services do not run along the affected stretch but along four predefined areas in both directions Bouna Vista, Clementi, Jurong East and Boon Lay Woodlands, Yishun, Ang Mo Kio, Bishan Paya Lebar, Bedok, Tampines Jurong East, Choa Chu Kang “|” delimiter to denote an interchange station “;” delimiter to denote end of an area 25 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.11 CARPARK AVAILABILITY URL http://datamall2.mytransport.sg/ltaodataservice/CarParkAvailabilityv2 Returns no. of available lots for HDB, LTA and URA carpark data. Description The LTA carpark data consist of major shopping malls and developments within Orchard, Marina, HarbourFront, Jurong Lake District. (Note: list of LTA carpark data available on this API is subset of those listed on One.Motoring and MyTransport Portals) Update Freq 1 minute Response Attributes Description LTA Sample URA Sample HDB Sample CarParkID A unique code for this carpark 1 A0007 KB7 Area Area of development / building: Marina (blank) (blank) Suntec City ANGULLIA BLK 69 PARK OFF GEYLANG STREET BAHRU Development Orchard Marina Harbfront JurongLakeDistrict Major landmark or address where carpark is located Location AvailableLots Latitude and Longitude map 1.29375 1.305328… 1.32158.. coordinates. 103.85718 103.82957... 103.87047… Number of lots available at point 352 0 18 C Y C LTA URA HDB of data retrieval. LotType Agency Type of lots: C (for Cars) H (for Heavy Vehicles) Y (for Motorcycles) Agencies: HDB LTA URA Respective agencies are responsible for the accuracy of the carpark data. If there is any data related issue, you may contact the agency directly. There may be empty values if data is not available (e.g. Area for HDB and URA data is unavailable hence blank value is expected). 26 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.12 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/Light Goods Passenger Cars Motorcycles Light Goods Vehicles Heavy Goods Vehicles Very Heavy Goods Vehicles/Taxis Vehicles DayType Taxis Available types: Weekdays - Weekdays - Saturdays 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 2016-02-01 (in YYYY-MM-DD format) 27 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.13 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 1 – Travelling from east to west, or south to north. 2 – Travelling from west to east, or north to south. FarEndPoint The final end point of this whole TUAS CHECKPOINT expressway in current direction of travel StartPoint Start point of this current AYE/MCE INTERCHANGE segment EndPoint End point of this current TELOK BLANGAH RD segment EstTime Estimated travel time in minutes 28 2 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.14 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 703034136 unique traffic light node Type Type of the technical alarm 4 (Blackout) 13 (Flashing Yellow) StartDate YYYY-MM-DD HH:MM:SS.ms EndDate YYYY-MM-DD HH:MM:SS.ms 13 2014-04-12 01:58:00.0 (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. 29 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.15 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 2016-03-31 performed for this road opening (in YYYY-MM-DD format) EndDate End date for works to be 2016-09-30 performed for this road opening (in YYYY-MM-DD format) Department or company SP POWERGRID LTD - CUSTOMER performing this road work PROJ (EAST) RoadName Name of new road to be opened AH SOO GARDEN Other Additional information or For details, please call 62409237 SvcDept messages 30 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.16 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 2015-12-14 performed for this road work (in YYYY-MM-DD format) EndDate End date for works performed 2016-07-31 for this road work (in YYYY-MM-DD format) SvcDept RoadName Department or company SP POWERGRID LTD - REGIONAL performing this road work NETWORK CENTRAL Name of road where work is ADAM DRIVE being performed. Other Additional information or messages. 31 For details, please call 67273085 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.17 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 5795 camera Latitude Latitude map 1.326024822 coordinates Longitude Longitude map 103.905625 coordinates ImageLink Link for https://s3-ap-southeast- downloading this 1.amazonaws.com/mtpdm/2016-03-29/18- image. 32/5795_1822_20160329182706_c3e176.jpg 32 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.18 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: Vehicle Breakdown Latitude Accident Road Works Vehicle Breakdown Weather Obstacle Road Block Heavy Traffic Misc. Diversion Unattended Vehicle Latitude map coordinates for the 1.30398068448214 start point of this road incident Longitude Longitude map coordinates for 103.919182834377 the start point of this incident Message Description message for this (29/3)18:22 Vehicle breakdown on incident ECP (towards Changi Airport) after Still Rd Sth Exit. Avoid lane 3. 33 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.19 TRAFFIC SPEED BANDS URL http://datamall2.mytransport.sg/ltaodataservice/TrafficSpeedBandsv2 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 B – Major Arterial Roads C – Arterial Roads D – Minor Arterial Roads E – Small Roads F – Slip Roads G – No category info available SpeedBand Speed Bands Information. Total: 8 2 1 – indicates speed range from 0 < 9 2 – indicates speed range from 10 < 19 3 – indicates speed range from 20 < 29 4 – indicates speed range from 30 < 39 5 – indicates speed range from 40 < 49 6 – indicates speed range from 50 < 59 7 – indicates speed range from 60 < 69 8 – speed range from 70 or more MinimumSpeed Minimum speed in km/h 10 MaximumSpeed Maximum speed in km/h 19 Location Latitude and Longitude map 1.3220591510051254 coordinates for start and end points 103.86246461405193 for this stretch of road. 1.3215993547809128 103.86315591911669 34 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.20 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 1.3927176306916775 electronic signboard. Longitude Longitude map coordinates of 103.82618266340947 electronic signboard. Message Variable Message being VEH BREAKDOWN SH,AFT displayed on the EMAS display. U.THOMSON 35 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.21 Bicycle Parking URL Description Update Freq Parameters http://datamall2.mytransport.sg/ltaodataservice/BicycleParkingv2 Returns bicycle parking locations within a radius. The default radius is set as 0.5km Monthly Request Description Mandatory Latitude map Yes coordinates of location Longitude map Yes coordinates of location Radius in kilometre No Response Example Example Bus Stop 43267 RackType Description Brief description of bicycle parking location. Latitude map coordinates of bicycle parking location. Longitude map coordinates of bicycle parking location. Type of bicycle parking facility. RackCount Total number of bicycle parking lots. 10 ShelterIndicator Indicate whether the bicycle parking lots are sheltered. Y Lat Long Dist Attributes Description Latitude Longitude 36 1.364897 103.766094 Default is 0.5 1.3927176306916775 103.82618266340947 Racks or Yellow Box LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) ANNEX A SAMPLE OUTPUT FOR 2.5 PASSENGER VOLUME BY BUS STOPS AND 2.8 PASSENGER VOLUME BY TRAIN STATIONS The batch file follows a variant of the generic comma-separated-values (CSV) format. SYNTAX YEAR_MONTH, DAY_TYPE, TIME_PER_HOUR, PT_TYPE, PT_CODE, TOTAL_TAP_IN_VOLUME, TOTAL_TAP_OUT_VOLUME \n DELIMITERS , \n common delimiter to separate values not a delimiter, but the ‘next line’ character to denote the end of a record SAMPLE FOR BUS 2018-05, WEEKDAY, 20, BUS, 50199, 853, 834 2018-05, WEEKENDS/HOLIDAY, 20, BUS, 50199, 459, 297 SAMPLE FOR TRAIN 2018-05, WEEKDAY, 15, TRAIN, EW14-NS26, 56019, 37614 2018-05, WEEKENDS/HOLIDAY, 15, TRAIN, , EW14-NS26, 13385, 10878 Note Explanation of the sample Bus record: On a typical weekday of May 2018, from 2000hrs to 2059hrs, at Bus Stop 50199, Opp Shaw Plaza, the passenger volume of tap in and tap out are 853 and 834 respectively. TIME_PER_HOUR refers to the hour of the day. E.g. 15 = 1500hrs to 1559hrs For some Train interchanges, the station codes will be merged and considered as one station (E.g. EW14-NS26 refers to Raffles Place station) To find out more information about bus stops, please refer to Bus Stop API. To find out more information about train stations, please refer to Train Station Codes and Chinese Names.csv in DataMall Portal under Public Transport section. 37 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) ANNEX B SAMPLE OUTPUT FOR 2.6 PASSENGER VOLUME BY ORIGIN DESTINATION BUS STOPS AND 2.7 PASSENGER VOLUME BY ORIGIN DESTINATION TRAIN STATIONS The batch file follows a variant of the generic comma-separated-values (CSV) format. SYNTAX YEAR_MONTH, DAY_TYPE, TIME_PER_HOUR, PT_TYPE, ORIGIN_PT_CODE, DESTINATION_PT_CODE, TOTAL_TRIPS \n DELIMITERS , \n common delimiter to separate values not a delimiter, but the ‘next line’ character to denote the end of a record SAMPLE FOR BUS 2018-05, WEEKDAY, 16, BUS, 28299, 28009, 63 2018-05, WEEKENDS/HOLIDAY, 16, BUS, 28299, 28009, 103 SAMPLE FOR TRAIN 2018-05, WEEKDAY, 17, TRAIN, CC28, CC1-NE6-NS24, 111 2018-05, WEEKENDS/HOLIDAY, 17, TRAIN, CC28, CC1-NE6-NS24, 39 Note Explanation of the sample Train record: On a typical weekday of May 2018, from 1700hrs to 1759hrs, the total number of trips that travelled from CC28, Telok Blangah station, to CC1-NE6-NS24, Dhoby Ghaut station, are 111. TIME_PER_HOUR refers to the hour of the day. E.g. 16 = 1600hrs to 1659hrs For some Train interchanges, the station codes will be merged and considered as one station (E.g. CC1-NE6-NS24 refers to Dhoby Ghaut station) To find out more information about bus stops, please refer to Bus Stop API. To find out more information about train stations, please refer to Train Station Codes and Chinese Names.csv in DataMall Portal under Public Transport section. 38 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) ANNEX C SAMPLE SCENARIOS FOR 2.6 TRAIN SERVICE ALERTS API Once the train is unavailable, you may expect the Train Service Alert API response to be displayed according to the steps below. 1. 2. 3. 4. 5. 6. Activate contingency mode Publish message Edit activated contingency mode (optional) Publish new message (optional) Train Service Recover Publish recover message (optional) During normal scenario (No train Disruption) 39 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Sample Scenario #1 - Single Line affected This scenario depicts a. NEL – Boon Keng to Dhoby Ghaut, towards Harbourfront station b. Free public bus services and free MRT shuttle (towards Harbourfront station) Step 1: Activate contingency mode - NEL – Boon Keng to Dhoby Ghaut, towards Harbourfront station 40 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 2: Publish new message Step 3: Edit activated contingency mode – Free Public Bus Service and free MRT Shuttle Service (towards HarbourFront) 41 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 4: Publish new message 42 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 5: Train service recover with Free Public Bus and MRT shuttle still available 43 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 6: Publish new message 44 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 7: After bus rides are ceased (no new published message) 45 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Sample Scenario #2 - Multi Lines affected This scenario depicts 3 lines: North South Line, East West Line, and Downtown Line are down. a. North South Line – between Bishan and Woodlands, towards Jurong East Station a. East West Line – between Paya Lebar and Pasir Ris, both direction b. MRT Shuttle Services that run along four predefined areas in both directions c. Downtown Line – between Downtown and Beauty World, both directions d. Free Bus Island-wide Step 1: Activate contingency mode – North South Line down with new message published 46 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 2: Edit activated contingency mode –East West Line and North South line are down with new message published 181 1 hr 47 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 3: Edit activated contingency mode - Activate MRT shuttle services to run along four predefined areas in both directions (no new message published) 48 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 4: Edit activated contingency mode – In addition to North South, East West lines, Downtown line is also down with new message published 49 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 5: Edit activated contingency mode –Activate Free bus service island-wide with new message published 50 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 6: Train service recover – North South and East West line recover with new message published 51 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 7: Train service recover – Downtown line recovers, free public bus service and MRT shuttle are still available with new message published 52 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) Step 8: Train service recover – Free public bus service and MRT shuttle have ceased Step 9: Train service recover - After message has expired 53 LTA DataMall | API User Guide & Documentation Version 4.9 (11 Feb 2019) 2.2 Train Delay This scenario depicts there is a delay at Seng Kang West LRT (West Loop). Step 1: New message published (Contingency mode is not activated) Step 2: Train Service Resumes 54
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 55 XMP Toolkit : NitroPro 9.5 Modify Date : 2019:04:28 23:36:13+08:00 Language : en-SG Tagged PDF : Yes Create Date : 2019:02:08 16:04:55+08:00EXIF Metadata provided by EXIF.tools