试用 Google Analytics 的 MCP 服务器。从
GitHub 安装,并参阅
公告了解详情。
Method: properties.audienceLists.exportSheet
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://analyticsdata.googleapis.com/v1alpha/{name=properties/*/audienceLists/*}:exportSheet
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。要从中检索用户的受众群体名单的名称。格式:properties/{property}/audienceLists/{audienceList}
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"offset": string,
"limit": string
} |
字段 |
offset |
string (int64 format)
可选。起始行的行数。第一行计为第 0 行。 分页时,第一个请求不会指定偏移量;或者等同于将偏移量设置为 0;第一个请求会返回前 limit 行。第二个请求将偏移量设置为第一个请求的 limit ;第二个请求会返回第二个 limit 行。 如需详细了解此分页参数,请参阅分页。
|
limit |
string (int64 format)
可选。要返回的行数。如果未指定,则返回 10,000 行。无论您请求多少行,该 API 每个请求最多只会返回 25 万行。limit 必须为正数。 如果维度值的数量不如 limit 多,API 返回的行数也可能少于请求的 limit 。 如需详细了解此分页参数,请参阅分页。
|
响应正文
创建的 Google 表格,其中包含受众群体名单中的用户列表。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"spreadsheetUri": string,
"spreadsheetId": string,
"rowCount": integer,
"audienceList": {
object (AudienceList )
}
} |
字段 |
spreadsheetUri |
string
您可以在浏览器中访问的 URI,以查看 Google 表格。
|
spreadsheetId |
string
用于标识创建的 Google 表格资源的 ID。
|
rowCount |
integer
AudienceList 结果中的总行数。rowCount 与响应中返回的行数、limit 请求参数和 offset 请求参数无关。例如,如果某个查询返回 175 行,并在 API 请求中包含 limit (50),则响应将包含 rowCount (175),但只有 50 行。 如需详细了解此分页参数,请参阅分页。
|
audienceList |
object (AudienceList )
与要导出的 AudienceList 相关的配置数据。返回此值是为了帮助解读此回复的 Google 表格中的 AudienceList。 例如,AudienceList 中的行数可能比 Google 表格中的行数多,在这种情况下,您可能需要发送另一个使用其他 offset 值的表格导出请求,以便在另一个 Google 表格中检索下一页的行。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eExports an audience list of users to a Google Sheet after the audience is created using \u003ccode\u003eaudienceLists.create\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the audience list name in the request path and optionally pagination parameters in the request body.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a URI and ID for the created Google Sheet, along with the total row count and audience list configuration data.\u003c/p\u003e\n"],["\u003cp\u003eThis method is in alpha stability and feedback is encouraged through a provided form.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific authorization scopes related to Analytics, Drive, and Spreadsheets.\u003c/p\u003e\n"]]],["This document outlines the process for exporting a Google Analytics 4 audience list to a Google Sheet via the `audienceLists.exportSheet` method. This process requires a POST request to a specific URL including the audience list's `name` as a path parameter. The request body specifies optional `offset` and `limit` parameters for pagination of rows, with a maximum of 250,000 rows per request. The response contains the `spreadsheetUri`, `spreadsheetId`, `rowCount`, and `audienceList` details of the exported data, and various oauth scope might be needed for authorization.\n"],null,["# Method: properties.audienceLists.exportSheet\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.SheetExportAudienceListResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nExports an audience list of users to a Google Sheet. After creating an audience, the users are not immediately available for listing. First, a request to `audienceLists.create` is necessary to create an audience list of users, and then second, this method is used to export those users in the audience list to a Google Sheet.\n\nSee [Creating an Audience List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Lists with examples.\n\nAudiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see \u003chttps://support.google.com/analytics/answer/9267572\u003e.\n\nThis method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.\n\n### HTTP request\n\n`POST https://analyticsdata.googleapis.com/v1alpha/{name=properties/*/audienceLists/*}:exportSheet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The name of the audience list to retrieve users from. Format: `properties/{property}/audienceLists/{audienceList}` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------|\n| ``` { \"offset\": string, \"limit\": string } ``` |\n\n| Fields ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `offset` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Optional. The row count of the start row. The first row is counted as row 0. When paging, the first request does not specify offset; or equivalently, sets offset to 0; the first request returns the first `limit` of rows. The second request sets offset to the `limit` of the first request; the second request returns the second `limit` of rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). |\n| `limit` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Optional. The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. `limit` must be positive. The API can also return fewer rows than the requested `limit`, if there aren't as many dimension values as the `limit`. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). |\n\n### Response body\n\nThe created Google Sheet with the list of users in an audience list.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"spreadsheetUri\": string, \"spreadsheetId\": string, \"rowCount\": integer, \"audienceList\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.audienceLists#AudienceList) } } ``` |\n\n| Fields ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheet``Uri` | `string` A uri for you to visit in your browser to view the Google Sheet. |\n| `spreadsheet``Id` | `string` An ID that identifies the created Google Sheet resource. |\n| `row``Count` | `integer` The total number of rows in the AudienceList result. `rowCount` is independent of the number of rows returned in the response, the `limit` request parameter, and the `offset` request parameter. For example if a query returns 175 rows and includes `limit` of 50 in the API request, the response will contain `rowCount` of 175 but only 50 rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). |\n| `audience``List` | `object (`[AudienceList](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.audienceLists#AudienceList)`)` Configuration data about AudienceList being exported. Returned to help interpret the AudienceList in the Google Sheet of this response. For example, the AudienceList may have more rows than are present in the Google Sheet, and in that case, you may want to send an additional sheet export request with a different `offset` value to retrieve the next page of rows in an additional Google Sheet. |\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`\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.file`\n- `https://www.googleapis.com/auth/spreadsheets`"]]