Actions2
Nearby Search
AI-generatedSummary
Search for places within a specified circular geographic area, applying optional type filters and preferences, and retrieve detailed place information according to specified fields.
Inputs
- Location Restriction (Required) (required) — Defines the search area as a circle with center coordinates (latitude, longitude) and radius in meters (0-50000). This parameter is mandatory.
- Included Types — Comma-separated list of place types to include in the search (e.g., "restaurant,cafe,bar"). Leave empty to include all types.
- Excluded Types — Comma-separated list of place types to exclude from the search (e.g., "gas_station,car_wash").
- Included Primary Types — Comma-separated list of primary place types to include (e.g., "restaurant,hotel"). This filters based on the primary type assigned to places.
- Excluded Primary Types — Comma-separated list of primary place types to exclude (e.g., "fast_food_restaurant").
- Language Code — Language code for returned results using BCP 47 codes (default is "en").
- Max Result Count — Maximum number of results to return, between 1 and 20. Pagination can be used to retrieve more results.
- Rank Preference — Method to rank results: POPULARITY (default) sorts by relevance/popularity, or DISTANCE sorts by proximity to the search center.
- Region Code — Two-character CLDR region code (e.g., US, GB) affecting address formatting and locale-based result adjustments.
- Fields — Select which place details to return from a broad list including name, address, location, ratings, opening hours, contact info, and more. Default fields are displayName, id, formattedAddress, and location.
Output shape
a list of place objects
Returns an array of JSON objects representing places matching the search criteria. The number of results is limited by the Max Result Count and available result pages. If no places are found, returns a single object with a message indicating no results.
Examples
Example 1: Find popular restaurants and cafes within 1 km of a specified location
Set Location Restriction to a circle centered at the target latitude and longitude with a 1000 meter radius. Set Included Types to "restaurant,cafe". Set Rank Preference to POPULARITY. Specify desired Fields such as displayName, formattedAddress, rating.
Example 2: Get nearby hotels sorted by distance
Set Location Restriction to the area of interest. Set Included Primary Types to "hotel". Set Rank Preference to DISTANCE. Adjust Max Result Count as needed. Include fields such as name, location, and Google Maps URI for direct links.
