Search Nearby Locations

Finds Locations within a geographic area, ordered by proximity or rating.

The search area is defined either by a center point and radius or by a bounding box, supplied via the search parameters. Results are restricted to Locations you are licensed to access and return the full Location representation, optionally with a single representative photo.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Search Nearby Locations requests

A Search Nearby Locations request takes a geographic area and returns the Locations within it, ordered by distance or rating. Results are limited to Locations on your allowlist.

Define the search area in one of three ways. The strategies are mutually exclusive.

StrategyParameters
Radius around a pointlat, lon, radius, unit
Radius around a Locationlocation_id, radius, unit
Bounding boxsw_lat, sw_lon, ne_lat, ne_lon

Search Nearby Locations responses

The response is a paged object. The data array contains the matching Locations. Each entry carries the full Location representation plus distance_kilometers, distance_miles and bearing, measured from the center point. The pagination object carries page, size, total_elements and total_pages. Pages are 1-based.

Both distance fields are returned regardless of the unit parameter. unit controls only how the radius value is interpreted.

bearing is the initial forward azimuth in degrees from the center point to the Location.

Search parameters

radius and unit

unit is MI (default) or KM. radius must be greater than 0, and has a maximum that depends on the unit:

UnitMaximum radius
KM8
MI5

A larger value returns 400 with the message `radius` cannot be greater than 8.0 KM.

Bounding box

All four corners are required when radius is not given. Omitting any returns 400 with the message `sw_lat`, `sw_lon`, `ne_lat`, `ne_lon` are required when `radius` is not specified.

sw_lat must be less than ne_lat, otherwise 400 with the message `sw_lat` must be less than `ne_lat`.

min_rating

Returns only Locations rated at least this value, from 1 to 5.

sort

rating,desc by default. distance,asc is available for radius searches only, not for bounding boxes.

include_photo

When true, adds a single representative photo to each result. For the full set, use Location Photos.

Limits

size must be between 1 and 20 inclusive, and defaults to 20. A larger value returns 400 with the message 'size' should not go over 20.

The result offset, calculated as size × (page − 1), must not exceed 40. A larger offset returns 400 with the message The requested offset ('size' times 'page') should not go over 40. At the default size of 20, pages 1 through 3 are available and page 4 is not, so a single center point returns at most 60 Locations. To reach more, narrow the radius and issue separate requests, or apply filters.

Note: mixing parameters from two strategies returns 400 with the message Ambiguous set of parameters, unable to determine searching strategy. Send lat and lon, or location_id, or the four bounding-box corners — not a combination.

Note: the search and nearby endpoints have a lower rate limit than the rest of your package. Wait for a map to settle rather than issuing a request per pan. See API Access and Limits.

Note: results are restricted to your allowlist. An empty data array in a dense area usually indicates the allowlist rather than absent data.

Examples

Find restaurants within 2 km of a point

curl "https://terra.tripadvisor.com/api/locations/nearby?version=1&lat=48.8566&lon=2.3522&radius=2&unit=KM&category=RESTAURANT" \
  -H "X-API-Key: API_KEY"

Find highly rated Locations around a known Location

curl "https://terra.tripadvisor.com/api/locations/nearby?version=1&location_id=187147&radius=1&unit=KM&min_rating=4" \
  -H "X-API-Key: API_KEY"

Search a bounding box and include a photo

curl "https://terra.tripadvisor.com/api/locations/nearby?version=1&sw_lat=48.84&sw_lon=2.32&ne_lat=48.87&ne_lon=2.37&include_photo=true" \
  -H "X-API-Key: API_KEY"

Order results by distance

curl "https://terra.tripadvisor.com/api/locations/nearby?version=1&lat=48.8566&lon=2.3522&radius=2&unit=KM&sort=distance,asc" \
  -H "X-API-Key: API_KEY"

Related

Query Params
string

The ID of the Location to use as a reference for the radius-based search.

Required if lat or lon is not given.

number
-90 to 90

The latitude of the center point for the radius-based search.

Required if location_id not given.

number
-180 to 180

The longitude of the center point for the radius-based search.

Required if location_id not given.

double
> 0

The radius for the radius-based search.

Required if "Bounding Box" criteria is not given (sw_lat, sw_lon, ne_lat, ne_lon).

string
Defaults to MI

Unit of length for distance. If none specified defaults to miles.

string
-90 to 90

Bounding Box southwest latitude coordinate.

Required if radius is not given.

string
-180 to 180

Bounding Box southwest longitude coordinate.

Required if radius is not given.

string
-90 to 90

Bounding Box northeast latitude coordinate.

Required if radius is not given.

string
-180 to 180

Bounding Box northeast longitude coordinate.

Required if radius is not given.

string
enum

Filter based on Tripadvisor’s top-level categories (eat & drink, accommodations, attractions).

Allowed:
string
1 to 5

Filter by ratings with at least N bubbles (1.0-5.0).

boolean
Defaults to false

when true, include a single representative photo for each Location

locale
array of strings

preferred locales for localized fields (e.g. names, descriptions), in priority
order; falls back to the default locale when omitted

locale
integer
≥ 1

Page index (1-based).

integer
≤ 20
Defaults to 20

Page size.

sort
array of strings
Defaults to rating,desc

Sorting criteria in the format: property,(asc|desc). Multiple sort criteria are supported. Available sorting: distance (for radius-based search only), rating

sort
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json