# /rome2rio/routes/search

`POST /api/rome2rio/routes/search`

Price: 5 credits

Plan all the ways to travel between two places with Rome2Rio's multimodal trip planner. Give an origin and destination by name or by coordinates and get every ranked route (train, bus, drive, fly, ferry, rideshare and combinations) with total duration, indicative price ranges by class and currency, per-leg segments and transfers, the transport mode and operating carrier of each leg, service frequency and operating days, the boarding and alighting stops, ticket booking deeplinks and the map polyline of each line. Prices are indicative ranges, not live fares.

## How to use it

Search all travel routes between an origin and destination (by name via origin/destination or by coordinates via origin_pos/destination_pos as 'lat,lng'). Set currency (ISO) and language_code for localized names. Returns routes with name, duration (seconds), transport_kinds, is_connectable, transfer_durations (connection/wait seconds between consecutive segments), origin/destination places, indicative_prices (fare_class, currency_code, price, price_low, price_high), booking_links (ticket deeplinks), booking_configuration (max passengers, age groups), transit_guides (editorial articles) and segments (with per-leg booking_links, booking_configuration and transit_guides) -> options -> hops (vehicle_kind, carrier, line with stops and polyline, frequency, operating_days, codeshares, indicative_prices).

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `origin` (string, nullable) — Origin place name (city, station, airport) (examples: "New York")
- `origin_pos` (string, nullable) — Origin coordinates as 'lat,lng' (examples: "40.7128,-74.0060"; pattern: ^-?\d{1,3}(\.\d+)?,-?\d{1,3}(\.\d+)?$)
- `destination` (string, nullable) — Destination place name (city, station, airport) (examples: "Boston")
- `destination_pos` (string, nullable) — Destination coordinates as 'lat,lng' (examples: "42.3601,-71.0589"; pattern: ^-?\d{1,3}(\.\d+)?,-?\d{1,3}(\.\d+)?$)
- `currency` (string) — ISO 4217 currency code for indicative prices (default: "USD"; examples: "USD", "EUR", "GBP"; minLength: 3; maxLength: 3)
- `language_code` (string) — Language/locale for localized route and place names (default: "en"; examples: "en", "es", "fr")
- `count` (integer, required) — Max number of routes to return (min: 1)

## Response

### 200 — Successful Response

- `@type` (string) (default: "Rome2RioRoute")
- `name` (string, nullable)
- `canonical_name` (string, nullable)
- `grouping_key` (string, nullable)
- `duration` (integer, nullable)
- `is_connectable` (boolean, nullable)
- `transport_kinds` (array) (default: [])
- `transfer_durations` (array) (default: [])
- `origin` (object, nullable)
  - `@type` (string) (default: "Rome2RioPlace")
  - `short_name` (string, nullable)
  - `canonical_name` (string, nullable)
  - `kind` (string, nullable)
  - `code` (string, nullable)
  - `country_code` (string, nullable)
  - `time_zone` (string, nullable)
  - `latitude` (number, nullable)
  - `longitude` (number, nullable)
  - `radius` (number, nullable)
  - `nearby_city` (string, nullable)
- `destination` (object, nullable)
  - `@type` (string) (default: "Rome2RioPlace")
  - `short_name` (string, nullable)
  - `canonical_name` (string, nullable)
  - `kind` (string, nullable)
  - `code` (string, nullable)
  - `country_code` (string, nullable)
  - `time_zone` (string, nullable)
  - `latitude` (number, nullable)
  - `longitude` (number, nullable)
  - `radius` (number, nullable)
  - `nearby_city` (string, nullable)
- `indicative_prices` (array) (default: [])
  - `@type` (string) (default: "Rome2RioPrice")
  - `fare_class` (string, nullable)
  - `currency_code` (string, nullable)
  - `price` (number, nullable)
  - `price_low` (number, nullable)
  - `price_high` (number, nullable)
  - `is_display` (boolean, nullable)
- `booking_links` (array) (default: [])
  - `@type` (string) (default: "Rome2RioBookingLink")
  - `link_type` (string, nullable)
  - `url` (string, nullable)
  - `providers` (array) (default: [])
  - `origin_canonical` (string, nullable)
  - `destination_canonical` (string, nullable)
  - `templated_parameters` (array) (default: [])
- `booking_configuration` (object, nullable)
  - `@type` (string) (default: "Rome2RioBookingConfiguration")
  - `max_passengers` (integer, nullable)
  - `default_passenger_age` (integer, nullable)
  - `age_groups` (array) (default: [])
    - `@type` (string) (default: "Rome2RioAgeGroup")
    - `age` (integer, nullable)
    - `name` (string, nullable)
- `transit_guides` (array) (default: [])
  - `@type` (string) (default: "Rome2RioTransitGuide")
  - `guide_title` (string, nullable)
  - `url` (string, nullable)
  - `thumbnail_url` (string, nullable)
  - `description` (string, nullable)
- `segments` (array) (default: [])
  - `@type` (string) (default: "Rome2RioSegment")
  - `is_major` (boolean, nullable)
  - `duration` (integer, nullable)
  - `kind` (string, nullable)
  - `origin` (string, nullable)
  - `destination` (string, nullable)
  - `indicative_prices` (array) (default: [])
    - `@type` (string) (default: "Rome2RioPrice")
    - `fare_class` (string, nullable)
    - `currency_code` (string, nullable)
    - `price` (number, nullable)
    - `price_low` (number, nullable)
    - `price_high` (number, nullable)
    - `is_display` (boolean, nullable)
  - `booking_links` (array) (default: [])
    - `@type` (string) (default: "Rome2RioBookingLink")
    - `link_type` (string, nullable)
    - `url` (string, nullable)
    - `providers` (array) (default: [])
    - `origin_canonical` (string, nullable)
    - `destination_canonical` (string, nullable)
    - `templated_parameters` (array) (default: [])
  - `booking_configuration` (object, nullable)
    - `@type` (string) (default: "Rome2RioBookingConfiguration")
    - `max_passengers` (integer, nullable)
    - `default_passenger_age` (integer, nullable)
    - `age_groups` (array) (default: [])
  - `transit_guides` (array) (default: [])
    - `@type` (string) (default: "Rome2RioTransitGuide")
    - `guide_title` (string, nullable)
    - `url` (string, nullable)
    - `thumbnail_url` (string, nullable)
    - `description` (string, nullable)
  - `options` (array) (default: [])
    - `@type` (string) (default: "Rome2RioOption")
    - `indicative_prices` (array) (default: [])
    - `hops` (array) (default: [])

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

No routes found between the given origin and destination

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

