还没有输出。提交表单以生成内容。
透明定价,无隐藏费用。按需支付。
| 规则与模式 | 渠道 | 积分 | 价格(美元) | 官方/参考价格 | 每日节省 |
|---|---|---|---|---|---|
tweet-detail otherTwitter | Starter | 0.01per post | $0.00005 | - | - |
twitter-api-graphql 使用完整指南
通过单个推文 ID 获取完整的推文详情,包括内容、互动指标、回复和对话上下文。

ApiPass 上的 Twitter Graphql Tweet Detail API 是一个强大的端点,可让开发者使用公开推文的唯一推文 ID,获取 X(原 Twitter)上任意公开推文的全面信息。通过 ApiPass 统一任务系统调用 twitter/graphql/tweet-detail 模型,你将收到结构化 JSON 数据,其中包含推文文本、作者信息、媒体附件、互动统计(点赞、转推、回复、浏览量)、对话线程、引用推文、社区注释(Birdwatch)以及富文章内容。该 API 利用 Twitter 的内部 GraphQL schema,让你能够访问比传统 REST 端点丰富得多的数据字段,同时抽象掉认证复杂性、代理管理和速率限制处理。
跳过 Twitter 官方 API 层级漫长的审批流程。只需一个 ApiPass API key,即可立即开始使用。
在单次请求中访问 Graphql 级别字段,包括 Birdwatch 注释、语音推文、社区上下文、文章富内容和完整对话线程。
默认 channel: auto 设置会根据实时价格和稳定性指标,在多个提供商之间自动分配任务,兼顾成本效率与可靠性。
可在 starter、regular 或 official 层级之间选择,根据项目的具体需求在预算与性能之间取得平衡。
提交任务后立即获取 task ID,可轮询结果,也可让 ApiPass 将完成后的数据推送到你的 webhook URL。
使用 withCommunity、withBirdwatchNotes、withVoice 和 withArticlePlainText 等布尔标志精细调整响应负载,只获取你需要的数据。
不仅可获取目标推文,还可检索其完整回复树、引用推文和父级线程,非常适合构建对话查看器或情感分析器。
提取嵌入图片、视频、语音注释和长篇文章内容,并通过专用开关控制富内容状态和纯文本提取。
拉取附加在推文上的上下文事实核查和社区贡献注释,为你的应用提供内置可信度信号。
为博客、新闻网站或聊天应用提供自定义推文预览组件和嵌入卡片支持。
构建能够梳理回复链、识别讨论中的关键影响者并可视化互动流向的工具。
为新闻报道、研究或法律文档创建重要推文及其完整回复上下文的永久、可搜索归档。
将带有互动指标的结构化推文数据输入 LLM 微调工作流或情感分类模型。
了解 ApiPass 在访问门槛、价格和数据深度方面与 Twitter 官方 API 的对比,以及为什么越来越多开发者正在转向 ApiPass。
Twitter 官方 v2 API 需要付费开发者订阅,并设有严格的月度推文额度和应用审核流程。ApiPass 只需要一个 API key,按成功任务计费,并提供超低成本的 starter 渠道,适合预算敏感型项目。
官方 GET /2/tweets/:id 端点会返回带有选定 expansions 的扁平对象。ApiPass 的 GraphQL 端点则镜像 Twitter 自身的内部数据结构,暴露 Birdwatch 注释、社区上下文、V2 时间线模块和快速推广资格标志等嵌套字段,这些字段通常无法通过公开 REST API 获取。
跟踪提及你品牌或行业的高影响力推文,拉取完整对话线程,实时了解公众情绪。
调查记者可以捕获推文及其完整回复上下文、社区注释和元数据,用于来源验证和引用。
营销平台可以验证赞助推文是否在线,衡量其互动增长趋势,并确认社区注释状态。
通过提取完整对话层级,构建可将热门 Twitter 线程转化为结构化文章或学习材料的平台。
在 ApiPass 注册,进入你的仪表板,并生成用于认证的 Bearer token。这个单一 key 可让你访问所有 ApiPass 端点,无需单独的 Twitter Developer 账户。
向 /api/v1/jobs/createTask 发送 POST 请求,将 model 设置为 twitter/graphql/tweet-detail,并在 input.variables 对象中提供目标 focalTweetId。你还可以启用 withCommunity、withBirdwatchNotes 或 withVoice 等开关进一步自定义响应,并可选择提供 callBackUrl 通过 webhook 接收结果。API 会立即返回用于跟踪的 taskId。
使用返回的 taskId 查询 /api/v1/jobs/recordInfo。可以轮询该端点,也可以等待回调触发——当 state 字段返回 success 后,解析 resultJson.resultObject 即可访问完整的推文详情负载,包括内容、互动指标、回复和对话上下文。
所有 API 都需要通过 Bearer Token 进行身份验证。
Authorization: Bearer
获取推文详情
该 API 接受具有以下结构的 JSON payload:
1{
2 "model": "string",
3 "callBackUrl": "string (optional)",
4 "channel": "auto",
5 "input": {
6 "variables": {
7 "focalTweetId": "string",
8 "referrer": "string",
9 "controller_data": "string",
10 "with_rux_injections": "boolean",
11 "includePromotedContent": "boolean",
12 "withCommunity": "boolean",
13 "withQuickPromoteEligibilityTweetFields": "boolean",
14 "withBirdwatchNotes": "boolean",
15 "withVoice": "boolean",
16 "withV2Timeline": "boolean",
17 },
18 "fieldToggles": {
19 "withArticleRichContentState": "boolean",
20 "withArticlePlainText": "boolean",
21 },
22 }
23}model必填string用于生成的模型名称
"twitter/graphql/tweet-detail"
callBackUrl可选string用于接收任务完成通知的回调 URL。如果省略,则不会发送回调。
"https://your-domain.com/api/callback"
channel可选string你可以通过 channel 参数指定 APIPASS 中对应的提供商;这些提供商负责处理实际的图像和视频生成任务。APIPASS 目前提供三种提供商选项:
channel 参数的默认值为 auto。启用后,APIPASS 会根据实时价格和稳定性指标,在可用提供商之间自动分配任务,以平衡最低成本和可靠性能。除非你有自定义路由需求,否则请保留默认值 auto。
可用选项:
auto
input 对象包含以下参数:
input.variables.focalTweetId必填string1694634492403843248
input.variables.referrer可选stringprofile
input.variables.controller_data可选stringDAACDAABDAABCgABAAAAAAAAAAAKAAkAAAABFPY0+AAAAAA=
input.variables.with_rux_injections可选booleanfalse
input.variables.includePromotedContent可选booleanfalse
input.variables.withCommunity可选booleantrue
input.variables.withQuickPromoteEligibilityTweetFields可选booleantrue
input.variables.withBirdwatchNotes可选booleantrue
input.variables.withVoice可选booleantrue
input.withV2Timeline.withVoice可选booleantrue
input.fieldToggles.withArticleRichContentState可选booleantrue
input.fieldToggles.withArticlePlainText可选booleantrue
1curl -X POST "https://api.apipass.dev/api/v1/jobs/createTask" \
2 -H "Content-Type: application/json" \
3 -H "Authorization: Bearer YOUR_API_KEY" \
4 -d '{
5 "model": "twitter/graphql/user-by-screen-name",
6 "callBackUrl": "https://your-domain.com/api/callback",
7 "input": {
8 "variables": {
9 "focalTweetId": "1694634492403843248",
10 "referrer": "profile",
11 "controller_data": "DAACDAABDAABCgABAAAAAAAAAAAKAAkAAAABFPY0+AAAAAA=",
12 "with_rux_injections": false,
13 "includePromotedContent": false,
14 "withCommunity": true,
15 "withQuickPromoteEligibilityTweetFields": true,
16 "withBirdwatchNotes": true,
17 "withVoice": true,
18 "withV2Timeline": true,
19 },
20 "fieldToggles": {
21 "withArticleRichContentState": true,
22 "withArticlePlainText": true,
23 }
24 }
25 }'1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "taskId": "task_12345678"
6 }
7}code状态码,200 表示成功,其他表示失败
message响应消息,失败时为错误描述
data.taskId用于查询任务状态和结果的任务 ID