Method: places.searchText

Text query based place search.

HTTP request

POST https://places.googleapis.com/v1/places:searchText

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "textQuery": string,
  "languageCode": string,
  "regionCode": string,
  "rankPreference": enum (RankPreference),
  "includedType": string,
  "openNow": boolean,
  "minRating": number,
  "maxResultCount": integer,
  "priceLevels": [
    enum (PriceLevel)
  ],
  "strictTypeFiltering": boolean,
  "locationBias": {
    object (LocationBias)
  },
  "locationRestriction": {
    object (LocationRestriction)
  },
  "evOptions": {
    object (EVOptions)
  }
}
Fields
textQuery

string

Required. The text query for textual search.

languageCode

string

Place details will be displayed with the preferred language if available. If the language code is unspecified or unrecognized, place details of any language may be returned, with a preference for English if such details exist.

Current list of supported languages: https://developers.google.com/maps/faq#languagesupport.

regionCode

string

The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law.

For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.

Note that 3-digit region codes are not currently supported.

rankPreference

enum (RankPreference)

How results will be ranked in the response.

includedType

string

The requested place type. Full list of types supported: https://developers.google.com/maps/documentation/places/web-service/place-types. Only support one included type.

openNow

boolean

Used to restrict the search to places that are currently open. The default is false.

minRating

number

Filter out results whose average user rating is strictly less than this limit. A valid value must be a float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating.

maxResultCount

integer

Maximum number of results to return. It must be between 1 and 20, inclusively. The default is 20. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds the upper limit, an INVALID_ARGUMENT error is returned.

priceLevels[]

enum (PriceLevel)

Used to restrict the search to places that are marked as certain price levels. Users can choose any combinations of price levels. Default to select all price levels.

strictTypeFiltering

boolean

Used to set strict type filtering for includedType. If set to true, only results of the same type will be returned. Default to false.

locationBias

object (LocationBias)

The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with locationRestriction.

locationRestriction

object (LocationRestriction)

The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with locationBias.

evOptions

object (EVOptions)

Optional. Set the searchable EV options of a place search request.

Response body

Response proto for places.searchText.

If successful, the response body contains data with the following structure:

JSON representation
{
  "places": [
    {
      object (Place)
    }
  ]
}
Fields
places[]

object (Place)

A list of places that meet the user's text search criteria.

RankPreference

How results will be ranked in the response.

Enums
RANK_PREFERENCE_UNSPECIFIED RankPreference value not set. Will default to DISTANCE.
DISTANCE Ranks results by distance.
RELEVANCE Ranks results by relevance. Sort order determined by normal ranking stack.

LocationBias

The region to search. This location serves as a bias which means results around given location might be returned.

JSON representation
{

  // Union field type can be only one of the following:
  "rectangle": {
    object (Viewport)
  },
  "circle": {
    object (Circle)
  }
  // End of list of possible types for union field type.
}
Fields

Union field type.

type can be only one of the following:

rectangle

object (Viewport)

A rectangle box defined by northeast and southwest corner. rectangle.high() must be the northeast point of the rectangle viewport. rectangle.low() must be the southwest point of the rectangle viewport. rectangle.low().latitude() cannot be greater than rectangle.high().latitude(). This will result in an empty latitude range. A rectangle viewport cannot be wider than 180 degrees.

circle

object (Circle)

A circle defined by center point and radius.

LocationRestriction

The region to search. This location serves as a restriction which means results outside given location will not be returned.

JSON representation
{

  // Union field type can be only one of the following:
  "rectangle": {
    object (Viewport)
  }
  // End of list of possible types for union field type.
}
Fields

Union field type.

type can be only one of the following:

rectangle

object (Viewport)

A rectangle box defined by northeast and southwest corner. rectangle.high() must be the northeast point of the rectangle viewport. rectangle.low() must be the southwest point of the rectangle viewport. rectangle.low().latitude() cannot be greater than rectangle.high().latitude(). This will result in an empty latitude range. A rectangle viewport cannot be wider than 180 degrees.

EVOptions

Searchable EV options of a place search request.

JSON representation
{
  "minimumChargingRateKw": number,
  "connectorTypes": [
    enum (EVConnectorType)
  ]
}
Fields
minimumChargingRateKw

number

Optional. Minimum required charging rate in kilowatts. A place with a charging rate less than the specified rate is filtered out.

connectorTypes[]

enum (EVConnectorType)

Optional. The list of preferred EV connector types. A place that does not support any of the listed connector types is filtered out.