比较 X API 的 Post 计数端点
近期 Post 计数比较
| 说明 | 企业版 | X API v2 |
|---|---|---|
| 主机域名 | https://gnip-api.x.com | https://api.x.com |
| 端点路径 | /search/30day/accounts/:account_name/:label/counts.json | /2/tweets/counts/recent |
| 认证 | 基础认证 | OAuth 2.0 Bearer Token |
| 时间戳格式 | YYYYMMDDhhmm | YYYY-MM-DDTHH:mm:ssZ ISO 8601 / RFC 3339 |
| 返回的 Post 最久不超过 | 31 天 | 7 天 |
| 支持的 HTTP 方法 | GET | GET |
| 默认请求速率限制 | 每秒 20 次请求,搜索数据与计数请求合并计算 每分钟的速率限制将根据你的合同按合作方而定。 | 每 15 分钟每用户 180 次请求 每 15 分钟每应用 450 次请求 |
| 是否支持使用 annotations 进行过滤 | ✔ | |
| 是否支持使用 conversation_id 进行过滤 | ✔ | |
| 用于 Post 数据数组的 JSON 键名 | results | data |
| 时间粒度 | 天、小时或分钟 | 天、小时或分钟 |
| 时区 | UTC | UTC |
| 选择时间范围的请求参数 | fromDate toDate | start_time end_time |
| 按 Post ID 导航的请求参数 | since_id until_id | |
| 是否需要使用与项目关联的开发者应用的凭据 | ✔ |
全量归档 Post 计数比较
| 描述 | 企业版 | X API v2 |
|---|---|---|
| 主机域名 | https://gnip-api.x.com | https://api.x.com |
| 端点路径 | /search/fullarchive/accounts/:account_name/:label/counts | /2/tweets/counts/all |
| 认证 | 基础认证 | OAuth 2.0 持有者令牌 |
| 时间戳格式 | YYYYMMDDHHMM | YYYY-MM-DDTHH:mm:ssZ ISO 8601 / RFC 3339 |
| 返回的 Post 计数不早于 | 自 2006 年 3 月起的完整归档 | 自 2006 年 3 月起的完整归档 |
| 支持的 HTTP 方法 | GET POST | GET |
| 默认请求速率限制 | 每分钟的速率限制将根据您的合同中约定的合作方条款而有所不同。 每秒 20 次请求 | 每个应用每 15 分钟 300 次请求 每个应用每秒 1 次请求 |
| 粒度 | 天、小时、分钟 | 天、小时、分钟 |
| 支持使用注释进行过滤 | ✔ | |
| 支持使用conversation_id进行过滤 | ✔ | |
| Post 数据数组的 JSON 键名 | results | data |
| 选择时间段的请求参数 | fromDate toDate | start_time end_time |
| 通过 Post ID 导航的请求参数 | since_id until_id | |
| 分页的 JSON 键名 | next | meta.next_token |
| 分页的请求参数 | next_token | next_token 或 pagination_token |
| 时区 | UTC | UTC |
| 需要使用与具有学术研究访问权限的Project关联的开发者应用的凭据 | ✔ |
过滤运算符对比
- 企业版运算符没有子层级。所有企业版运算符对所有企业版用户均可用。
- 核心(Core):这些运算符对任何 v2 用户都可用。
- 高级(Advanced):这些运算符仅对已获批学术研究访问权限的用户开放。
| Enterprise | v2 | |
|---|---|---|
| keyword | Available | Core |
| emoji | Available | Core |
| “exact phrase” | Available | Core |
| # | Available | Core |
| $ | Available | Advanced |
| @ | Available | Core |
| from: | Available | Core |
| to: | Available | Core |
| url: | Available | Core |
| retweets_of: | Available | Core |
| context: | Core | |
| entity: | Core - Only available with recent search | |
| conversation_id: | Core | |
| place: | Available | Advanced |
| place_country: | Available | Advanced |
| point_radius: | Available | Advanced |
| bounding_box: | Available | Advanced |
| is:retweet | Available | Core |
| is:reply | Available | Core |
| is:quote | Available | Core |
| is:verified | Available | Core |
| -is:nullcast | Available | Advanced |
| has:hashtags | Available | Core |
| has:cashtags | Available | Advanced |
| has:links | Available | Core |
| has:mentions | Available | Core |
| has:media | Available | Core |
| has:images | Available | Core |
| has:videos | Available | Core |
| has:geo | Available | Advanced |
| lang: | Available | Core |
| list: | Advanced | |
| has:profile_geo | Available | |
| profile_country | Available | |
| profile_locality | Available | |
| profile_region | Available | |
| proximity | Available |