Method: accounts.locations.findMatches
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
查找与指定位置匹配的所有可能的位置。仅当营业地点未经验证时,此操作才有效。
HTTP 请求
POST https://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*}:findMatches
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
要查找其匹配项的营业地点的资源名称。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"languageCode": string,
"numResults": integer,
"maxCacheDuration": string
} |
字段 |
languageCode |
string
匹配位置的首选语言(采用 BCP-47 格式)。
|
numResults |
integer
要返回的匹配项数量。默认值为 3,最大值为 10。请注意,如果请求更多,则延迟时间可能会增加。没有分页。
|
maxCacheDuration |
string (Duration format)
已弃用。系统会为所有请求忽略此字段。 该持续时间以秒为单位,最多包含九个小数位,以“s ”结尾。示例:"3.5s" 。
|
响应正文
如果成功,响应正文将包含结构如下的数据:
Locations.FindMatchingLocations 的响应消息。
JSON 表示法 |
{
"matchedLocations": [
{
object (MatchedLocation )
}
],
"matchTime": string
} |
字段 |
matchedLocations[] |
object (MatchedLocation )
可能与指定地理位置可能匹配的地理位置集合,按匹配度从高到低排序。如果存在完全匹配,则会排在首位。
|
matchTime |
string (Timestamp format)
对此营业地点最后一次执行匹配算法的时间。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
如需了解详情,请参阅 OAuth 2.0 概览。
MatchedLocation
JSON 表示法 |
{
"location": {
object (Location )
},
"isExactMatch": boolean
} |
字段 |
location |
object (Location )
可能匹配的稀疏填充位置。未填充的字段包括但不限于:名称(无法通过 locations.get 和 locations.batchGet 检索匹配的营业地点);storeCode ;serviceArea 覆盖范围详细信息;labels ;adWordsLocationExtensions ;photos
|
isExactMatch |
boolean
这是完全匹配吗?
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eFinds potential location matches for unverified locations, ranked by match quality.\u003c/p\u003e\n"],["\u003cp\u003eSends an HTTP POST request to \u003ccode\u003ehttps://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*}:findMatches\u003c/code\u003e, specifying the location and optional language, result count.\u003c/p\u003e\n"],["\u003cp\u003eReceives a response with a list of matched locations and a timestamp indicating when the matching algorithm was last run.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with either \u003ccode\u003ehttps://www.googleapis.com/auth/plus.business.manage\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/business.manage\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eEach matched location includes basic information and a flag indicating whether it's an exact match.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.locations.findMatches\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.FindMatchingLocationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n- [MatchedLocation](#MatchedLocation)\n - [JSON representation](#MatchedLocation.SCHEMA_REPRESENTATION)\n\nFinds all of the possible locations that are a match to the specified location. This operation is only valid if the location is unverified.\n\n### HTTP request\n\n`POST https://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*}:findMatches`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------|\n| `name` | `string` The resource name of the location to find matches for. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|---------------------------------------------------------------------------------------|---|\n| ``` { \"languageCode\": string, \"numResults\": integer, \"maxCacheDuration\": string } ``` |\n\n| Fields ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `languageCode` | `string` The preferred language for the matching location (in BCP-47 format). |\n| `numResults` | `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| `maxCacheDuration` | `string (`[Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)` format)` Deprecated. This field is ignored for all requests. A duration in seconds with up to nine fractional digits, terminated by '`s`'. Example: `\"3.5s\"`. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for Locations.FindMatchingLocations.\n\n| JSON representation ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"matchedLocations\": [ { object (/my-business/reference/rest/v4/accounts.locations/findMatches#MatchedLocation) } ], \"matchTime\": string } ``` |\n\n| Fields ||\n|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `matchedLocations[]` | `object (`[MatchedLocation](/my-business/reference/rest/v4/accounts.locations/findMatches#MatchedLocation)`)` A collection of locations that are potential matches to the specified location, listed in order from best to least match. If there is an exact match, it will be in the first position. |\n| `matchTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` When the matching algorithm was last executed for this location. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\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).\n\nMatchedLocation\n---------------\n\nRepresents a possible match to a location.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"location\": { object (/my-business/reference/rest/v4/accounts.locations#Location) }, \"isExactMatch\": boolean } ``` |\n\n| Fields ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `location` | `object (`[Location](/my-business/reference/rest/v4/accounts.locations#Location)`)` The sparsely populated location that is a potential match. Unpopulated fields include, but may not be limited to: name (the matched location cannot be retrieved via `locations.get` nor `locations.batchGet`); `storeCode`; `serviceArea` coverage area details; `labels`; `adWordsLocationExtensions`; `photos` |\n| `isExactMatch` | `boolean` Is this an exact match? |"]]