Discover/RailYatri API
live

RailYatri APIrailyatri.in

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

This API takes change requests — .
Endpoint health
verified 4d ago
get_pnr_status
search_train_autocomplete
search_station_autocomplete
get_train_timetable
get_seat_availability
8/8 passing latest checkself-healing
Endpoints
8
Updated
1mo ago

What is the RailYatri API?

The RailYatri API exposes 8 endpoints covering live train positions, static timetables, PNR status checks, seat availability with fare breakdowns, and station-to-station train searches. The get_live_train_status endpoint returns real-time delay, current station, platform, and the full route with coordinates and food data. Autocomplete helpers for both trains and stations let you resolve codes before calling any of the data endpoints.

This call costs1 credit / call— charged only on success
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 · 8 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

Train Discovery and Lookup

Start with search_train_autocomplete (accepts a partial train number or name) to get a train_number and train_name. Pair it with search_station_autocomplete to resolve station_code, city, and lat/lng coordinates for any partial station name or code. Both endpoints return arrays you can use immediately as inputs to the data endpoints.

Schedules, Live Status, and Fares

get_train_timetable returns the static schedule for a given train_number: every stop with arrival, departure, halt, day (day number from source), distance, and platform. The days_of_run array tells you which days of the week the train operates.

get_live_train_status adds a real-time layer: train_info includes current_station, delay, status, last_updated, platform, and whether today is a run day (is_run_day). The full_route array adds food_data and coordinates per stop. When a train is not currently running, stations will be empty and train_info.status will say so explicitly.

get_train_fare returns a fares array broken down by class_code and quota, with ticket_fare, catering_charge, total_fare, current availability, and confirmation probability (cp_perc). It also returns distance in km and duration for the segment.

Availability and Booking Lookups

get_seat_availability checks seat availability for a specific train, class, quota, and date range. Each item in the availability array includes availablity_status, ticket_fare, total_fare, seat_avl_text, and cp_perc (confirmation probability percentage). search_trains_between_stations lists all trains on a route for a given date, including departure, arrival, duration, available classes, pantry flag, and run_days. get_pnr_status accepts a 10-digit PNR and returns a status boolean indicating whether the record was found.

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
4d ago
Latest check
8/8 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 real-time delay and platform information for a train on a departure board app using get_live_train_status.
  • Build a route planner that lists all trains between two stations on a chosen date with fares and class availability.
  • Let users check whether their PNR is still active before traveling using get_pnr_status.
  • Show a full stop-by-stop timetable with halt durations and platform numbers from get_train_timetable.
  • Render a seat availability calendar for a specific train and class using the multi-date availability array from get_seat_availability.
  • Offer a train-name autocomplete widget backed by search_train_autocomplete to reduce input errors.
  • Compare fares across all travel classes on a given segment using the fares array from get_train_fare.
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 RailYatri have an official developer API?+
RailYatri does not publish a documented public developer API. The data in this API is sourced directly from railyatri.in.
What does `get_live_train_status` return when the train is not running today?+
When a train is not currently running, train_info.is_run_day will reflect that, train_info.status will include a descriptive message, and the stations array will be empty. The full_route array with static stop data and coordinates is still returned.
What confirmation probability data is available for seat availability?+
Both get_seat_availability and get_train_fare return a cp_perc field per date or class entry, representing the estimated probability that a waitlisted ticket will be confirmed. Neither endpoint exposes coach-level seat maps or berth-by-berth allocation.
Does the API cover historical train running data or past PNR records?+
Not currently. The API covers live and upcoming data: real-time train status, future seat availability, and active PNR records. Historical running history and archived PNR records are not exposed. You can fork this API on Parse and revise it to add an endpoint targeting historical data if the source makes it accessible.
Can I look up trains for a past date using `search_trains_between_stations`?+
No — the date parameter must be a future date. Past dates will not return valid results. If you need timetable data without a date constraint, use get_train_timetable with a train_number instead. You can fork this API on Parse and revise it to handle date validation or fallback logic.
Page content last updated . Spec covers 8 endpoints from railyatri.in.
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.
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.
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.