Address and Geocoding

The content below is outdated.

Please follow this link to get access to our Content API.

==== outdated content ====

 

The basic location information returned for a specific destination is included in several objects in the response.

 

Address:

The address is returned within the “address_obj” object. For a destination location, all non-applicable fields return null.  

"address_obj": {
   "street1": null,
   "street2": null,
   "city": null,
   "state": "California",
   "country": "United States",
   "postalcode": null,
   "address_string": "San Francisco, CA"
 },

 

Field

Type

Description

street1

string

Null for a destination.

street2

string

Null for a destination.

city

string

Name of the destination. Null if the destination is a broad geo, such as a state, region or country. Localized if a language other than English is requested.

state

string

State/Province where the destination is located. Localized if a language other than English is requested.

country

string

Full country name. Localized if a language other than English is requested.

postalcode

string

Postal or zip code.

address_string

string

Full address written out in a single string. Localized if a language other than English is requested.



Geocode:

Where available, Tripadvisor provides the geocode in the form of latitude and longitude in the response. Tripadvisor does not have a distributable geocode for every destination. Coverage varies country by country.


"longitude": "-122.41579",
 "latitude": "37.778934"

 

Field

Type

Description

longitude

number

Longitude of the center of the destination. Null if unavailable.

latitute

number

Longitude of the center of the destination. Null if unavailable.



Ancestors:

Ancestors describe where the POI or destination lives within the Tripadvisor destination or geo hierarchy. From this, you can derive the state/province/region and country where a city is located.

 

"ancestors": [
   {
     "abbrv": "CA",
     "level": "State",
     "name": "California",
     "location_id": "28926"
   },
   {
     "abbrv": null,
     "level": "Country",
     "name": "United States",
     "location_id": "191"
   }
 ],

 

Field

Type

Description

abbrv

string

Abbreviated version of the destination name. Null if not applicable.

level

string

Type of destination in the world geo hierarchy. Options include city, region, state, province, country.

name

String

Localized name of the destination.

location_id

number

location_id of that destination or geo on Tripadvisor.