Method: googleLocations.search
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Найдите все возможные местоположения, соответствующие указанному запросу.
HTTP-запрос
POST https://mybusiness.googleapis.com/v4/googleLocations:search
URL-адрес использует синтаксис транскодирования gRPC .
Тело запроса
Тело запроса содержит данные следующей структуры:
JSON-представление |
---|
{
"resultCount": integer,
// Union field search_query can be only one of the following:
"location": {
object (Location )
},
"query": string
// End of list of possible types for union field search_query .
} |
Поля |
---|
resultCount | integer Количество совпадений для возврата. Значение по умолчанию — 3, максимум — 10. Обратите внимание, что задержка может увеличиться, если запрошено большее количество. Пагинации нет. |
Поле объединения search_query . Поисковый запрос. Это может быть предоставлено либо как объект местоположения, либо как строковый запрос. search_query может быть только одним из следующих: |
location | object ( Location ) Место для поиска. Если указано, будут найдены местоположения, соответствующие предоставленным данным о местоположении. |
query | string Текстовый запрос для поиска. Результаты поиска по строке запроса будут менее точными, чем при указании точного местоположения, но могут давать больше неточных совпадений. |
Тело ответа
В случае успеха тело ответа содержит данные следующей структуры:
Ответное сообщение для GoogleLocations.SearchGoogleLocations.
JSON-представление |
---|
{
"googleLocations": [
{
object (GoogleLocation )
}
]
} |
Поля |
---|
googleLocations[] | object ( GoogleLocation ) Коллекция местоположений GoogleLocations, которые потенциально соответствуют указанному запросу, перечисленные в порядке от большей к меньшей точности. |
Области авторизации
Требуется одна из следующих областей OAuth:
-
https://www.googleapis.com/auth/plus.business.manage
-
https://www.googleapis.com/auth/business.manage
Дополнительную информацию см. в обзоре OAuth 2.0 .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-25 UTC.
[null,null,["Последнее обновление: 2025-07-25 UTC."],[[["\u003cp\u003eSearch for Google Locations using either a specific location or a text-based query.\u003c/p\u003e\n"],["\u003cp\u003eSpecify the desired number of search results, with a maximum of 10.\u003c/p\u003e\n"],["\u003cp\u003eResults are returned in order of accuracy, with the most accurate matches appearing first.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific authorization scopes for access.\u003c/p\u003e\n"]]],["The core content describes searching for Google locations via a `POST` request to `https://mybusiness.googleapis.com/v4/googleLocations:search`. The request body can include either a `location` object or a string `query` within the `search_query` field, plus an integer `resultCount`. The response body contains an array of `googleLocations`, representing potential matches ranked by accuracy. Authorization requires either `plus.business.manage` or `business.manage` OAuth scopes.\n"],null,["# Method: googleLocations.search\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SearchGoogleLocationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n\nSearch all of the possible locations that are a match to the specified request.\n\n### HTTP request\n\n`POST https://mybusiness.googleapis.com/v4/googleLocations:search`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"resultCount\": integer, // Union field `search_query` can be only one of the following: \"location\": { object (/my-business/reference/rest/v4/accounts.locations#Location) }, \"query\": string // End of list of possible types for union field `search_query`. } ``` |\n\n| Fields ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `resultCount` | `integer` The number of matches to return. The default value is 3, with a maximum of 10. Note that latency may increase if more are requested. There is no pagination. |\n| Union field `search_query`. Search query. This can be provided either as a location object or as a string query. `search_query` can be only one of the following: |||\n| `location` | `object (`[Location](/my-business/reference/rest/v4/accounts.locations#Location)`)` Location to search for. If provided, will find locations which match the provided location details. |\n| `query` | `string` Text query to search for. The search results from a query string will be less accurate than if providing an exact location, but can provide more inexact matches. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for GoogleLocations.SearchGoogleLocations.\n\n| JSON representation ||\n|---------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"googleLocations\": [ { object (/my-business/reference/rest/v4/googleLocations#GoogleLocation) } ] } ``` |\n\n| Fields ||\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `googleLocations[]` | `object (`[GoogleLocation](/my-business/reference/rest/v4/googleLocations#GoogleLocation)`)` A collection of GoogleLocations that are potential matches to the specified request, listed in order from most to least accuracy. |\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/plus.business.manage`\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]