Discover/Co API
live

Co APIirctc.co.inAPI

Query Indian Railways train schedules, seat availability with fares, trains between stations, and station codes via a structured JSON API.

Endpoint health
verified 4h ago
search_trains
get_availability
get_train_schedule
search_stations
4/4 passing latest checkself-healing
Endpoints
4
Updated
4h ago

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.

This call costs1 credit / call— charged only on success
Try it
Destination station code, 1-5 letters (station_code from search_stations), e.g. BCT.
Origin station code, 1-5 letters (station_code from search_stations), e.g. NDLS.
Journey date, ISO YYYY-MM-DD (IST calendar). Omitted = today in India.
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.
api.parse.bot/scraper/4cb03185-74ea-4b58-9a5b-c0662c659aa0/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/4cb03185-74ea-4b58-9a5b-c0662c659aa0/search_trains?to_station=BCT&from_station=NDLS&journey_date=2026-09-17' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

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-inapi-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 Indian Railways API — search trains, check availability, view schedule."""
from parse_apis.irctc_co_inapi_api import Irctc, Quota, InputNotFound

client = Irctc()

# Find stations in Mumbai to resolve the correct station code.
station = client.stations.search("mumbai", limit=3).first()
if station is not None:
    print(station.station_code, station.station_name, station.city)

# Search direct trains from Delhi to Mumbai on a given date.
for train in client.trains.search(from_station="NDLS", to_station="BCT", journey_date="2026-09-17", limit=5):
    print(train.train_number, train.train_name, train.departure_time, "->", train.arrival_time, train.available_classes)

# Drill into the first train to check seat availability in its first offered class.
train = client.trains.search(from_station="NDLS", to_station="BCT", journey_date="2026-09-17", limit=1).first()
if train is not None:
    try:
        avail = train.check_availability(
            travel_class=train.available_classes[0],
            journey_date="2026-09-17",
            quota=Quota.GENERAL,
        )
        print(avail.train_name, avail.travel_class, avail.fare.total_fare, avail.fare.currency)
        for day in avail.days:
            print(day.date, day.status, day.current_booking)
    except InputNotFound as e:
        print("availability not found:", e.message)

    # View the full stop-by-stop schedule for the same train.
    sched = train.schedule()
    print(sched.train_name, sched.origin_station, "->", sched.destination_station)
    if sched.stops is not None:
        for stop in sched.stops[:3]:
            print(stop.serial_number, stop.station_name, stop.arrival_time, stop.departure_time)

print("exercised: stations.search / trains.search / check_availability / schedule")
All endpoints · 4 totalmissing one? ·

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). A pair with no direct trains returns an empty trains list. 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, no pagination.

Input
ParamTypeDescription
to_stationrequiredstringDestination station code, 1-5 letters (station_code from search_stations), e.g. BCT.
from_stationrequiredstringOrigin station code, 1-5 letters (station_code from search_stations), e.g. NDLS.
journey_datestringJourney date, ISO YYYY-MM-DD (IST calendar). Omitted = today in India.
travel_classstringTwo-character class code to keep only trains offering it; values observed in available_classes include 1A, 2A, 3A, 3E, SL, 2S. Omitted = all trains.
Response
{
  "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",
    "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": [
        "SS",
        "PT",
        "GN",
        "HP",
        "LD",
        "DP",
        "TQ"
      ],
      "trains": [
        {
          "runs_on": [
            "Mon",
            "Tue",
            "Wed",
            "Thu",
            "Fri",
            "Sat",
            "Sun"
          ],
          "duration": "15:40",
          "flexi_fare": false,
          "to_station": "MMCT",
          "train_name": "MMCT TEJAS RAJ",
          "train_type": [
            "R"
          ],
          "distance_km": 1384,
          "arrival_time": "08:35",
          "from_station": "NDLS",
          "train_number": "12952",
          "departure_time": "16:55",
          "available_classes": [
            "1A",
            "2A",
            "3A"
          ]
        }
      ],
      "to_station": "BCT",
      "from_station": "NDLS",
      "journey_date": "2026-09-17",
      "travel_class": null,
      "total_direct_trains": 14
    },
    "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.

Reliability & maintenanceVerified

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.

Last verified
4h ago
Latest check
4/4 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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_availability status strings.
  • Render a full station-by-station route map from get_train_schedule stops with cumulative distances.
  • Autocomplete station code fields in a booking form using search_stations city/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_trains with travel_class.
  • Identify running days and overnight day offsets for multi-day train journeys from the runs_on and stop day fields.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 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.

Frequently asked questions
Does IRCTC offer an official developer API for train enquiry data?+
IRCTC does not publish a public developer API with open registration. Train enquiry data such as schedules and availability is accessible through the IRCTC website at irctc.co.in, but there is no documented REST API with API keys available to third-party developers.
What does `get_availability` return beyond a simple available/not-available flag?+
It returns an 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?+
The 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?+
Not currently. The API covers train search between stations, seat availability with fares, full timetables, and station code lookup. PNR status and live running position are not exposed by any of the four endpoints. You can fork this API on Parse and revise it to add those missing endpoints.
Can I look up trains that require a connection or transfer, not just direct trains?+
Not currently. 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.
Page content last updated . Spec covers 4 endpoints from irctc.co.inAPI.
Related APIs in TravelSee all →
irctc.co.in API
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.
enquiry.indianrail.gov.in API
Search for trains between Indian stations, check schedules, and look up station details to plan your rail journeys. Get real-time train information with support for captcha-protected searches to ensure reliable access to Indian Railways data.
railyatri.in API
Search trains between stations and get real-time information including live train status, timetables, seat availability, and PNR confirmation details. Find the perfect journey by autocompleting station and train names while checking current availability and train schedules.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.
thetrainline.com API
Search UK train stations and find the cheapest fares across date ranges, then generate direct booking links to complete your purchase on Trainline.com. Get real-time journey information to compare prices and book your tickets in seconds.
trainline.eu API
Search for train stations and routes across the UK and Europe, then find and compare available journeys with schedules and pricing. Book your ideal train trip by accessing real-time travel options directly from Trainline.com.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
trenitalia.com API
Search for trains across Italy, check real-time train status and delays, view station departure and arrival boards, and find available tickets all in one place. Get live traffic information and detailed train itineraries to plan your journey with complete visibility into schedules and service disruptions.