42ms avg
GET|/api/v1/trains/search

Trains Between Stations API

Search all running trains between any two Indian Railways station codes with travel duration, running days, distance, halts, and base fares.

Live Protocol Demo

Production headers and authentic PRS gateway response.

GET/api/v1/trains/search?from=NDLS&to=GD&date=2026-10-24
curl -X GET "https://api.irctc.dev/api/v1/trains/search?from=NDLS&to=GD&date=2026-10-24" \
-H "x-api-key: your_api_key"
200 OK·application/json
latency: 42ms avg
{
"success": true,
"data": [
{
"trainNo": "12556",
"trainName": "GORAKHDHAM EXP",
"trainType": "SUPERFAST",
"fromStation": "NDLS",
"toStation": "GD",
"fromStationName": "NEW DELHI",
"toStationName": "GONDA JN",
"departure": "21:25",
"arrival": "07:00",
"durationMin": 575,
"durationStr": "9:35",
"runningDays": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"distance": "631",
"estimatedFare": 372,
"halts": 4
},
{
"trainNo": "12566",
"trainName": "BIHAR S KRANTI",
"trainType": "SUPERFAST",
"fromStation": "NDLS",
"toStation": "GD",
"fromStationName": "NEW DELHI",
"toStationName": "GONDA JN",
"departure": "12:45",
"arrival": "22:26",
"durationMin": 581,
"durationStr": "9:41",
"runningDays": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"distance": "639",
"estimatedFare": 376,
"halts": 4
}
],
"source": "irctc-api",
"_time": 0.042
}

Engineered for Railway Throughput

High-throughput PRS reservation engine connectivity with sub-second Redis caches and 99.9% uptime reliability.

Direct Gateway Architecture

Multi-hop routing & telemetry
Dedicated PRS Socket

Queries route through high-speed edge clusters across Indian data center zones with direct PRS gateway connectivity and sub-millisecond dispatch.

HOP_TELEMETRY // DEDICATED_SOCKETTOTAL_BUDGET: 42ms avg
01Edge Ingress
12ms
02Edge Router
< 2ms
03Central PRS Tunnel
42ms avg
Ingress: ~15%Edge: <5%PRS Core: ~80%

Production SLAs & Latency

Deterministic throughput backed by enterprise uptime guarantees.

Latency Benchmark42ms avg
Uptime SLA99.95%
Rate Limits1,000 req/min
Cache Strategy24h In-Memory Hash
01 // Capability

Lightning Route Resolution

Calculates all direct services across 8,500+ Indian stations in under 50ms using pre-compiled graph routing tables.

02 // Capability

Running Days & Weekly Calendar

Instant verification of weekday frequency (Mon through Sun) with automated date matching.

03 // Capability

Fare & Duration Estimates

Built-in base fare estimation and duration formatting for immediate rendering in flight/bus comparison screens.

Parameters Specification

Query and path parameters for /api/v1/trains/search

fromstringin: QUERY
required

Source station code (e.g. NDLS).

Example:NDLS
tostringin: QUERY
required

Destination station code (e.g. GD).

Example:GD
datestringin: QUERY
optional

Journey date in YYYY-MM-DD format to filter active running days.

Example:2026-10-24
Response Status:
200 OK 400 Bad Request 404 Not Found 503 Upstream Maintenance

Frequently Asked Questions

Technical specs regarding IRCTC session lifetime, authentication, and quotas.

All 8,500+ Indian Railways station codes (e.g. NDLS, CSMT, HWH, MAS, SBC, PNBE) are fully indexed.
Route Automation

How to Build a WhatsApp Train Running Status & PNR Bot in Node.js

Integrate route search and live train status directly into an automated WhatsApp messaging workflow.

Read Tutorial

Related Railway Endpoints

$npm i irctc-api

Integrate Trains Between Stations API

Integrate live Indian Railways data into your production or staging stack. 10,000 free sandbox calls included.