Discover/Rome2Rio API
live

Rome2Rio APIrome2rio.com

Search train connections between cities worldwide via the Rome2Rio API. Returns carrier, duration, stops, prices by class, and booking links.

This API takes change requests — .
Endpoint health
verified 14h ago
search_trains
1/1 passing latest checkself-healing
Endpoints
1
Updated
14h ago

What is the Rome2Rio API?

The Rome2Rio Train Routes API exposes 1 endpoint — search_trains — that returns up to multiple train service options between any two city pairs worldwide, including carrier name, journey duration, intermediate stops, indicative ticket prices by class, and direct booking links. It resolves freeform city name inputs like 'Tashkent' or 'Paris' into structured route-level summaries without requiring station codes or timetable lookups.

Try it
Departure city name (e.g. 'Paris', 'Tashkent', 'London').
ISO 4217 currency code for prices (e.g. 'USD', 'EUR', 'GBP').
ISO 639-1 language code for response text.
Arrival city name (e.g. 'Lyon', 'Samarkand', 'Manchester').
api.parse.bot/scraper/bae75b3f-6cd9-4cf9-acf4-140384115708/<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/bae75b3f-6cd9-4cf9-acf4-140384115708/search_trains?origin=Tashkent&currency=USD&language=en&destination=Samarkand' \
  -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 rome2rio-com-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: Rome2Rio SDK — search train connections between cities."""
from parse_apis.rome2rio_com_api import Rome2Rio, InvalidInput

client = Rome2Rio()

# Search trains from Tashkent to Samarkand
for option in client.train_search_results.search(origin="Tashkent", destination="Samarkand", limit=3):
    print(option.carrier, option.duration, option.stops)
    for price in option.prices:
        print(f"  {price.class_name}: {price.currency} {price.price}")

# Get the first result for a European route
result = client.train_search_results.search(origin="Paris", destination="Lyon", limit=1).first()
try:
    detail = client.train_search_results.search(origin="Tashkent", destination="Samarkand", limit=1).first()
    print(detail.carrier, detail.train_names, detail.booking_url)
except InvalidInput as e:
    print("invalid input:", e)

print("exercised: train_search_results.search")
All endpoints · 1 totalmissing one? ·

Search for train connections between two cities. Returns all available train services with carrier name, line/train identifiers, journey duration, intermediate stops, indicative prices by class, frequency, and a link to book. Results are route-level summaries (not real-time schedules); a single request returns all known services for the city pair.

Input
ParamTypeDescription
originrequiredstringDeparture city name (e.g. 'Paris', 'Tashkent', 'London').
currencystringISO 4217 currency code for prices (e.g. 'USD', 'EUR', 'GBP').
languagestringISO 639-1 language code for response text.
destinationrequiredstringArrival city name (e.g. 'Lyon', 'Samarkand', 'Manchester').
Response
{
  "type": "object",
  "fields": {
    "origin": "string — origin city as resolved by the service",
    "currency": "string — ISO currency code used for prices",
    "destination": "string — destination city as resolved by the service",
    "total_options": "integer — number of train options returned",
    "train_options": "array of train service objects with carrier, duration, stops, prices, and booking link"
  },
  "sample": {
    "data": {
      "origin": "Tashkent",
      "currency": "USD",
      "destination": "Samarkand",
      "total_options": 2,
      "train_options": [
        {
          "stops": [
            "Tashkent Central",
            "Samarkand"
          ],
          "prices": [
            {
              "price": 33,
              "currency": "USD",
              "price_low": 32,
              "class_name": "Business class",
              "price_high": 35
            },
            {
              "price": 23,
              "currency": "USD",
              "price_low": null,
              "class_name": "Econom class",
              "price_high": null
            }
          ],
          "carrier": "Uzbekistan Railways (High Speed Trains)",
          "duration": "2h 13m",
          "booking_url": "https://eticket.railway.uz/en/home",
          "train_names": [
            "766Ф",
            "770Ф",
            "768Ф"
          ],
          "duration_seconds": 7980,
          "frequency_per_week": 37
        },
        {
          "stops": [
            "Tashkent Central",
            "Gulistan",
            "Djizak",
            "Samarkand"
          ],
          "prices": [
            {
              "price": 12,
              "currency": "USD",
              "price_low": 11,
              "class_name": "Sleeper",
              "price_high": 13
            },
            {
              "price": 16,
              "currency": "USD",
              "price_low": 15,
              "class_name": "Coupe",
              "price_high": 17
            },
            {
              "price": 28,
              "currency": "USD",
              "price_low": 26,
              "class_name": "SV",
              "price_high": 29
            }
          ],
          "carrier": "Uzbekistan Railways (OTY)",
          "duration": "3h 9m",
          "booking_url": "https://eticket.railway.uz/en/home",
          "train_names": [
            "710F",
            "712F",
            "712Ф/704Ч"
          ],
          "duration_seconds": 11340,
          "frequency_per_week": 26
        }
      ]
    },
    "status": "success"
  }
}

About the Rome2Rio API

What the API Returns

The search_trains endpoint accepts two required parameters — origin and destination — as plain city names and returns a structured response with total_options (the count of distinct train services found) and a train_options array. Each element in that array carries the carrier name, train or line identifier, total journey duration, a list of intermediate stops, indicative prices broken down by class, service frequency, and a booking link. The origin and destination fields in the response reflect the city names as resolved by Rome2Rio, which may differ slightly from the raw input strings.

Parameters and Localization

Beyond the required city pair, the endpoint accepts currency (ISO 4217 code, e.g. USD, EUR) to normalize all returned prices into a single currency, and language (ISO 639-1 code, e.g. en, fr) to localize response text such as carrier names and stop labels. This makes it straightforward to build localized travel tools without post-processing the response.

Coverage and Data Shape

Results are route-level summaries rather than real-time schedules. Prices are indicative — sourced from Rome2Rio's aggregated data — and the booking links point to relevant purchase pages. The API covers intercity train services globally, including routes across Europe, Central Asia, and other regions where Rome2Rio indexes rail carriers. City name resolution is handled server-side, so inputs like 'London', 'Samarkand', or 'Lyon' are accepted without additional geocoding steps.

Reliability & maintenanceVerified

The Rome2Rio API is a managed, monitored endpoint for rome2rio.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when rome2rio.com 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 rome2rio.com 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
14h ago
Latest check
1/1 endpoint 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 train route options with prices and carriers in a multi-modal travel planning app.
  • Compare journey durations between competing train services on the same city pair.
  • Surface booking links for train tickets inside a trip itinerary builder.
  • Build a fare-monitoring tool that tracks indicative price changes between two cities.
  • Populate a travel guide with carrier and stop data for intercity rail routes.
  • Offer localized train route results in different currencies for international travel platforms.
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 Rome2Rio have an official developer API?+
Yes. Rome2Rio offers an official API at https://www.rome2rio.com/documentation/api/ aimed at travel businesses. It requires a commercial agreement and provides access to multi-modal routing data including trains, flights, and buses.
What does each object in the `train_options` array actually contain?+
Each object includes the carrier name, line or train identifier, total journey duration, a list of intermediate stops, indicative prices broken out by class (where available), service frequency, and a direct booking link. The top-level response also tells you the resolved origin and destination strings and the total_options count.
Are prices real-time or live seat availability returned?+
Prices are indicative route-level figures aggregated by Rome2Rio, not live fares pulled from a ticketing system. Seat availability and dynamic pricing are not part of the response. The booking links point users to purchase pages where live availability can be checked.
Does the API return bus, flight, or ferry alternatives for the same city pair?+
Not currently. The search_trains endpoint covers train services only. Rome2Rio's underlying data includes other transport modes, but those are not exposed by this API. You can fork it on Parse and revise it to add endpoints for buses, flights, or ferries.
Can I search by station code or address instead of city name?+
The endpoint accepts city names as plain strings for both origin and destination; station codes or street addresses are not supported inputs at this time. The service resolves the city names internally and returns the matched names in the response. You can fork the API on Parse and revise it to add station-level resolution if your use case requires it.
Page content last updated . Spec covers 1 endpoint from rome2rio.com.
Related APIs in TravelSee all →
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.
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.
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.
omio.com API
Search and compare train, bus, and flight trips across multiple providers in real-time, with detailed pricing breakdowns and the ability to view fares across different dates. Find the best deals by exploring popular destinations, autocompleting location searches, and analyzing price variations to plan your ideal journey.
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.
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.
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.