Method: accounts.locations.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
要从中提取营业地点的账号的名称。如果 Account 的类型为 AccountType 个人,则系统只会返回该账号直接拥有的营业地点,否则会返回该账号中的所有可访问营业地点(直接或间接)。
|
查询参数
参数 |
pageSize |
integer
每页要提取的营业地点数量。默认值为 100,最小值为 1,页面大小上限为 100。
|
pageToken |
string
如果指定,它将提取下 page 个营业地点。当营业地点数量超出了所请求的页面大小所允许的数量时,之前对 locations.list 的调用便会返回页面令牌。
|
filter |
string
限制要返回的位置的过滤条件。响应仅包含与过滤条件匹配的条目。如果 filter 为空,则系统会应用限制条件,并为所请求的账号检索所有营业地点(已分页)。 如需详细了解有效字段和用法示例,请参阅使用位置数据指南。
|
languageCode (deprecated) |
string
获取显示位置属性的 BCP 47 语言代码。如果未提供这种语言,则会以相应地理位置所用的语言提供。如果这两种付款方式都无法提供,我们将以英文提供。 已弃用。2020 年 8 月 15 日之后,系统将不再应用此字段。系统会始终使用营业地点的语言。
|
orderBy |
string
请求的排序顺序。多个字段应以英文逗号分隔,并遵循 SQL 语法。默认排序顺序为升序。要指定降序,在后面添加后缀“desc ”。orderBy 的有效字段是 locationName 和 storeCode。例如:“locationName, storeCode desc”或“locationName”或“storeCode desc”
|
响应正文
如果成功,响应正文将包含结构如下的数据:
Locations.ListLocations 的响应消息。
JSON 表示法 |
{
"locations": [
{
object (Location )
}
],
"nextPageToken": string,
"totalSize": integer
} |
字段 |
locations[] |
object (Location )
营业地点。
|
nextPageToken |
string
如果营业地点数量超过所请求的页面大小,系统会使用令牌填充此字段,以在后续调用 locations.list 时获取下一页营业地点。如果没有其他营业地点,此字段将不会显示在响应中。
|
totalSize |
integer
列表中的大致地理位置数量(不考虑分页)。
|
授权范围
需要以下 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\u003eLists all accessible locations for a specified Google My Business account, including directly or indirectly owned locations based on account type.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering, pagination, and sorting of location data through query parameters like \u003ccode\u003efilter\u003c/code\u003e, \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, and \u003ccode\u003eorderBy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReturns a list of locations with details like location name, store code, and other properties, along with pagination information if applicable.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes for accessing and managing business data.\u003c/p\u003e\n"],["\u003cp\u003eProvides a total count of locations irrespective of pagination for easier management and understanding of the data set.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.locations.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListLocationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n\nLists the locations for the specified account.\n\n### HTTP request\n\n`GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` The name of the account to fetch locations from. If the [Account](/my-business/reference/rest/v4/accounts#Account) is of [AccountType](/my-business/reference/rest/v4/accounts#Account.AccountType) PERSONAL, only Locations that are directly owned by the Account are returned, otherwise it will return all accessible locations from the Account, either directly or indirectly. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` How many locations to fetch per page. Default is 100, minimum is 1, and maximum page size is 100. |\n| `pageToken` | `string` If specified, it fetches the next `page` of locations. The page token is returned by previous calls to `locations.list` when there were more locations than could fit in the requested page size. |\n| `filter` | `string` A filter constraining the locations to return. The response includes only entries that match the filter. If `filter` is empty, then constraints are applied and all locations (paginated) are retrieved for the requested account. For more information about valid fields and example usage, see [Work with Location Data Guide](https://developers.google.com/my-business/content/location-data#filter_results_when_you_list_locations). |\n| `languageCode` **(deprecated)** | `string` The BCP 47 code of language to get display location properties in. If this language is not available, they will be provided in the language of the location. If neither is available, they will be provided in English. Deprecated. After August 15th, 2020, this field will no longer be applied. Instead, the language of the location will always be used. |\n| `orderBy` | `string` Sorting order for the request. Multiple fields should be comma-separated, following SQL syntax. The default sorting order is ascending. To specify descending order, a suffix \" desc\" should be added. Valid fields to orderBy are locationName and storeCode. For example: \"locationName, storeCode desc\" or \"locationName\" or \"storeCode desc\" |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for Locations.ListLocations.\n\n| JSON representation ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"locations\": [ { object (/my-business/reference/rest/v4/accounts.locations#Location) } ], \"nextPageToken\": string, \"totalSize\": integer } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `locations[]` | `object (`[Location](/my-business/reference/rest/v4/accounts.locations#Location)`)` The locations. |\n| `nextPageToken` | `string` If the number of locations exceeded the requested page size, this field is populated with a token to fetch the next page of locations on a subsequent call to `locations.list`. If there are no more locations, this field is not present in the response. |\n| `totalSize` | `integer` The approximate number of Locations in the list irrespective of pagination. |\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)."]]