同步分析
GET stats/accounts/:account_id¶
检索当前账号的同步分析。允许的最大时间范围 (end_time
- start_time
) 为 7 天。
资源 URL¶
https://ads-api.twitter.com/10/stats/accounts/:account_id
参数¶
名称 | 说明 |
---|---|
account_id 必需 |
所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。 类型:string 示例: |
end_time 必需 |
使用以 ISO 8601 表示的指定结束时间限定检索数据的范围。 注意:必须以整小时数(0 分 0 秒)表示。 类型:string 示例: |
entity 必需 |
要检索数据的实体类型。 类型:enum 可能值: |
entity_ids 必需 |
要检索数据的特定实体。指定以逗号分隔的实体 ID 列表。 注意:最多可提供 20 个实体 ID。 类型:string 示例: |
granularity 必需 |
指定检索数据的粒度。 类型:enum 可能值: |
metric_groups 必需 |
应该返回的特定指标。指定以逗号分隔的指标组列表。有关详情,请参见指标与细分。 注意: 类型:enum 可能值: |
placement 必需 |
将检索到的数据限定到特定位置。 注意:每个请求只接受一个值。对于同时具有 Twitter 和 Twitter 受众平台位置的实体,需要单独发出请求,每个位置值对应一个请求。 类型:enum 可能值: |
start_time 必需 |
使用以 ISO 8601 表示的指定开始时间限定检索数据的范围。 注意:必须以整小时数(0 分 0 秒)表示。 类型:string 示例: |
请求示例¶
GET https://ads-api.twitter.com/10/stats/accounts/18ce54d4x5t?entity=LINE_ITEM&entity_ids=8u94t&start_time=2017-05-19&end_time=2017-05-26&granularity=TOTAL&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT
响应示例¶
{
"data_type": "stats",
"time_series_length": 1,
"data": [
{
"id": "8u94t",
"id_data": [
{
"segment": null,
"metrics": {
"impressions": [
1233
],
"tweets_send": null,
"qualified_impressions": null,
"follows": null,
"app_clicks": null,
"retweets": null,
"likes": [
1
],
"engagements": [
58
],
"clicks": [
58
],
"card_engagements": null,
"poll_card_vote": null,
"replies": null,
"carousel_swipes": null
}
}
]
}
],
"request": {
"params": {
"start_time": "2017-05-19T07:00:00Z",
"segmentation_type": null,
"entity_ids": [
"8u94t"
],
"end_time": "2017-05-26T07:00:00Z",
"country": null,
"placement": "ALL_ON_TWITTER",
"granularity": "TOTAL",
"entity": "LINE_ITEM",
"platform": null,
"metric_groups": [
"ENGAGEMENT"
]
}
}
}