Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rachitgupta98/api-railway-api
NPM Package that provide all the information related to Indian Trains.
https://github.com/rachitgupta98/api-railway-api
api destination-station indian-trains nodejs npm npm-install npm-package railway-api request-promise schedule source-station
Last synced: 7 days ago
JSON representation
NPM Package that provide all the information related to Indian Trains.
- Host: GitHub
- URL: https://github.com/rachitgupta98/api-railway-api
- Owner: rachitgupta98
- License: mit
- Created: 2019-06-29T16:02:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T19:14:09.000Z (about 2 years ago)
- Last Synced: 2024-11-14T03:49:11.037Z (about 2 months ago)
- Topics: api, destination-station, indian-trains, nodejs, npm, npm-install, npm-package, railway-api, request-promise, schedule, source-station
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/api-railway-api
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# api-railway-api
[![NPM Downloads](https://img.shields.io/npm/dt/api-railway-api.svg?style=flat)](https://www.npmjs.com/package/api-railway-api?minimal=true)New API that provide all the information related to Indian Trains.
## Installation
npm install api-railway-api --save
## Usage
```js
const railway = require("api-railway-api");
```## - set API key (Don't Forget to Add)
```js
railway.setApikey("");
```You can get the API Key by registering here https://indianrailapi.com/
## - Train_No information
Get the train information by entering Train number.
```js
railway.getTrainRoute(, function(err, res) {
if (err) {
//handling the error
} else {
//return train information
}
});
```## - Trains between stations
Get all trains(numbers) running between a source station and destination.
```js
railway.getTrainBtwStation("", "", function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```## - Check Train Live Status
Get the current status of Train by entering Train_No and Date (yyyymmdd).
```js
railway.getLiveTrainStatus(,"yyyymmdd", function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```## - Check Train Schedule
Get the full schedule of train from source to destination
```js
railway.getTrainSchedule(, function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```## - Check Train Fare
Get the Fare of tickets between two station of all class (GN,SL,AC)
- Train_No: Train Number.
- source : Source Station Code.* destination: Destination Station Code.
* quota : GN/CK```js
railway.getTrainFare( ,"","","" function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```## - Check Seat Availability
- Train_No : Train Number.
- source : Source Station Code.
- destination: Destination Station Code.
- date : Request Date in yyyyMMdd format.
- class : Class Code Like 1A/2A/3A/SL and so on.
- Quota : Currently available only for General(GN) Quata.```js
railway.getSeatAvailability(,"","","","", function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```## - Check Coach Position
```js
railway.getCoachPosition(, function(err, res) {
if (err) {
//handling the error
} else {
//return the response object
}
});
```