IRCTC APIirctc.co.in ↗
Search Indian Railways trains between stations, check fare breakdowns, and query real-time seat availability by class and quota via the IRCTC API.
What is the IRCTC API?
The IRCTC API covers 3 endpoints for querying Indian Railways data: search trains between any two station codes, retrieve itemized fare breakdowns by class and train number, and check seat availability across multiple dates and quotas. The search_trains endpoint returns the full list of trains on a route including schedules, available classes, and running days — all in a single call.
curl -X POST 'https://api.parse.bot/scraper/9555464a-ef27-4b52-a922-bfd83f4f8a6d/search_trains' \
-H 'X-API-Key: $PARSE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"date": "2026-08-18",
"source_station": "NDLS",
"destination_station": "BCT"
}'Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace irctc-co-in-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: IRCTC SDK — bounded, re-runnable; every call capped."""
from parse_apis.irctc_co_in_api import IRCTC, TrainNotFound
client = IRCTC()
# Search trains between New Delhi and Mumbai Central
for train in client.train_searches.search(
source_station="NDLS", destination_station="BCT", date="2026-08-01", limit=3
):
print(train.train_name, train.departure_time, train.duration, train.available_classes)
# Get fare for a specific train and class
fare_info = client.fare_results.get(
train_number="12952", source_station="NDLS",
destination_station="BVI", travel_class="2A"
)
print(fare_info.train_name, fare_info.fare.total_fare, fare_info.fare.base_fare)
# Check seat availability with error handling
try:
avail = client.availability_results.check(
train_number="12952", source_station="NDLS",
destination_station="BVI", date="2026-08-01",
travel_class="2A", quota="GN"
)
for entry in avail.availability[:3]:
print(entry.date, entry.status)
except TrainNotFound as e:
print(f"Train not found: {e.train_number}")
print("exercised: train_searches.search / fare_results.get / availability_results.check")
Search trains running between two stations on a given date. Returns all trains with their schedule, available classes, and running days. Results include both direct trains and nearby-station options the railway shows for the route.
| Param | Type | Description |
|---|---|---|
| daterequired | string | Journey date in ISO format YYYY-MM-DD. |
| source_stationrequired | string | Source station code (e.g. NDLS for New Delhi, BCT for Mumbai Central, HWH for Howrah). |
| destination_stationrequired | string | Destination station code (e.g. BCT for Mumbai Central, MAS for Chennai). |
{
"type": "object",
"fields": {
"date": "journey date queried",
"trains": "array of train objects with schedule and class info",
"total_trains": "number of trains found",
"source_station": "source station code",
"destination_station": "destination station code"
},
"sample": {
"data": {
"date": "2026-08-01",
"trains": [
{
"distance": "1355",
"duration": "14:43",
"to_station": "BVI",
"train_name": "MMCT TEJAS RAJ",
"train_type": [
"R"
],
"arrival_time": "07:38",
"from_station": "NDLS",
"running_days": {
"fri": true,
"mon": true,
"sat": true,
"sun": true,
"thu": true,
"tue": true,
"wed": true
},
"train_number": "12952",
"departure_time": "16:55",
"available_classes": [
"1A",
"2A",
"3A"
]
}
],
"total_trains": 16,
"source_station": "NDLS",
"destination_station": "BCT"
},
"status": "success"
}
}About the IRCTC API
Train Search
The search_trains endpoint accepts a source station code, a destination station code, and a journey date in YYYY-MM-DD format. It returns an array of train objects under the trains field, each containing schedule details, the set of available travel classes, and the days on which each train runs. The total_trains field gives the count of results. Station codes follow Indian Railways conventions — for example, NDLS for New Delhi, BCT for Mumbai Central, and HWH for Howrah.
Fare Breakdown
The get_fare endpoint takes a 5-digit train_number, a travel_class code (such as SL, 3A, 2A, 1A, CC, or EC), and source and destination station codes. The fare object in the response itemizes base fare, reservation charge, superfast charge, dynamic pricing, catering charges, service tax, and total fare. The distance field returns the route distance in kilometres. Because fare queries require a future date, the endpoint internally targets a date 7 days out, so results always reflect a valid departure window.
Seat Availability
The check_availability endpoint checks seat status for a specific train, class, and date. The availability array returns status strings for the queried date and several consecutive days — values like AVAILABLE-0059 (seats remaining) or GNWL14/RAC28 (waitlist and RAC positions). An optional quota parameter lets you target specific booking pools: GN (General), TQ (Tatkal), PT (Premium Tatkal), LD (Ladies), or HP (Handicapped). The last_update_time field indicates when the availability data was last refreshed.
Station and Class Codes
All three endpoints use Indian Railways station codes and class codes as string inputs. Travel class codes map to: SL (Sleeper), 3A (AC 3-Tier), 2A (AC 2-Tier), 1A (AC First Class), CC (Chair Car), EC (Executive Chair Car), 3E (AC 3-Tier Economy), and 2S (Second Sitting). Using the correct five-character station code is required — the API does not accept full station names.
The IRCTC API is a managed, monitored endpoint for irctc.co.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when irctc.co.in changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official irctc.co.in API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a train comparison tool showing schedules and available classes for any Indian Railways route
- Display itemized fare estimates by class (SL, 3A, 2A, 1A) before users commit to a booking
- Monitor seat availability for a specific train across multiple dates to catch quota openings
- Integrate Tatkal or Premium Tatkal quota availability into a travel booking assistant
- Generate route cost breakdowns that separate base fare, reservation charges, and superfast surcharges
- Alert users when a waitlisted train (GNWL) moves to RAC or confirmed status over consecutive days
- Power a schedule lookup widget that shows running days and travel class options for any station pair
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does IRCTC provide an official public developer API?+
What does the availability array in check_availability actually contain?+
AVAILABLE-0059 means 59 seats remain, GNWL14/RAC28 means 14 on general waitlist with RAC at position 28, and REGRET/WL means no further bookings are being accepted. The last_update_time field tells you when those statuses were last refreshed.Can the API look up a station code from a full station name?+
NDLS, BCT, MAS), and there is no station name-to-code lookup endpoint. You can fork this API on Parse and revise it to add a station search endpoint.Does get_fare cover dynamic pricing surcharges for premium trains like Rajdhani or Shatabdi?+
fare object returned by get_fare includes a dynamic pricing field alongside base fare, reservation charge, superfast charge, catering, and service tax, so the breakdown covers the components applied to premium and superfast trains.