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 POI is included in several objects in the response.

 

Address:

The address is returned within the “address_obj” object.


"address_obj": {
   "street1": "365 Park Ave S",
   "street2": "At 26th Street",
   "city": "New York City",
   "state": "New York",
   "country": "United States",
   "postalcode": "10016",
   "address_string": "365 Park Ave S At 26th Street, New York City, NY 10016"
 },

 

Field

Type

Description

street1

string

Primary street address.

street2

string

Secondary street address. Null if not applicable.

city

string

City where the POI is located. Localized if a language other than English is requested.

state

string

State/Province where the POI 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 POI. Coverage varies country by country.


"longitude": "-73.98491",
"latitude": "40.74207",

 

Field

Type

Description

longitude

number

Longitude of the POI address location. Null if unavailable.

latitude

number

Longitude of the POI address location. 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 city where a POI is located, as well as state/province/region and country.

 

"ancestors": [
   {
     "abbrv": null,
     "level": "City",
     "name": "New York City",
     "location_id": "60763"
   },
   {
     "abbrv": "NY",
     "level": "State",
     "name": "New York",
     "location_id": "28953"
   },
   {
     "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.