Discover/enquiry.indianrail.gov.in API
live

enquiry.indianrail.gov.in APIenquiry.indianrail.gov.in

Access Indian Railways train schedules, station lists, and trains between stations via 5 endpoints covering the enquiry.indianrail.gov.in portal.

Endpoints
5
Updated
3mo ago
Try it

No input parameters required.

api.parse.bot/scraper/ca465a89-6791-41cd-aead-47677fe7a343/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/ca465a89-6791-41cd-aead-47677fe7a343/get_trains' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 5 totalclick to expand

Get list of all available trains with their numbers and names from Indian Railways.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "trains": "array of strings, each in format 'TRAIN_NUMBER - TRAIN_NAME'"
  },
  "sample": {
    "data": {
      "trains": [
        "17289 - CCT MYS EXPRESS",
        "22637 - WEST COAST SFEXP",
        "22638 - WESTCOAST SF EXP"
      ]
    },
    "status": "success"
  }
}

About the enquiry.indianrail.gov.in API

The Indian Railways Enquiry API provides 5 endpoints covering train listings, station lookups, and schedule data from enquiry.indianrail.gov.in. The get_trains_between_stations endpoint returns departure/arrival times and class availability for a given source station code, destination station code, and travel date. Reference lists for all trains and all stations are available without any captcha requirement.

What the API Covers

Five endpoints expose the core data from the Indian Railways enquiry portal. get_trains returns a flat array of strings in TRAIN_NUMBER - TRAIN_NAME format, covering every train in the national network. get_stations returns an equivalent list in STATION_NAME - STATION_CODE format — these station codes are the values you pass as source and dest in downstream queries.

Captcha-Gated Endpoints

Two endpoints — get_train_schedule and get_trains_between_stations — require a solved captcha before they will return data. The flow is: call get_captcha first; it returns a captchaImage field containing a base64-encoded PNG and a contentType field. Decode the image, solve it, and pass the answer as the captcha parameter alongside the session_id and encryption_key values to whichever search endpoint you need.

Schedule and Search Responses

get_train_schedule accepts a train_no (e.g. '12002') and returns trainName, trainNumber, and a stationList array. Each element of stationList carries stationName, arrivalTime, departureTime, haltTime, and cumulative distance. get_trains_between_stations accepts source, dest, and date (in dd-mm-yyyy format) and returns a trainBtwnStnsList array where each object includes trainNumber, trainName, departureTime, arrivalTime, and available class information for that service on that date.

Session Handling

The captcha step initialises a session. The session_id and encryption_key returned from that flow must be forwarded with schedule and between-stations queries. Each captcha is tied to one session, so a new get_captcha call is required for each independent search session.

Common use cases
  • Build a train route planner that resolves station names to codes via get_stations and then queries get_trains_between_stations for available services.
  • Generate a timetable display for a specific train using the stationList from get_train_schedule, showing halt durations and cumulative distance.
  • Populate autocomplete fields in a booking UI using the full train and station lists from get_trains and get_stations.
  • Check class availability on a given travel date between two stations using the class information in trainBtwnStnsList.
  • Aggregate departure and arrival times across multiple trains on a corridor to find the fastest or most convenient services.
  • Validate that a station code exists before submitting it to a schedule query, by cross-referencing the get_stations list.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does Indian Railways have an official developer API?+
Indian Railways does not publish a documented public developer API for the enquiry.indianrail.gov.in portal. Rail data is available through the enquiry site itself, which this API surfaces.
What does `get_trains_between_stations` return beyond just train names?+
Each object in the trainBtwnStnsList array includes trainNumber, trainName, departureTime, arrivalTime, and available class information for the queried date. The response is scoped to the specific source-dest pair and date you supply, so you need a separate call per route-date combination.
Why do I need to call `get_captcha` before schedule searches?+
The get_train_schedule and get_trains_between_stations endpoints require a session initialised by a prior get_captcha call. get_captcha returns a base64 PNG (captchaImage) that must be solved; the answer, along with session_id and encryption_key, is then passed to the search endpoint. get_trains and get_stations do not require this step.
Does the API return live running status or platform numbers for trains?+
Not currently. The API covers static schedule data (stop-by-stop arrival/departure times, halt, distance) and between-stations availability for a given date. Live running status, platform assignments, and PNR status are not exposed. You can fork the API on Parse and revise it to add those missing endpoints.
Are trains from all Indian Railways zones included in `get_trains`?+
The get_trains endpoint returns all trains listed in the enquiry.indianrail.gov.in database, which covers the national network. However, very recently added or withdrawn trains may not immediately reflect in the list, as the data reflects the current state of the portal's records.
Page content last updated . Spec covers 5 endpoints from enquiry.indianrail.gov.in.
Related APIs in TravelSee all →
opentable.ca API
Search and discover restaurants on OpenTable, view detailed information like menus and reviews, and check real-time dining availability across metro areas. Find top-rated restaurants in your location and instantly see which tables are open for your preferred date and time.
fandango.com API
Search for movies and retrieve nearby theater listings with showtimes by ZIP code and date, plus showtimes for a specific movie at nearby theaters.
data.lime.bike API
Access real-time availability data for Lime bikes and scooters, including station locations, vehicle status, system alerts, and geofencing zones across multiple cities. Monitor micromobility inventory and service information to find nearby vehicles or plan your trips effectively.
turo.com API
Search for peer-to-peer car rentals across Turo by location and dates to browse available vehicles with pricing, specifications, and real-time availability. Get detailed information on specific cars to compare features and make rental decisions.
reservation.pc.gc.ca API
Access real-time campground availability and reservation data from the Parks Canada booking system. Search locations, retrieve available campsites and cabins, filter by equipment type, and review operating date schedules across the national park network. Includes detailed resource metadata and map-based availability overviews.
bahn.com API
Search German train schedules and stations, find connections between destinations, and compare ticket prices across Deutsche Bahn routes. Get real-time station information and transit association details to plan your train journey efficiently.
united.com API
Search United Airlines flights, check real-time flight status, and view detailed seat maps to plan your perfect trip. Compare fare options and use airport autocomplete to quickly find your departure and arrival cities.
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.