GithubHelp home page GithubHelp logo

hyperrail / lc2irail Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 1.0 674 KB

This project transforms Linked Connections (or any other data source) into a RPC API with endpoints similar to irail.be

License: Mozilla Public License 2.0

PHP 100.00%

lc2irail's Introduction

lc2irail

An API, compliant to the original iRail API, based on linkedconnections.

This project provides a lightweight API, based on the Lumen microframework. It aims at providing an API for Belgian rail, similar to the original iRail api, but with more efficient data structures and caching

Installation

  • Run composer install
  • Run composer install for vendor/irail/stations
  • Set APC to have at least 512MB of cache!

Enpoints

Time can be passed on as ISO8601 timestamps.

Liveboard by station id

  • liveboard/{id}
  • liveboard/{id}/{timestamp}

Get a liveboard containing departures for a certain station. The ID is the 7 digit UIC ID, or the 9 digit HAFAS station ID

Liveboard by station name

  • liveboard/{name}
  • liveboard/{name}/{timestamp}

This enpoint provides similar functionality as the endpoint described above, however, it allows searching stations by name.

Vehicle

  • vehicle/{id}/{yyyyMMdd}

Where id is the name of the train, e.g. IC837, and yyyyMMdd is the year, month, day of departure for which the train should be retrieved

Route

  • connections/{from}/{to}/departing/{timestamp}
  • connections/{from}/{to}/arriving/{timestamp}
  • connections/{from}/{to}/{departureTimestamp}/{arrivalTimestamp} Where from and to can be either station ids or names.

This allows you to either get routes departing after or arriving before a certain time, or to get all routes departing after a certain time and arriving before an upper time bound.

Language

  • ?lang={ISO2 language}

lc2irail's People

Contributors

bertware avatar

Stargazers

Pieter Colpaert avatar

Watchers

Pieter Colpaert avatar James Cloos avatar  avatar Dylan Van Assche avatar  avatar

Forkers

bertware

lc2irail's Issues

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.