==== outdated content ====
The /location_mapper call allows Content API users to map their existing property IDs to Tripadvisor Location IDs, which can be used in /location API calls. Some key differences from regular Content API calls are:
http://api.tripadvisor.com/api/partner/2.0/location_mapper/42.344978,-71.119030?key=<CONTENT API KEY HERE>-mapper&category=hotels&q=Beacon%20Townhouse%20Inn%201023
Name | Description |
---|---|
category | Filters result set based on property type. Valid options are: "hotels", "attractions", and "restaurants". |
q | Query string for narrowing searches. Recommended to use property name. |
{ "data": [ { "location_id": "258730", "name": "Beacon Townhouse Inn 1023", "distance": "0.5806475395682301", "bearing": "east", "address_obj": { "street1": "1023 Beacon Street", "street2": "", "city": "Brookline", "state": "Massachusetts", "country": "United States", "postalcode": "02446", "address_string": "1023 Beacon Street, Brookline, MA 02446" } } ] }
Name | Description |
---|---|
location_id | The Tripadvisor Location ID - to use in any /location API calls. |
name | Property name. |
address_obj | Object consisting of various address data. |
distance | Distance, in miles, this location is from the passed in Lat/Long parameters. |
bearing |
Direction this location is from the passed in Lat/Long parameters. |
Best results may come from using the category parameter (e.g. "hotels") and passing exact property name into the query parameter. Additionally, the API call does not include any auto-correction, so if you are having trouble getting the correct property returned, be sure to check spelling.
It is recommended that users review all matched Tripadvisor Location IDs with their own list of propery IDs, and store them in a database once confirmed. This allows the user to access a list of confirmed Location IDs instead of relying on the accuracy of the /location_mapper call, which may not always return the desired result, before making a /location call. If you are unable to obtain certain Location IDs using the /location_mapper call, you can also manually check the property's Tripadvisor URL - the Location ID is the number located immediately following the letter "d" in the URL:
http://www.tripadvisor.com/Hotel_Review-g60745-d258705-Reviews-Hotel_Commonwealth-Boston_Massachusetts.html
Tripadvisor provides the /location_mapper call as-is, and, as with the rest of the Content API, does not provide any official support.