Method: googleLocations.search
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://mybusiness.googleapis.com/v4/googleLocations:search
网址采用 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 。搜索查询。这可以作为 location 对象或字符串查询提供。search_query 只能是下列其中一项: |
location |
object (Location )
要搜索的位置。如果提供,系统将查找与提供的营业地点详情相符的营业地点。
|
query |
string
要搜索的文本查询。与提供确切位置相比,通过查询字符串获得的搜索结果在准确性方面会降低,但可以提供更多不完全匹配的结果。
|
响应正文
如果成功,响应正文将包含结构如下的数据:
GoogleLocations.SearchGoogleLocations 的响应消息。
字段 |
googleLocations[] |
object (GoogleLocation )
可能与指定请求可能匹配的 GoogleLocation 集合,按精确度从高到低排序。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
如需了解详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\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)."]]