48ms avg
GET|/api/v1/trains/:trainNo/fare

Train Fare & Ticket Pricing API

Fetch real-time train ticket fare breakups across all classes with discrete components: Base Fare, Reservation, Superfast, GST, and Catering.

Live Protocol Demo

Production headers and authentic PRS gateway response.

GET/api/v1/trains/12558/fare?from=ANVT&to=NKE&class=all&quota=GN
curl -X GET "https://api.irctc.dev/api/v1/trains/12558/fare?from=ANVT&to=NKE&class=all&quota=GN" \
-H "x-api-key: your_api_key"
200 OK·application/json
latency: 48ms avg
{
"success": true,
"trainNumber": "12558",
"trainName": "SAPT KRANTI EXP",
"from": "ANVT",
"to": "NKE",
"quota": "GN",
"totalClasses": 4,
"fares": [
{
"class": "1A",
"className": "First AC",
"totalFare": 3045,
"breakup": {
"baseFare": 2765,
"reservationCharge": 60,
"superfastCharge": 75,
"gst": 145,
"cateringCharge": 0
}
},
{
"class": "2A",
"className": "Second AC",
"totalFare": 1825,
"breakup": {
"baseFare": 1643,
"reservationCharge": 50,
"superfastCharge": 45,
"gst": 87,
"cateringCharge": 0
}
},
{
"class": "3A",
"className": "Third AC",
"totalFare": 1300,
"breakup": {
"baseFare": 1149,
"reservationCharge": 40,
"superfastCharge": 45,
"gst": 62,
"cateringCharge": 0
}
},
{
"class": "SL",
"className": "Sleeper",
"totalFare": 505,
"breakup": {
"baseFare": 454,
"reservationCharge": 20,
"superfastCharge": 30,
"gst": 0,
"cateringCharge": 0
}
}
],
"source": "irctc-api",
"_time": 0.048
}

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: 48ms avg
01Edge Ingress
12ms
02Edge Router
< 2ms
03Central PRS Tunnel
48ms avg
Ingress: ~15%Edge: <5%PRS Core: ~80%

Production SLAs & Latency

Deterministic throughput backed by enterprise uptime guarantees.

Latency Benchmark48ms avg
Uptime SLA99.95%
Rate Limits1,000 req/min
Cache Strategy12h Price Table Cache
01 // Capability

Itemized Fee Breakdown

Transparent audit of GST, Reservation Charge, and Superfast fee for seamless financial reporting in corporate expense apps.

02 // Capability

All-Class Comparison

Pass class=all to receive fares for First AC, 2A, 3A, Economy 3E, and Sleeper in a single API query.

03 // Capability

Tatkal & Dynamic Fare Support

Automatic computation of Tatkal charges and dynamic pricing surge adjustments.

Parameters Specification

Query and path parameters for /api/v1/trains/:trainNo/fare

trainNostringin: PATH
required

5-digit Indian Railways train number (e.g. 12558).

Example:12558
fromstringin: QUERY
required

Origin station code (e.g. ANVT).

Example:ANVT
tostringin: QUERY
required

Destination station code (e.g. NKE).

Example:NKE
classstringin: QUERY
optional

Travel class code (1A, 2A, 3A, 3E, SL, or all). Defaults to all.

Example:all
quotastringin: QUERY
optional

Quota code (GN = General, TQ = Tatkal). Defaults to GN.

Example:GN
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.

Yes, Indian Railways 5% GST on AC travel classes is broken down explicitly in breakup.gst.
Fare & Passenger Guide

How to Check Indian Railway PNR Status Programmatically

Pair ticket fare calculation with passenger verification workflows using production-tested Node.js and Python blueprints.

Read Tutorial

Related Railway Endpoints

$npm i irctc-api

Integrate Train Fare & Ticket Pricing API

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