SGCommute is a REST API wrapper for Singapore Land Transport Authority (Singapore)'s DataMall APIs. Compatible with all programming languages, it allows simpler and more straightforward access to LTA DataMall's data via HTTP requests.
SGCommute is able to retrieve the following data from LTA DataMall's API
- Regarding buses
- Bus details
- Operating company
- AM/PM peak hours
- Loop/bi-directional service
- Location at which the bus service loops (if it is a looped service)
- Bus routes
- All bus stops covered by the bus service
- Weekday/Saturday/Sunday first/last bus service timing at specific bus stop
- Bus details
- Regarding bus stops
- Road name
- Landmarks near bus stops to aid in identifying bus stop (if any)
- Coordinates of bus stop (longitude and latitude)
- Bus arrival timings at that bus stop
This project is hosted on a server and you may simply send GET requests to https://sgcommute-287703.appspot.com
.
To retrieve all buses that are in operation:
https://sgcommute-287703.appspot.com/buses
To retrieve all bus stops in Singapore that are in operation:
https://sgcommute-287703.appspot.com/busstops
To retrieve bus arrival timings at a specific bus stop (Eg. 01012):
https://sgcommute-287703.appspot.com/busstops/01012/arrivals
For a full list of routes, please visit the wiki page of this project.
git clone https://github.com/Beebeeoii/SGCommute.git
Navigate to sgcommute-localhost
> private
> bus-stops
> bus-stops.go
and sgcommute-localhost
> private
> buses
> buses.go
Register for an API Key on the LTA DataMall website
With the API key, replace yourAPIKey
in const apiKey = "yourAPIKey"
with the API Key you received via email from Step 3
Build and run main.go
and the server is accessible from localhost:8080
Voila!
git clone https://github.com/Beebeeoii/SGCommute.git
Navigate to go-app
> app.yaml
Register for an API Key on the LTA DataMall website
With the API key, replace yourAPIKey
in API_KEY: "yourAPIKey"
with the API Key you received via email from Step 3
Upload both go-app
and gopath
onto Google App Engine via Cloudshell Editor
Enter Cloudshell and perform cd go-app/
, gcloud app deploy
Voila!
Copyright 2020 Beebeeoii
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.