Query Autocomplete

The Query Autocomplete service can be used to provide a query prediction for text-based geographic searches, by returning suggested queries as you type.

Query Autocomplete requests

The Query Autocomplete service is part of the Places API and shares an API key and quota with the Places API.

The Query Autocomplete service allows you to add on-the-fly geographic query predictions to your application. Instead of searching for a specific location, a user can type in a categorical search, such as "pizza near New York" and the service responds with a list of suggested queries matching the string. As the Query Autocomplete service can match on both full words and substrings, applications can send queries as the user types to provide on-the-fly predictions.

A Query Autocomplete request is an HTTP URL of the following form:

https://maps.googleapis.com/maps/api/place/queryautocomplete/output?parameters

where output may be either json or xml.

Certain parameters are required to initiate a Query Autocomplete request. As is standard in URLs, all parameters are separated using the ampersand (&) character. The list of parameters and their possible values are enumerated below.

Required parameters

  • input

    The text string on which to search. The Place Autocomplete service will return candidate matches based on this string and order results based on their perceived relevance.

Optional parameters

  • language

    The language in which to return results.

    • See the list of supported languages. Google often updates the supported languages, so this list may not be exhaustive.
    • If language is not supplied, the API attempts to use the preferred language as specified in the Accept-Language header, or the native language of the domain from which the request is sent.
    • The API does its best to provide a street address that is readable for both the user and locals. To achieve that goal, it returns street addresses in the local language, transliterated to a script readable by the user if necessary, observing the preferred language. All other addresses are returned in the preferred language. Address components are all returned in the same language, which is chosen from the first component.
    • If a name is not available in the preferred language, the API uses the closest match.
    • The preferred language has a small influence on the set of results that the API chooses to return, and the order in which they are returned. The geocoder interprets abbreviations differently depending on language, such as the abbreviations for street types, or synonyms that may be valid in one language but not in another. For example, utca and tér are synonyms for street in Hungarian.
  • location

    The point around which to retrieve place information. This must be specified as latitude,longitude.

    The location parameter may be overriden if the query contains an explicit location such as Market in Barcelona. Using quotes around the query may also influence the weight given to the location and radius.
  • offset

    The position, in the input term, of the last character that the service uses to match predictions. For example, if the input is Google and the offset is 3, the service will match on Goo. The string determined by the offset is matched against the first word in the input term only. For example, if the input term is Google abc and the offset is 3, the service will attempt to match against Goo abc. If no offset is supplied, the service will use the whole term. The offset should generally be set to the position of the text caret.

  • radius

    Defines the distance (in meters) within which to return place results. You may bias results to a specified circle by passing a location and a radius parameter. Doing so instructs the Places service to prefer showing results within that circle; results outside of the defined area may still be displayed.

    The radius will automatically be clamped to a maximum value depending on the type of search and other parameters.

    • Autocomplete: 50,000 meters
    • Nearby Search:
      • with keyword or name: 50,000 meters
      • without keyword or name
        • rankby=prominence (default): 50,000 meters
        • rankby=distance: A few kilometers depending on density of area
    • Query Autocomplete: 50,000 meters
    • Text Search: 50,000 meters

Generated from the OpenAPI specification. Edit Report bug

Query Autocomplete examples

URL

https://maps.googleapis.com/maps/api/place/autocomplete/json
  ?input=pizza%20near%20par
  &key=YOUR_API_KEY

cURL

curl -L -X GET 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY'

JavaScript

var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY',
  headers: { }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Python

import requests

url = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY")
  .method("GET", null)
  .build();
Response response = client.newCall(request).execute();

Ruby

require "uri"
require "net/http"

url = URI("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body

Go

package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&key=YOUR_API_KEY"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Postman

The OpenAPI specification is also available as a Postman collection.

Run in Postman

A request "Pizza near Par", with results in French:

URL

https://maps.googleapis.com/maps/api/place/autocomplete/json
  ?input=pizza%20near%20par
  &language=fr
  &key=YOUR_API_KEY

cURL

curl -L -X GET 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY'

JavaScript

var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY',
  headers: { }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Python

import requests

url = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY")
  .method("GET", null)
  .build();
Response response = client.newCall(request).execute();

Ruby

require "uri"
require "net/http"

url = URI("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body

Go

package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20par&language=fr&key=YOUR_API_KEY"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Postman

The OpenAPI specification is also available as a Postman collection.

Run in Postman

Note that you'll need to replace the API key in these examples with your own key.

Query Autocomplete response

Query Autocomplete Responses are returned in the format indicated by the output flag within the URL request's path. The results below are returned for a query with the following parameters:

URL

https://maps.googleapis.com/maps/api/place/autocomplete/json
  ?input=pizza%20near%20Sydney
  &key=YOUR_API_KEY

cURL

curl -L -X GET 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY'

JavaScript

var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY',
  headers: { }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Python

import requests

url = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY")
  .method("GET", null)
  .build();
Response response = client.newCall(request).execute();

Ruby

require "uri"
require "net/http"

url = URI("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body

Go

package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza%20near%20Sydney&key=YOUR_API_KEY"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Postman

The OpenAPI specification is also available as a Postman collection.

Run in Postman

JSON

{
  "predictions":
    [
      {
        "description": "PIZZA PARADISO, Mariscal Antonio José de Sucre, Buenos Aires, Argentina",
        "matched_substrings": [{ "length": 14, "offset": 0 }],
        "place_id": "ChIJZQIEIV61vJURXNINvCJNDgg",
        "reference": "ChIJZQIEIV61vJURXNINvCJNDgg",
        "structured_formatting":
          {
            "main_text": "PIZZA PARADISO",
            "main_text_matched_substrings": [{ "length": 14, "offset": 0 }],
            "secondary_text": "Mariscal Antonio José de Sucre, Buenos Aires, Argentina",
          },
        "terms":
          [
            { "offset": 0, "value": "PIZZA PARADISO" },
            { "offset": 16, "value": "Mariscal Antonio José de Sucre" },
            { "offset": 48, "value": "Buenos Aires" },
            { "offset": 62, "value": "Argentina" },
          ],
        "types": ["restaurant", "food", "point_of_interest", "establishment"],
      },
      {
        "description": "Pizza Paradiso Mediterranean Grill, Lower Honoapiilani Road, Lahaina, HI, USA",
        "matched_substrings": [{ "length": 34, "offset": 0 }],
        "place_id": "ChIJffjit6_Vqn4RLxkOpB72o9E",
        "reference": "ChIJffjit6_Vqn4RLxkOpB72o9E",
        "structured_formatting":
          {
            "main_text": "Pizza Paradiso Mediterranean Grill",
            "main_text_matched_substrings": [{ "length": 34, "offset": 0 }],
            "secondary_text": "Lower Honoapiilani Road, Lahaina, HI, USA",
          },
        "terms":
          [
            { "offset": 0, "value": "Pizza Paradiso Mediterranean Grill" },
            { "offset": 36, "value": "Lower Honoapiilani Road" },
            { "offset": 61, "value": "Lahaina" },
            { "offset": 70, "value": "HI" },
            { "offset": 74, "value": "USA" },
          ],
        "types": ["restaurant", "food", "point_of_interest", "establishment"],
      },
      {
        "description": "Pizza Park, 1st Avenue, New York, NY, USA",
        "matched_substrings": [{ "length": 10, "offset": 0 }],
        "place_id": "ChIJYceQZMJYwokR5WkZsPbm5dQ",
        "reference": "ChIJYceQZMJYwokR5WkZsPbm5dQ",
        "structured_formatting":
          {
            "main_text": "Pizza Park",
            "main_text_matched_substrings": [{ "length": 10, "offset": 0 }],
            "secondary_text": "1st Avenue, New York, NY, USA",
          },
        "terms":
          [
            { "offset": 0, "value": "Pizza Park" },
            { "offset": 12, "value": "1st Avenue" },
            { "offset": 24, "value": "New York" },
            { "offset": 34, "value": "NY" },
            { "offset": 38, "value": "USA" },
          ],
        "types":
          [
            "meal_delivery",
            "restaurant",
            "food",
            "point_of_interest",
            "establishment",
          ],
      },
      {
        "description": "Pizza Paradise, East Baltimore Avenue, East Lansdowne, PA, USA",
        "matched_substrings": [{ "length": 14, "offset": 0 }],
        "place_id": "ChIJ034n_OHDxokRtkt2VhMO3oQ",
        "reference": "ChIJ034n_OHDxokRtkt2VhMO3oQ",
        "structured_formatting":
          {
            "main_text": "Pizza Paradise",
            "main_text_matched_substrings": [{ "length": 14, "offset": 0 }],
            "secondary_text": "East Baltimore Avenue, East Lansdowne, PA, USA",
          },
        "terms":
          [
            { "offset": 0, "value": "Pizza Paradise" },
            { "offset": 16, "value": "East Baltimore Avenue" },
            { "offset": 39, "value": "East Lansdowne" },
            { "offset": 55, "value": "PA" },
            { "offset": 59, "value": "USA" },
          ],
        "types":
          [
            "meal_delivery",
            "restaurant",
            "food",
            "point_of_interest",
            "establishment",
          ],
      },
      {
        "description": "Pizza Party, North Saint Mary's Street, San Antonio, TX, USA",
        "matched_substrings": [{ "length": 11, "offset": 0 }],
        "place_id": "ChIJjfKnIo5fXIYR69-raO761_g",
        "reference": "ChIJjfKnIo5fXIYR69-raO761_g",
        "structured_formatting":
          {
            "main_text": "Pizza Party",
            "main_text_matched_substrings": [{ "length": 11, "offset": 0 }],
            "secondary_text": "North Saint Mary's Street, San Antonio, TX, USA",
          },
        "terms":
          [
            { "offset": 0, "value": "Pizza Party" },
            { "offset": 13, "value": "North Saint Mary's Street" },
            { "offset": 40, "value": "San Antonio" },
            { "offset": 53, "value": "TX" },
            { "offset": 57, "value": "USA" },
          ],
        "types": ["restaurant", "food", "point_of_interest", "establishment"],
      },
    ],
  "status": "OK",
}

XML

<AutocompletionResponse>
 <status>OK</status>
 <prediction>
  <description>PIZZA PARADISO, Mariscal Antonio José de Sucre, Buenos Aires, Argentina</description>
  <type>restaurant</type>
  <type>food</type>
  <type>point_of_interest</type>
  <type>establishment</type>
  <reference>ChIJZQIEIV61vJURXNINvCJNDgg</reference>
  <term>
   <value>PIZZA PARADISO</value>
   <offset>0</offset>
  </term>
  <term>
   <value>Mariscal Antonio José de Sucre</value>
   <offset>16</offset>
  </term>
  <term>
   <value>Buenos Aires</value>
   <offset>48</offset>
  </term>
  <term>
   <value>Argentina</value>
   <offset>62</offset>
  </term>
  <matched_substring>
   <offset>0</offset>
   <length>14</length>
  </matched_substring>
  <place_id>ChIJZQIEIV61vJURXNINvCJNDgg</place_id>
  <structured_formatting>
   <description>PIZZA PARADISO</description>
   <subdescription>Mariscal Antonio José de Sucre, Buenos Aires, Argentina</subdescription>
   <description_matched_substring>
    <offset>0</offset>
    <length>14</length>
   </description_matched_substring>
  </structured_formatting>
 </prediction>
 <prediction>
  <description>Pizza Paradiso Mediterranean Grill, Lower Honoapiilani Road, Lahaina, HI, USA</description>
  <type>restaurant</type>
  <type>food</type>
  <type>point_of_interest</type>
  <type>establishment</type>
  <reference>ChIJffjit6_Vqn4RLxkOpB72o9E</reference>
  <term>
   <value>Pizza Paradiso Mediterranean Grill</value>
   <offset>0</offset>
  </term>
  <term>
   <value>Lower Honoapiilani Road</value>
   <offset>36</offset>
  </term>
  <term>
   <value>Lahaina</value>
   <offset>61</offset>
  </term>
  <term>
   <value>HI</value>
   <offset>70</offset>
  </term>
  <term>
   <value>USA</value>
   <offset>74</offset>
  </term>
  <matched_substring>
   <offset>0</offset>
   <length>34</length>
  </matched_substring>
  <place_id>ChIJffjit6_Vqn4RLxkOpB72o9E</place_id>
  <structured_formatting>
   <description>Pizza Paradiso Mediterranean Grill</description>
   <subdescription>Lower Honoapiilani Road, Lahaina, HI, USA</subdescription>
   <description_matched_substring>
    <offset>0</offset>
    <length>34</length>
   </description_matched_substring>
  </structured_formatting>
 </prediction>
 <prediction>
  <description>Pizza Park, 1st Avenue, New York, NY, USA</description>
  <type>meal_delivery</type>
  <type>restaurant</type>
  <type>food</type>
  <type>point_of_interest</type>
  <type>establishment</type>
  <reference>ChIJYceQZMJYwokR5WkZsPbm5dQ</reference>
  <term>
   <value>Pizza Park</value>
   <offset>0</offset>
  </term>
  <term>
   <value>1st Avenue</value>
   <offset>12</offset>
  </term>
  <term>
   <value>New York</value>
   <offset>24</offset>
  </term>
  <term>
   <value>NY</value>
   <offset>34</offset>
  </term>
  <term>
   <value>USA</value>
   <offset>38</offset>
  </term>
  <matched_substring>
   <offset>0</offset>
   <length>10</length>
  </matched_substring>
  <place_id>ChIJYceQZMJYwokR5WkZsPbm5dQ</place_id>
  <structured_formatting>
   <description>Pizza Park</description>
   <subdescription>1st Avenue, New York, NY, USA</subdescription>
   <description_matched_substring>
    <offset>0</offset>
    <length>10</length>
   </description_matched_substring>
  </structured_formatting>
 </prediction>
 <prediction>
  <description>Pizza Paradise, East Baltimore Avenue, East Lansdowne, PA, USA</description>
  <type>meal_delivery</type>
  <type>restaurant</type>
  <type>food</type>
  <type>point_of_interest</type>
  <type>establishment</type>
  <reference>ChIJ034n_OHDxokRtkt2VhMO3oQ</reference>
  <term>
   <value>Pizza Paradise</value>
   <offset>0</offset>
  </term>
  <term>
   <value>East Baltimore Avenue</value>
   <offset>16</offset>
  </term>
  <term>
   <value>East Lansdowne</value>
   <offset>39</offset>
  </term>
  <term>
   <value>PA</value>
   <offset>55</offset>
  </term>
  <term>
   <value>USA</value>
   <offset>59</offset>
  </term>
  <matched_substring>
   <offset>0</offset>
   <length>14</length>
  </matched_substring>
  <place_id>ChIJ034n_OHDxokRtkt2VhMO3oQ</place_id>
  <structured_formatting>
   <description>Pizza Paradise</description>
   <subdescription>East Baltimore Avenue, East Lansdowne, PA, USA</subdescription>
   <description_matched_substring>
    <offset>0</offset>
    <length>14</length>
   </description_matched_substring>
  </structured_formatting>
 </prediction>
 <prediction>
  <description>Pizza Party, North Saint Mary's Street, San Antonio, TX, USA</description>
  <type>restaurant</type>
  <type>food</type>
  <type>point_of_interest</type>
  <type>establishment</type>
  <reference>ChIJjfKnIo5fXIYR69-raO761_g</reference>
  <term>
   <value>Pizza Party</value>
   <offset>0</offset>
  </term>
  <term>
   <value>North Saint Mary's Street</value>
   <offset>13</offset>
  </term>
  <term>
   <value>San Antonio</value>
   <offset>40</offset>
  </term>
  <term>
   <value>TX</value>
   <offset>53</offset>
  </term>
  <term>
   <value>USA</value>
   <offset>57</offset>
  </term>
  <matched_substring>
   <offset>0</offset>
   <length>11</length>
  </matched_substring>
  <place_id>ChIJjfKnIo5fXIYR69-raO761_g</place_id>
  <structured_formatting>
   <description>Pizza Party</description>
   <subdescription>North Saint Mary's Street, San Antonio, TX, USA</subdescription>
   <description_matched_substring>
    <offset>0</offset>
    <length>11</length>
   </description_matched_substring>
  </structured_formatting>
 </prediction>
</AutocompletionResponse>

When the Places service returns JSON results from a search, it places them within a predictions array. Even if the service returns no results (such as if the location is remote) it still returns an empty predictions array. XML responses consist of zero or more <prediction> elements.

PlacesQueryAutocompleteResponse

FieldRequiredTypeDescription
predictionsrequired Array<PlaceAutocompletePrediction>

Contains an array of predictions.

See PlaceAutocompletePrediction for more information.

statusrequiredPlacesAutocompleteStatus

Contains the status of the request, and may contain debugging information to help you track down why the request failed.

See PlacesAutocompleteStatus for more information.

error_messageoptionalstring

When the service returns a status code other than OK, there may be an additional error_message field within the response object. This field contains more detailed information about thereasons behind the given status code. This field is not always returned, and its content is subject to change.

info_messagesoptionalArray<string>

When the service returns additional information about the request specification, there may be an additional info_messages field within the response object. This field is only returned for successful requests. It may not always be returned, and its content is subject to change.

Generated from the OpenAPI specification. Edit Report bug

PlacesAutocompleteStatus

Status codes returned by service.

  • OK indicating the API request was successful.
  • ZERO_RESULTS indicating that the search was successful but returned no results. This may occur if the search was passed a bounds in a remote location.
  • INVALID_REQUEST indicating the API request was malformed, generally due to the missing input parameter.
  • OVER_QUERY_LIMIT indicating any of the following:
    • You have exceeded the QPS limits.
    • Billing has not been enabled on your account.
    • The monthly $200 credit, or a self-imposed usage cap, has been exceeded.
    • The provided method of payment is no longer valid (for example, a credit card has expired).
    See the Maps FAQ for more information about how to resolve this error.
  • REQUEST_DENIED indicating that your request was denied, generally because:
    • The request is missing an API key.
    • The key parameter is invalid.
  • UNKNOWN_ERROR indicating an unknown error.

Generated from the OpenAPI specification. Edit Report bug

PlaceAutocompletePrediction

FieldRequiredTypeDescription
descriptionrequiredstring

Contains the human-readable name for the returned result. For establishment results, this is usually the business name. This content is meant to be read as-is. Do not programmatically parse the formatted address.

matched_substringsrequired Array<PlaceAutocompleteMatchedSubstring>

A list of substrings that describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired.

See PlaceAutocompleteMatchedSubstring for more information.

place_idrequiredstring

A textual identifier that uniquely identifies a place. To retrieve information about the place, pass this identifier in the placeId field of a Places API request. For more information about place IDs, see the Place IDs overview.

structured_formattingrequiredPlaceAutocompleteStructuredFormat

Provides pre-formatted text that can be shown in your autocomplete results. This content is meant to be read as-is. Do not programmatically parse the formatted address.

See PlaceAutocompleteStructuredFormat for more information.

termsrequired Array<PlaceAutocompleteTerm>

Contains an array of terms identifying each section of the returned description (a section of the description is generally terminated with a comma). Each entry in the array has a value field, containing the text of the term, and an offset field, defining the start position of this term in the description, measured in Unicode characters.

See PlaceAutocompleteTerm for more information.

typesrequiredArray<string>

Contains an array of types that apply to this place. For example: [ "political", "locality" ] or [ "establishment", "geocode", "beauty_salon" ]. The array can contain multiple values. Learn more about Place types.

referenceoptionalstring

(Deprecated) See place_id.

Generated from the OpenAPI specification. Edit Report bug

PlaceAutocompleteMatchedSubstring

FieldRequiredTypeDescription
lengthrequirednumber

Length of the matched substring in the prediction result text.

offsetrequirednumber

Start location of the matched substring in the prediction result text.

Generated from the OpenAPI specification. Edit Report bug

PlaceAutocompleteStructuredFormat

FieldRequiredTypeDescription
main_textrequiredstring

Contains the main text of a prediction, usually the name of the place.

main_text_matched_substringsrequired Array<PlaceAutocompleteMatchedSubstring>

Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired.

See PlaceAutocompleteMatchedSubstring for more information.

secondary_textrequiredstring

Contains the secondary text of a prediction, usually the location of the place.

Generated from the OpenAPI specification. Edit Report bug

PlaceAutocompleteTerm

FieldRequiredTypeDescription
offsetrequirednumber

Defines the start position of this term in the description, measured in Unicode characters

valuerequiredstring

The text of the term.

Generated from the OpenAPI specification. Edit Report bug