Co APIirctc.co.inAPI ↗
Query Indian Railways train schedules, seat availability with fares, trains between stations, and station codes via a structured JSON API.
What is the Co API?
The IRCTC API exposes 4 endpoints covering Indian Railways public enquiry data: trains between two stations, seat availability with full fare breakdowns, stop-by-stop timetables, and a station code lookup. The get_availability endpoint returns per-day availability status and an itemized fare object including base fare, reservation charge, superfast charge, and dynamic fare components — all in INR.
curl -X GET 'https://api.parse.bot/scraper/4cb03185-74ea-4b58-9a5b-c0662c659aa0/search_trains?to_station=BCT&from_station=NDLS&journey_date=2026-10-13&travel_class=1A' \ -H 'X-API-Key: $PARSE_API_KEY'
Lists direct trains running between two stations on a journey date, one row per train, with departure/arrival times, running days, distance and the classes offered. Station inputs accept any code in the IRCTC station master (search_stations gives codes for a city); the site groups city stations, so a search for NDLS to BCT also returns trains from H NIZAMUDDIN (NZM) or to BANDRA TERMINUS (BDTS), and each row carries its own from_station/to_station. Optional travel_class narrows the list to trains offering that class (applied after the site returns the full list; total_direct_trains keeps the unfiltered count). When the site reports no direct trains at all (total_direct_trains 0), a second request fetches the site's one-stop (connecting) journeys and the response carries them in suggestions: one_stop_journeys lists each itinerary with its two legs, change station, waiting and total minutes; trains_near_origin lists the distinct first legs (trains departing a station in the origin area, e.g. JAT when SVDK was asked) and trains_near_destination the distinct final legs (trains arriving at a station in the destination area), each tagged with the requested_station it stands in for. suggestions is null whenever direct trains exist, and suggestions.message carries the site's text when it has no connecting journeys either. Dates in the past or beyond the advance reservation period are rejected with a validation error. All times are local Indian time (IST). One upstream request (two when no direct trains), no pagination.
| Param | Type | Description |
|---|---|---|
| to_stationrequired | string | Destination station code, 1-5 letters (station_code from search_stations), e.g. BCT. |
| from_stationrequired | string | Origin station code, 1-5 letters (station_code from search_stations), e.g. NDLS. |
| journey_date | string | Journey date, ISO YYYY-MM-DD (IST calendar). Omitted = today in India. |
| travel_class | string | Two-character class code to keep only trains offering it; values observed in available_classes include 1A, 2A, 3A, 3E, SL, 2S. Omitted = all trains. |
{
"type": "object",
"fields": {
"quotas": "array of quota codes the site offers for this search (usable as quota in get_availability)",
"trains": "array of train rows: train_number (5-digit string), train_name, from_station/to_station (actual boarding/alighting station codes), departure_time/arrival_time (HH:MM IST), duration (HH:MM), distance_km (integer), runs_on (array of Mon..Sun), available_classes (array of class codes), train_type (array of site type codes, e.g. R = Rajdhani, O = other), flexi_fare (boolean)",
"to_station": "destination station code as requested",
"suggestions": "null when direct trains exist; otherwise object: message (site text when no connecting journeys, else null), one_stop_journeys (array: legs = array of train rows as in trains plus journey_date of that leg, change_station, principal_change boolean, waiting_minutes, total_duration_minutes, total_distance_km), trains_near_origin (distinct first legs departing a station in the origin area; train row plus journey_date and requested_station = the origin code asked for), trains_near_destination (distinct final legs arriving in the destination area; train row plus journey_date and requested_station = the destination code asked for)",
"from_station": "origin station code as requested",
"journey_date": "ISO date searched",
"travel_class": "class filter applied, or null",
"total_direct_trains": "integer count of direct trains the site returned before any class filter"
},
"sample": {
"data": {
"quotas": [],
"trains": [],
"to_station": "CAPE",
"suggestions": {
"message": null,
"one_stop_journeys": [
{
"legs": [
{
"runs_on": [
"Wed",
"Sat",
"Sun"
],
"duration": "54:50",
"flexi_fare": false,
"to_station": "MAS",
"train_name": "ANDAMAN EXPRESS",
"train_type": [
"O"
],
"distance_km": 2797,
"arrival_time": "07:00",
"from_station": "JAT",
"journey_date": "2026-09-23",
"train_number": "16032",
"departure_time": "00:10",
"available_classes": [
"2A",
"3A",
"SL"
]
},
{
"runs_on": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"duration": "11:45",
"flexi_fare": false,
"to_station": "CAPE",
"train_name": "KANYAKUMARI EXP",
"train_type": [
"O"
],
"distance_km": 717,
"arrival_time": "05:35",
"from_station": "TBM",
"journey_date": "2026-09-25",
"train_number": "12633",
"departure_time": "17:50",
"available_classes": [
"1A",
"2A",
"3A",
"3E",
"SL"
]
}
],
"change_station": "MAS",
"waiting_minutes": 650,
"principal_change": true,
"total_distance_km": 3514,
"total_duration_minutes": 4645
}
],
"trains_near_origin": [
{
"runs_on": [
"Wed",
"Sat",
"Sun"
],
"duration": "54:50",
"flexi_fare": false,
"to_station": "MAS",
"train_name": "ANDAMAN EXPRESS",
"train_type": [
"O"
],
"distance_km": 2797,
"arrival_time": "07:00",
"from_station": "JAT",
"journey_date": "2026-09-23",
"train_number": "16032",
"departure_time": "00:10",
"available_classes": [
"2A",
"3A",
"SL"
],
"requested_station": "SVDK"
}
],
"trains_near_destination": [
{
"runs_on": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"duration": "11:45",
"flexi_fare": false,
"to_station": "CAPE",
"train_name": "KANYAKUMARI EXP",
"train_type": [
"O"
],
"distance_km": 717,
"arrival_time": "05:35",
"from_station": "TBM",
"journey_date": "2026-09-25",
"train_number": "12633",
"departure_time": "17:50",
"available_classes": [
"1A",
"2A",
"3A",
"3E",
"SL"
],
"requested_station": "CAPE"
}
]
},
"from_station": "SVDK",
"journey_date": "2026-09-23",
"travel_class": null,
"total_direct_trains": 0
},
"status": "success"
}
}About the Co API
Train Search and Availability
The search_trains endpoint accepts from_station and to_station codes plus an optional journey_date (ISO YYYY-MM-DD, IST) and an optional travel_class filter. It returns a list of direct trains with departure and arrival times, running days, distance, and the available_classes each train offers. It also returns the list of valid quota codes (e.g. general, tatkal, ladies) that can be passed to get_availability.
Once you have a train_number from search_trains, call get_availability with the same station pair, a travel_class, and a quota code. The response includes an availability array with one row per departure day (typically the queried date plus the next few days), each carrying a status string and a current_booking boolean. The fare object breaks the ticket cost into base_fare, reservation_charge, superfast_charge, dynamic_fare, tatkal_fare, catering_charge, and total_fare, all in INR.
Timetables and Station Lookup
get_train_schedule returns the complete halt sequence for any 5-digit train_number: each stop includes station_code, station_name, arrival_time and departure_time (HH:MM IST, null at origin or terminus), halt_time, cumulative distance_km, and a day counter for overnight trains. The response also surfaces runs_on (Mon–Sun running days), origin_station, and destination_station.
search_stations resolves plain-text city or station names to the station codes required by every other endpoint. A minimum 2-character query performs a case-insensitive substring match across codes, names, states, and aliases, returning up to 200 results with a total_matches count showing how many matched before the cap. An exact code match is ranked first.
The Co API is a managed, monitored endpoint for irctc.co.inAPI — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when irctc.co.inAPI 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.inAPI 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 planner that checks seat availability and fares across multiple quotas before booking.
- Display real-time berth status for a specific train, class, and date using
get_availabilitystatus strings. - Render a full station-by-station route map from
get_train_schedulestops with cumulative distances. - Autocomplete station code fields in a booking form using
search_stationscity/name queries. - Compare total fares between general and tatkal quotas for the same train and class.
- Filter only trains offering a specific class (e.g. 1A or SL) on a route using
search_trainswithtravel_class. - Identify running days and overnight day offsets for multi-day train journeys from the
runs_onand stop day fields.
| 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 offer an official developer API for train enquiry data?+
What does `get_availability` return beyond a simple available/not-available flag?+
availability array with one entry per departure day, each containing a status string (the site's exact availability label) and a current_booking boolean. It also returns a fare object with base_fare, reservation_charge, superfast_charge, dynamic_fare, tatkal_fare, catering_charge, and total_fare in INR, plus distance_km, train_name, and last_updated indicating data freshness.How many days of availability does `get_availability` return?+
availability array typically contains the queried date plus the next few departure days — observed as around 4 rows total. The exact count depends on what the source returns for that train and quota combination on a given query.Does the API cover PNR status or live train running status?+
Can I look up trains that require a connection or transfer, not just direct trains?+
search_trains returns only direct trains between the two given station codes. Multi-leg or connecting route planning is not covered. You can fork this API on Parse and revise it to add an endpoint that chains multiple search_trains calls for indirect routes.