Discover/RailYatri API
live

RailYatri APIrailyatri.in

Access live train status, PNR checks, seat availability, timetables, and trains between stations from RailYatri via a single REST API.

Endpoint health
verified 8h ago
search_train_autocomplete
get_live_train_status
search_trains_between_stations
search_station_autocomplete
get_pnr_status
7/7 passing latest checkself-healing
Endpoints
7
Updated
14d ago

What is the RailYatri API?

The RailYatri API exposes 7 endpoints covering Indian Railways data including live train tracking, static timetables, PNR lookups, seat availability with fare breakdowns, and station-to-station train searches. The get_live_train_status endpoint returns real-time position, delay, and per-station arrival and departure data for any active train. Autocomplete endpoints for both trains and stations make it straightforward to resolve names to the codes and numbers required by other endpoints.

Try it
Partial train number or name to search for
api.parse.bot/scraper/3dba3431-db8a-42f9-b36f-788630e9c873/<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/3dba3431-db8a-42f9-b36f-788630e9c873/search_train_autocomplete?query=rajdhani' \
  -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 railyatri-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.

"""
RailYatri API – search trains, check live status, timetables, and seat availability.
"""
from parse_apis.railyatri_api import RailYatri, TravelClass, Quota, TrainSummary, RouteStop

railyatri = RailYatri()

# Search for stations by name
for station in railyatri.stations.search(query="mumbai"):
    print(station.station_name, station.station_code, station.city)

# Search for trains between two stations on a given date
for train_summary in railyatri.trains.between_stations(from_code="NDLS", to_code="HWH", date="2026-06-20"):
    print(train_summary.train_name, train_summary.departure, train_summary.arrival, train_summary.duration)
    print(train_summary.classes, train_summary.run_days)

    # Navigate from summary to full Train detail (C9 nav-op)
    full_train = train_summary.details()
    print(full_train.train_number, full_train.train_name)
    break

# Get a specific train by number and check its timetable
train = railyatri.trains.get(train_number="12301")
timetable = train.timetable()
print(timetable.train_name, timetable.source, timetable.destination)
for stop in timetable.stations:
    print(stop.station_name, stop.station_code, stop.arrival, stop.departure)

# Check live running status
status = train.live_status()
print(status.train_info.number, status.train_info.name, status.train_info.message)
for route_stop in status.full_route:
    print(route_stop.station_name, route_stop.station_code, route_stop.distance_from_source)

# Check seat availability with typed enums
avail = train.seat_availability(
    from_code="HWH",
    to_code="NDLS",
    class_type=TravelClass.THIRD_AC,
    quota=Quota.GENERAL,
)
for entry in avail.availability:
    print(entry.availablity_date, entry.seat_avl_text, entry.ticket_fare, entry.total_fare)

# Check PNR status
pnr = railyatri.pnrstatuses.check(pnr_number="1234567890")
print(pnr.status)
All endpoints · 7 totalmissing one? ·

Search for trains by partial number or name. Returns matching trains with their number and full name. Useful for resolving a train_number before calling get_live_train_status, get_train_timetable, or get_seat_availability.

Input
ParamTypeDescription
queryrequiredstringPartial train number or name to search for
Response
{
  "type": "object",
  "fields": {
    "trains": "array of objects each containing train_number and train_name"
  },
  "sample": {
    "data": {
      "trains": [
        {
          "train_name": "HOWRAH - NEW DELHI Rajdhani Express",
          "train_number": "12301"
        },
        {
          "train_name": "NEW DELHI - HOWRAH Rajdhani Express",
          "train_number": "12302"
        }
      ]
    },
    "status": "success"
  }
}

About the RailYatri API

Core Endpoints and Data

The API centers on two real-time lookups and two static ones. get_live_train_status accepts a 5-digit train_number and returns a train_info object with current_station, delay, and is_run_day, plus an stations array of upcoming stops with per-station arrival/departure times and delay figures, and a full_route covering every stop on the route. get_train_timetable returns the static schedule for the same train: each station in the stations array carries arrival, departure, halt, day, distance, and platform, along with top-level days_of_run indicating which days the service operates.

Availability and PNR

get_seat_availability takes a train_number, from_code, to_code, and optionally date, quota (e.g. GN, TQ), and class_type (1A, 2A, 3A, SL, CC, 2S). It returns an availability array with one object per upcoming date, each containing availablity_status, ticket_fare, total_fare, and seat_avl_text for the chosen class and quota. A last_updated timestamp indicates data freshness. get_pnr_status accepts a 10-digit pnr_number and returns a status boolean indicating whether PNR data was located.

Search and Autocomplete

search_trains_between_stations takes from_code, to_code, and a date in YYYY-MM-DD format and returns a trains array with per-train departure, arrival, duration, run_days, train_type, and total_trains count. The two autocomplete endpoints — search_train_autocomplete and search_station_autocomplete — accept partial names or codes. The station endpoint is especially useful because it returns lat, lng, and city alongside station_code, which other endpoints require as input.

Reliability & maintenanceVerified

The RailYatri API is a managed, monitored endpoint for railyatri.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when railyatri.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 railyatri.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
8h ago
Latest check
7/7 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
  • Display live delay and current position for a train on a journey-tracking dashboard using get_live_train_status.
  • Show seat availability and fares across Tatkal and General quota for a specific train and class before booking.
  • Build a train-search interface for a given origin-destination pair and travel date using search_trains_between_stations.
  • Provide a PNR status checker widget that confirms whether a booking record exists.
  • Render a full station-by-station timetable including platform numbers and halt durations for a selected train.
  • Power autocomplete inputs for both station and train name fields using station codes and coordinates from the search endpoints.
  • Alert travelers when a train's delay value from get_live_train_status exceeds a defined threshold.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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 RailYatri have an official public developer API?+
RailYatri does not publish a documented public developer API or offer API keys to third-party developers. The Parse API is the structured way to access this data programmatically.
What does get_pnr_status actually return beyond a boolean?+
Currently it returns a status boolean indicating whether PNR data was found — passenger names, coach/berth assignments, and booking-class details are not included in the response. You can fork this API on Parse and revise it to add those fields if they become available.
Does the live train status endpoint work when a train is not running on a given day?+
The train_info object includes an is_run_day field that indicates whether the train is scheduled to operate on the current date. When the train is not actively running, real-time position and delay data will not be populated, but static route data in full_route is still returned.
Can I retrieve historical train running data or delays over past dates?+
The API does not expose historical running records or delay archives. get_live_train_status reflects current-day status and get_train_timetable returns static scheduled times. You can fork the API on Parse and revise it to add an endpoint if RailYatri exposes historical data on the source site.
How do I get the station codes required by get_seat_availability and search_trains_between_stations?+
search_station_autocomplete accepts a partial station name or code in the query parameter and returns matching stations with their station_code values. Pass those codes as from_code and to_code in the availability and train-search endpoints.
Page content last updated . Spec covers 7 endpoints from railyatri.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.
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.
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.
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.
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.
rfi.it API
Check real-time train schedules and station information across Italy's railway network, search for stations, and get live alerts about delays and service disruptions. Monitor train circulation status and access detailed station mappings to plan your journeys efficiently.
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.
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.