AI-generated Key Takeaways
-
The Location Selection API's Find Nearby Places function allows you to identify places near a specified location using a POST request.
-
The request body requires location preferences, search location, maximum results, and optionally, WiFi access points for enhanced accuracy.
-
The response provides an ordered list of places based on likelihood and distance, which may be empty if no suitable places are found.
-
gRPC Transcoding syntax is used for the HTTP request URL.
Find nearby places for a given location.
HTTP request
POST https://locationselection.googleapis.com/v1beta:findNearbyPlaces
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "localizationPreferences": { object ( |
Fields | |
---|---|
localizationPreferences |
Required. Preferences used for localizing the texts in response, for example, name and address. |
searchLocation |
Required. Location where places need to be found. |
maxResults |
Required. Maximum number of results to be returned. Must be greater than 0. |
wifiAccessPoints[] |
WiFi Access points around the request location. Used to provide higher quality search results. |
Response body
If successful, the response body contains data with the following structure:
Find nearby places for a given location response message.
JSON representation |
---|
{
"placeResults": [
{
object ( |
Fields | |
---|---|
placeResults[] |
Ordered list of places found. May be empty if no places were found around the request location. Ordering is based on a combination of likelihood and distance. |