Google Business Performance API یک روش API
جدید دارد که امکان واکشی چندین «DailyMetrics» را در یک درخواست API فراهم میکند.
زمانبندی منسوخ شدن و دستورالعملهای انتقال از روش API reportInsights v4 به API عملکرد نمایه کسبوکار Google را مرور کنید.
Method: accounts.locations.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مکان های حساب مشخص شده را فهرست می کند.
درخواست HTTP
GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
parent | string نام حساب برای واکشی مکانها از آن. اگر Account از AccountType شخصی باشد، فقط مکانهایی که مستقیماً متعلق به حساب هستند بازگردانده میشوند، در غیر این صورت همه مکانهای قابل دسترسی را از حساب، چه بهطور مستقیم یا غیرمستقیم، برمیگرداند. |
پارامترهای پرس و جو
پارامترها |
---|
pageSize | integer چند مکان برای واکشی در هر صفحه. پیش فرض 100، حداقل 1 و حداکثر اندازه صفحه 100 است. |
pageToken | string اگر مشخص شده باشد، page بعدی مکان ها را واکشی می کند. نشانه صفحه با تماس های قبلی به locations.list برگردانده می شود، زمانی که مکان های بیشتری از اندازه صفحه درخواستی وجود داشته باشد. |
filter | string فیلتری که مکان ها را برای بازگشت محدود می کند. پاسخ فقط شامل ورودی هایی می شود که با فیلتر مطابقت دارند. اگر filter خالی باشد، محدودیت ها اعمال می شود و همه مکان ها (صفحه بندی شده) برای حساب درخواستی بازیابی می شوند. برای اطلاعات بیشتر در مورد فیلدهای معتبر و استفاده از نمونه، به راهنمای کار با داده های مکان مراجعه کنید. |
languageCode (deprecated) | string کد زبان BCP 47 برای دریافت ویژگیهای مکان نمایشی. اگر این زبان در دسترس نباشد، به زبان مکان ارائه میشود. اگر هیچکدام در دسترس نباشد، به زبان انگلیسی ارائه خواهند شد. منسوخ شده است. پس از 15 آگوست 2020، این فیلد دیگر اعمال نخواهد شد. در عوض، زبان مکان همیشه استفاده خواهد شد. |
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 مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 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)."]]