Major Changes (v1.2 to 1.4)
- Segments have been completely restructured.
- Added Alternatives that show transit alternatives (eg: a shuttle instead of a bus).
- Places, Airlines, Aircrafts, Agencies and Vehicles are now referenced via index (instead of a unique code).
- Agencies no longer have a code.
- Indicative prices now include price levels (eg: first class, second class) and ranges (low, high).
- Search flags are now specified by name
Documentation for Search API version 1.2 is available here.
NOTE: Rome2Rio does not provide live transit prices or airfares through this API. We recommend using the Skyscanner Flights API for this feature.
Other options for airfare API’s include Expedia, DoHop, eDreams or Vayama.
Example Request
http://free.rome2rio.com/api/1.4/xml/Search?key=&oName=Bern&dName=Zurich&noRideshare
http://free.rome2rio.com/api/1.4/json/Search?key=&oName=Bern&dName=Zurich&noRideshare
SearchRequest
Name | Type | Description |
---|
key | string | API key
|
oName | string | Origin display name (optional) [1]
|
dName | string | Destination display name (optional) [1]
|
oPos | Position | Origin latitude, longitude (optional) [1]
|
dPos | Position | Destination latitude, longitude (optional) [1]
|
oKind | string | Origin kind (optional) [2]
|
dKind | string | Destination kind (optional) [2]
|
currencyCode | string | Language code (ISO 639-1) (optional) [4]
|
languageCode | string | Language code (ISO 639-1) (optional) [4]
|
data | string | Caller supplied data string (optional) [5]
|
noAir | bool | Exclude air segments (optional)
|
noAirLeg | bool | Exclude air legs (outbound and return) (optional)
|
noRail | bool | Exclude train, tram and subway segments (optional)
|
noBus | bool | Exclude bus segments (optional)
|
noFerry | bool | Exclude ferry segments (optional)
|
noCar | bool | Exclude drive and taxi segments (optional)
|
noBikeshare | bool | Exclude bike share segments (optional)
|
noRideshare | bool | Exclude ride share segments (eg: BlahBlahCar) (optional)
|
noTowncar | bool | Exclude towncar segments (eg: Uber) (optional)
|
noCommuter | bool | Exclude commuter segments (eg: local buses) (optional)
|
noSpecial | bool | Exclude special segments (eg: steam trains) (optional)
|
noMinorStart | bool | Exclude minor start segments (eg: train to airport) (optional)
|
noMinorEnd | bool | Exclude minor end segments (eg: train from airport) (optional)
|
noPath | bool | Exclude paths (optional)
|
noPrice | bool | Exclude indicative prices (optional)
|
noStop | bool | Exclude intermediate stops (optional)
|
[1] If oPos/dPos are not specified, oName/dName are geocoded into latitude and longitude.
[2] The kind determines how precisely the origin and destination should be treated when searching. For example, a value of "city" indicates the position is not very precise and the results should favour major transit hubs in the city. A value of "street_address" means the position is very precise and walking directions should be given. Supported values include Rome2Rio Place kinds, Google Geocoding result types and Yahoo WOEID place types.
[3] The three letter currency code is used to format indicative prices. USD is assumed by default.
[4] The two letter language code is used to translate the response. It is also used as a hint in the geocoder. EN is assumed by default.
[5] The data string gets echoed in the response. This can be used by the caller to match responses to requests.
Place
Name | Type | Description |
---|
lat | float | Latitude (WGS84)
|
lng | float | Longitude (WGS84)
|
kind | string | Type of place [1]
|
shortName | string | Display name
|
code | string | Airport or Station code (eg: IATA)
|
regionCode | string | Region code (ISO 3166-2 or FIPS) (optional)
|
countryCode | string | Country code (ISO 3166-1 alpha-2) (optional)
|
timeZone | string | Time zone (IANA) (optional)
|
[1] Currently, the following kinds are supported: unknown, continent, country, admin3, admin2, admin1, island, village, town, city, capital, metropolis, megalopolis, landmark, place, road, accommodation, station, airport, seaport, sea, lake and river. Please note that this list will likely change in future revisions.
Vehicle
Name | Type | Description |
---|
name | string | Vehicle display name
|
kind | string | Vehicle kind [1]
|
[1] The following kinds are supported: unknown, plane, helicopter, car, bus, taxi, rideshare, shuttle, towncar, train, tram, cablecar, subway, ferry, foot, animal, bicycle. Please note that this list will likely change in future revisions.