Discover/IRCTC API
live

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.

This API takes change requests — .
Endpoint health
verified 3d ago
search_trains
get_fare
check_availability
3/3 passing latest checkself-healing
Endpoints
3
Updated
17d ago

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.

This call costs2 credits / call— charged only on success
Try it
Journey date in ISO format YYYY-MM-DD.
Source station code (e.g. NDLS for New Delhi, BCT for Mumbai Central, HWH for Howrah).
Destination station code (e.g. BCT for Mumbai Central, MAS for Chennai).
api.parse.bot/scraper/9555464a-ef27-4b52-a922-bfd83f4f8a6d/<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 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"
}'
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-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")
All endpoints · 3 totalmissing one? ·

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.

Input
ParamTypeDescription
daterequiredstringJourney date in ISO format YYYY-MM-DD.
source_stationrequiredstringSource station code (e.g. NDLS for New Delhi, BCT for Mumbai Central, HWH for Howrah).
destination_stationrequiredstringDestination station code (e.g. BCT for Mumbai Central, MAS for Chennai).
Response
{
  "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.

Reliability & maintenanceVerified

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.

Last verified
3d ago
Latest check
3/3 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 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
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 provide an official public developer API?+
IRCTC does not offer a publicly accessible developer API. Their systems are gated behind the irctc.co.in platform with no documented public API endpoint or developer portal for third-party access.
What does the availability array in check_availability actually contain?+
It contains status strings for the queried date and several consecutive dates after it. Each entry reflects the current booking state for that day — for example, 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?+
Not currently. All three endpoints require valid Indian Railways station codes as inputs (e.g. 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?+
Yes. The 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.
Does the API support PNR status lookups or booking history?+
Not currently. The API covers train search, fare breakdown, and seat availability. PNR status and booking history are not exposed by any of the three endpoints. You can fork this API on Parse and revise it to add a PNR status endpoint.
Page content last updated . Spec covers 3 endpoints from irctc.co.in.
Related APIs in TravelSee all →
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.
12go.asia API
Search for train trips across Asia and instantly get available routes with schedules, operators, prices by cabin class, and direct booking links. Plan your rail journey with comprehensive trip options and real-time pricing information all in one place.
redbus.in API
Search and explore bus and train services on redBus.in. Look up city and station suggestions, find available routes, check schedules, and view seat layouts and fare details.
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.
rome2rio.com API
Find and compare train routes between cities worldwide, instantly viewing travel duration, number of stops, carrier information, ticket prices, and direct booking links. Streamline your train journey planning by accessing comprehensive route options and pricing in one place.