Indian Railways

FREE
By blaazetech
Updated 4 months ago
Data
8.2/10
Popularity Score
18952ms
Latency
57%
Success Rate

Indian Railways API Documentation

Get station codes and also get PNR status of indian railways using this easy API, this is developed for educational purposes only and we are not affiliated to indian railways in any form and this is not an official api also.

View API Details
GETPNR Status Check
GETFind Stations
GETPNR Status Check

Just give 10-digit pnr number and get the status.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
pnrNUMBER
REQUIREDPNR number for which query need to be carried out.
Code Snippet
unirest.get("https://indianrailways.p.rapidapi.com/index.php?pnr=1234567890")
.header("X-RapidAPI-Host", "indianrailways.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://indianrailways.p.rapidapi.com/index.php
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://indianrailways.p.rapidapi.com/index.php?pnr=1234567890")
.header("X-RapidAPI-Host", "indianrailways.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication