GithubHelp home page GithubHelp logo

bchewy / arrivelah Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cheeaun/arrivelah

1.0 1.0 0.0 67 KB

Fast simple API for bus arrival times in Singapore.

Home Page: https://arrivelah2.busrouter.sg/

JavaScript 99.69% Shell 0.31%

arrivelah's Introduction

ArriveLah

Fast simple API for bus arrival times in Singapore.

This is like a proxy to LTA's DataMall Bus Arrival API.

API

Request

GET /?id=83139
  • id - (required) Bus stop ID/code

Response

{
  "services": [
    {
      "no": "15",
      "next": {
        "time": "2017-07-18T01:30:37+00:00",
        "duration_ms": -34445,
        "lat": 1.3148358333333334,
        "lng": 103.90915083333333,
        "load": "Standing Available",
        "feature": "WAB"
      },
      "subsequent": {
        "time": "2017-07-18T01:36:11+00:00",
        "duration_ms": 299555,
        "lat": 1.3265658333333334,
        "lng": 103.9059575,
        "feature": "WAB"
      }
    },
    {
      "no": "150",
      "next": {
        "time": "2017-07-18T01:32:44+00:00",
        "duration_ms": 92555,
        "lat": 1.3196148333333333,
        "lng": 103.9014965,
        "load": "Seats Available",
        "feature": "WAB"
      },
      "subsequent": {
        "time": "2017-07-18T01:51:16+00:00",
        "duration_ms": 1204555,
        "lat": 0,
        "lng": 0,
        "feature": "WAB"
      }
    },
    {
      "no": "155",
      "next": {
        "time": "2017-07-18T01:32:36+00:00",
        "duration_ms": 84555,
        "lat": 1.319155,
        "lng": 103.90471016666666,
        "load": "Seats Available",
        "feature": "WAB"
      },
      "subsequent": {
        "time": "2017-07-18T01:43:18+00:00",
        "duration_ms": 726555,
        "lat": 1.3189929999999999,
        "lng": 103.88656266666666,
        "feature": "WAB"
      }
    }
  ]
}

The responses are cached for 15 seconds.

Development

  1. Add configuration. Follow documentation from mytransport.sg DataMall. Two options (choose one):
  2. Copy and rename .env.example to .env. Edit the file.
  3. Add environment variables.
  4. npm install
  5. npm start
  6. Load locahost:8081. Change PORT in configuration if it doesn't work.

License

MIT. Data is copyrighted by LTA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.