سرور MCP را برای Google Analytics امتحان کنید. از
GitHub نصب کنید و برای جزئیات بیشتر به
اطلاعیه مراجعه کنید.
Method: accounts.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
همه حسابهای قابل دسترسی تماسگیرنده را برمیگرداند.
توجه داشته باشید که این حسابها ممکن است در حال حاضر دارای ویژگیهای GA نباشند. حسابهای حذفشده نرم (یعنی «حذفشده») بهطور پیشفرض مستثنی هستند. اگر هیچ حساب مرتبطی پیدا نشد، یک لیست خالی برمی گرداند.
درخواست HTTP
GET https://analyticsadmin.googleapis.com/v1beta/accounts
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
pageSize | integer حداکثر تعداد منابع برای بازگشت. این سرویس ممکن است کمتر از این مقدار را بازگرداند، حتی اگر صفحات اضافی وجود داشته باشد. اگر نامشخص باشد، حداکثر 50 منبع برگردانده می شود. حداکثر مقدار 200 است. (مقادیر بالاتر تا حداکثر اجباری خواهد بود) |
pageToken | string یک نشانه صفحه، دریافت شده از تماس قبلی accounts.list . این را برای بازیابی صفحه بعدی ارائه کنید. هنگام صفحهبندی، تمام پارامترهای دیگر ارائهشده به accounts.list باید با فراخوانی که توکن صفحه را ارائه میکند مطابقت داشته باشد. |
showDeleted | boolean آیا شامل حسابهای حذفشده نرمافزار (یعنی «حذفشده») در نتایج میشود. حساب ها را می توان بررسی کرد تا مشخص شود که آیا حذف شده اند یا خیر. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
درخواست پیام برای accounts.list RPC.
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"accounts": [
{
object (Account )
}
],
"nextPageToken": string
} |
فیلدها |
---|
accounts[] | object ( Account ) نتایجی که برای تماس گیرنده قابل دسترسی بود. |
nextPageToken | string یک نشانه، که می تواند به عنوان pageToken برای بازیابی صفحه بعدی ارسال شود. اگر این قسمت حذف شود، هیچ صفحه بعدی وجود ندارد. |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/analytics.readonly
-
https://www.googleapis.com/auth/analytics.edit
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eRetrieves all Google Analytics 4 accounts accessible by the authenticated user, including pagination options.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering to include or exclude soft-deleted accounts.\u003c/p\u003e\n"],["\u003cp\u003eReturns an empty list if no matching accounts are found.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific authorization scopes for data access.\u003c/p\u003e\n"],["\u003cp\u003eProvides details on the HTTP request, query parameters, and response structure.\u003c/p\u003e\n"]]],["This document details how to retrieve a list of accessible accounts using the Analytics Admin API. The core action is sending a `GET` request to the specified URL. Optional query parameters, `pageSize` and `pageToken`, enable pagination. The `showDeleted` parameter allows inclusion of soft-deleted accounts. The request body must be empty. A successful response returns a JSON object containing an array of `accounts` and a `nextPageToken` for subsequent pages. Authorization requires specific OAuth scopes.\n"],null,["# Method: accounts.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListAccountsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns all accounts accessible by the caller.\n\nNote that these accounts might not currently have GA properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.\n\n### HTTP request\n\n`GET https://analyticsadmin.googleapis.com/v1beta/accounts`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` The maximum number of resources to return. The service may return fewer than this value, even if there are additional pages. If unspecified, at most 50 resources will be returned. The maximum value is 200; (higher values will be coerced to the maximum) |\n| `pageToken` | `string` A page token, received from a previous `accounts.list` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `accounts.list` must match the call that provided the page token. |\n| `showDeleted` | `boolean` Whether to include soft-deleted (ie: \"trashed\") Accounts in the results. Accounts can be inspected to determine whether they are deleted or not. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nRequest message for accounts.list RPC.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"accounts\": [ { object (/analytics/devguides/config/admin/v1/rest/v1beta/accounts#Account) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `accounts[]` | `object (`[Account](/analytics/devguides/config/admin/v1/rest/v1beta/accounts#Account)`)` Results that were accessible to the caller. |\n| `nextPageToken` | `string` A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/analytics.readonly`\n- `https://www.googleapis.com/auth/analytics.edit`"]]