Skip to content

Ju-Long/sgTransport

Repository files navigation

sgTransport

Alt Text

Description

This is the repo for Singapore Transport like Bus, Train, etc... This API will be non-commercialised and only accept donations. It is hosting on https://transport.babasama.com and the existing path and code is all available open source on github.


It is an NodeJS application with redis as a caching server database and got as a http request library. See the npm package @ package.json.


Note: ALL the url links are publicly available. Resources below.


Do you want to host it yourself instead? Sure you can

Paths


  • GET BUS STOP TIMING - https://transport.babasama.com/bus/timing/BusStop/:BusStopCode

  • SEARCH FOR BUS STOP - https://transport.babasama.com/bus/search/BusStop/:BusStopCode

  • SEARCH FOR BUS - https://transport.babasama.com/bus/search/Bus/:ServiceNo


  • GET INFOMATION BETWEEN BUS STOP CODE WITH BUS FILTER - https://transport.babasama.com/bus/distance/Bus/:ServiceNo/:StartBusStopCode/:EndBusStopCode

More to come...

How do I use it at my own server or localhost?

Preparations:

  1. ensure you have
  2. installed and working, else you cant run... unless
  3. You can then fork / clone this repo
  4. npm install
  5. make a copy of .env from example.env
  6. node app.js

It is hosted on port 3002

btw the start.sh and pull.sh is made so at server side its easier to pull and start with forever

Resources