组件使用对比
接口说明
获取小程序的留资组件配置的组件使用对比数据。数据内容与“小程序控制台-数据-数据中心-能力-线索组件-组件使用对比数据”页面保持一致。
使用限制
- 每日 14:00 前更新前一日数据
- 只能查询昨天以前,且是近90天内的数据
基本信息
| 名称 | 描述 |
|---|---|
| HTTP URL | https://open.douyin.com/api/platform/v2/data_analysis/query_component_with_data/ |
| HTTP Method | POST |
| 权限要求 | 服务商代调用场景下,需商家授予数据分析权限集 |
请求参数
请求头
access-token必填String
当非服务商调用时,调用https://developer.toutiao.com/api/apps/v2/token生成的token
当服务商调用时,调用https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/生成的token
当服务商调用时,调用https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/生成的token
content-type必填String
示例:application/json
固定值"application/json"
Body
end_time必填Int64
结束时间,必须是昨天以前的某个时间戳
page_no必填Int64
页号
page_size必填Int64
页面大小
start_time必填Int64
开始时间,必须是昨天以前的某个时间戳
componentId_listArray<String>
组件配置id(配置的唯一标识)
请求示例
curl --location --request POST 'https://open.douyin.com/api/platform/v2/data_analysis/query_component_with_data/' \ --header 'content-type: application/json' \ --header 'access-token: 0801121846735352506a356a6' \ --data '{"page_size":1,"start_time":17217979,"end_time":4780363493,"componentId_list":[],"page_no":1}'
响应参数
Body展开全部子属性
err_msg必填String
错误信息
err_no必填Int32
错误码
log_id必填String
排查错误的logId
dataStruct
展开子属性
响应示例
正常响应示例异常响应示例
{ "data": { "DataList": [ { "ComponentClickPv": 50, "ComponentClickUv": 6, "ComponentId": "4cbc57c0949fa07ba718f1202d8c5ac6", "ComponentName": "测试", "ComponentReportPv": 171, "ComponentReportUv": 6, "ComponentShowPv": 42, "ComponentShowUv": 9 }, { "ComponentClickPv": 10, "ComponentClickUv": 1, "ComponentId": "093e4cd2135a967dabad43f96564c7db", "ComponentName": "测试1", "ComponentReportPv": 1, "ComponentReportUv": 1, "ComponentShowPv": 1, "ComponentShowUv": 1 }, { "ComponentClickPv": 9, "ComponentClickUv": 1, "ComponentId": "61adda99594c19e7733fc8af512388ae", "ComponentName": "测试4", "ComponentReportPv": 1, "ComponentReportUv": 1, "ComponentShowPv": 1, "ComponentShowUv": 1 }, { "ComponentClickPv": 7, "ComponentClickUv": 1, "ComponentId": "caa8daa5a7fe93a65b736392f698e56f", "ComponentName": "测试3", "ComponentReportPv": 1, "ComponentReportUv": 1, "ComponentShowPv": 1, "ComponentShowUv": 1 }, { "ComponentClickPv": 8, "ComponentClickUv": 1, "ComponentId": "f0f696d9d808e04cb2528c762a79dbb4", "ComponentName": "测试2", "ComponentReportPv": 1, "ComponentReportUv": 1, "ComponentShowPv": 1, "ComponentShowUv": 1 }, { "ComponentClickPv": 9, "ComponentClickUv": 1, "ComponentId": "fbca42a8c3ce85cc20704b50eae6b94c", "ComponentName": "测试5", "ComponentReportPv": 4, "ComponentReportUv": 1, "ComponentShowPv": 1, "ComponentShowUv": 1 } ], "Total": 6 }, "err_msg": "success", "err_no": 0, "log_id": "20230625113633EA2ABA88EB7F721B6E4D" }
错误码
| HTTP 状态码 | 错误码 | 错误码描述 | 排查建议 |
|---|---|---|---|
| 200 | -1 | 系统错误 | 建议重试,若多次重试失败,可向平台反馈该问题 |
| 200 | 11009 | 参数不合法或缺少参数 | 检查参数合法性,注意参数类型以及是否缺少必要参数 |
| 200 | 28001003 | access_token无效 | 请检查access_token |
| 200 | 28001007 | 必填字段缺失 | 请检查必填字段 |
| 200 | 28001008 | access_token过期 | 请刷新或重新授权access_token |
