Autocomplete
POST https://places.googleapis.com/v1/places:autocomplete
The Autocomplete (New) service is a web service that returns place predictions and query predictions in response to an HTTP request. In the request, specify a text search string and geographic bounds that controls the search area.
The Autocomplete (New) service can match on full words and substrings of the input, resolving place names, addresses, and plus codes. Applications can therefore send queries as the user types, to provide on-the-fly place and query predictions.
The response from the Autocomplete (New) API can contain two types of predictions:
Place predictions: Places, such as businesses, addresses and points of interest, based on the specified input text string and search area. Place predictions are returned by default.
Query predictions: Query strings matching the input text string and search area. Query predictions are not returned by default. Use the
includeQueryPredictions
request parameter to add query predictions to the response.
For example, you call the API using as input a string that contains a partial user input, Sicilian piz
, with the search area limited to San Francisco, CA. The response then contains a list of place predictions that match the search string and search area, such as the restaurant named Sicilian Pizza Kitchen
, along with details about the place.
The returned place predictions are designed to be presented to the user to aid them in selecting the desired place. You can make a Place Details (New) request to get more information about any of the returned place predictions.
The response can also contain a list of query predictions that match the search string and search area, such as Sicilian Pizza & Pasta
. Each query prediction in the response includes the text
field containing a recommended text search string. Use that string as an input to Text Search (New) to perform a more detailed search.
Request Body
{"input"=>"<string>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
X-Goog-Api-Key | string |