Skip to content

Latest commit

 

History

History
89 lines (55 loc) · 1.8 KB

README.md

File metadata and controls

89 lines (55 loc) · 1.8 KB

railway

An API with various functionalities for indian railways

Installation

npm install railway

##Usage

var railway = require('railway-api')
  • set API key (MANDATORY)
railway.setApikey('<API key>')

You may register for a key at http://www.railwayapi.com/pricing/

  • Check PNR status

Get PNR status using 10 digit PNR No.

railway.checkPnr('<10 digit pnr>', function (err, res) {})
  • Station name to Code

Get station details of given station and nearby stations using station name with automatic name completion.

railway.stationCode('<station name>', function (err, res) {})
  • Station Code to Name

Get passed railway station and nearby stations details using station code.

railway.stationName('<station code>', function (err, res) {})
  • LIVE train status

Get live train status.

railway.liveTrainStatus('<train number>', function (err, res) {})
  • Train route information

Get train’s route information like the list of stoppages,their locations etc.

railway.trainRoute('<train number>', function (err, res) {})
  • Trains between stations

Get all trains(numbers) running between a source station and destination.

railway.trainBetweenStations('<source>', '<destination>', function (err, res) {})
  • Train name/number

Get train name using number and vice versa.

railway.name_number('<train name or number>', function (err, res) {})
  • Seat Availability

Get Train Seat Availability.

railway.seatAvailability = ('<trainNo>', '<source>', '<destination>', '<date>', '<class>', '<quota>', function (err, res) {})

class: valid class code can be fetched from http://www.indianrail.gov.in/class_Code.html

quota(optional: defaults to GN): valid quota code can be fetched from http://www.indianrail.gov.in/quota_Code.html