Irctc APIirctc.co.in ↗
Search for trains between Indian Railway stations and instantly check fares, seat availability, and schedules all in one place. Book your journey with real-time information about train options and pricing through IRCTC Railway data.
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-01",
"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
The Irctc API on Parse exposes 3 endpoints for the publicly available data on irctc.co.in. Calls return JSON over HTTPS and are billed per successful response.
Pin a release with the API-Snapshot-Version header so canonical updates don't silently change your contract.