Autocomplete API

Major Changes (v1.2 to 1.4)

  • No changes.

Example Request

http://free.rome2rio.com/api/1.4/xml/Autocomplete?key=&query=Bern
http://free.rome2rio.com/api/1.4/json/Autocomplete?key=&query=Bern

AutocompleteRequest

NameTypeDescription
keystringAPI key
querystringText to autocomplete
countryCodestringISO 3166-1 two letter country code (optional hint)
languageCodestringISO 639-1 two letter language code (optional hint)

AutocompleteResponse

NameTypeDescription
querystringQuery specified in request
countryCodestringISO 3166-1 two letter country code (hint)
languageCodestringISO 639-1 two letter language code (hint)
placesPlace[]Array of places

Place

NameTypeDescription
kindstringType of place [1]
shortNamestringShort name of place (eg: Melbourne)
longNamestringFull name of plac (eg: Melbourne, VIC, Australia)
canonicalNamestringUnique name of place (eg: Melbourne)
codestringAirport or Station code (eg: IATA)
latfloatLatitude (WGS84)
lngfloatLongitude (WGS84)
radstringRadius (size of place in km)
regionNamestringRegion display name (optional)
regionCodestringRegion code (ISO 3166-2 or FIPS) (optional)
countryNamestringCountry display name (optional)
countryCodestringCountry code (ISO 3166-1) (optional)

[1] Currently, the following kinds are supported: unknown, continent, country, admin3, admin2, admin1, island, village, town, city, capital, landmark, place, road, accomodation, station, airport, seaport, sea, lake and river. Please note that this list will likely change in future revisions.

Sign up to use Rome2rio free on your web site or mobile app today.


Sign up Now