X / Twitter API
X / Twitter 帖子串 API
解析包含某条 X (Twitter) 帖子的作者自发帖子串,从首帖一直到作者后续接续的帖子。不包含其他用户的回复。
POST/v1/run/twitter.thread
可用率
100.00%
30d · 337 次调用
请求数
339
30d · 按周,近 12 周
响应时间
3.6s
中位数 · 30d
试一试
发出你的第一个请求
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。
{
"data": {
"author": {
"handle": "alex_rivera",
"id": "a1b2c3d4",
"name": "Example title"
},
"avatarUrl": "https://example.com/image.jpg",
"bio": "A short example description of this item.",
"blueVerified": true,
"complete": true,
"conversationId": "a1b2c3d4",
"coverUrl": "https://example.com/page",
"createdUtc": 12.5,
"followers": 12500,
"following": 12500,
"location": "example",
"threadLength": 180,
"tweets": [
{
"authorHandle": "alex_rivera",
"authorId": "Alex Rivera",
"authorName": "Alex Rivera",
"bookmarkCount": 12500,
"conversationId": "a1b2c3d4",
"createdUtc": 12.5,
"id": "a1b2c3d4",
"inReplyToId": "a1b2c3d4",
"isReply": true,
"lang": "en",
"likeCount": 12500,
"media": [
{
"height": 42,
"type": "general",
"url": "https://example.com/page",
"videoUrl": "https://example.com/page",
"width": 1024
}
],
"quoteCount": 12500,
"replyCount": 12500,
"repostCount": 12500,
"source": "https://example.com/page",
"text": "A short example description of this item.",
"url": "https://example.com/page",
"viewCount": 12500
}
],
"url": "https://example.com/page",
"verified": true
},
"found": true,
"reason": "not_found"
}响应类型定义
interface TwitterThreadResponse {
data: {
author: {
handle: string;
id: string;
name: string;
};
avatarUrl?: string;
bio?: string;
blueVerified?: boolean;
complete: boolean;
conversationId: string;
coverUrl?: string;
createdUtc?: number;
followers?: number;
following?: number;
location?: string;
threadLength: number;
tweets: {
authorHandle: string;
authorId: string;
authorName: string;
bookmarkCount?: number;
conversationId: string;
createdUtc?: number;
id: string;
inReplyToId: string | null;
isReply?: boolean;
lang?: string;
likeCount?: number;
media?: {
height?: number;
type: string;
url: string;
videoUrl?: string;
width?: number;
}[];
quoteCount?: number;
replyCount?: number;
repostCount?: number;
source?: string;
text: string;
url: string;
viewCount?: number;
}[];
url?: string;
verified?: boolean;
} | null;
found: boolean;
reason?: "not_found";
}完整的参数与响应参考:这个接口的每个字段、类型和示例。
参考
请求、响应与价格
最近验证于 2026-09-29 · 可用率和延迟按 30d 统计POST /v1/run/twitter.thread
curl -X POST https://api.getanyapi.com/v1/run/twitter.thread \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://x.com/SpaceX/status/1732824684683784516"}'| 字段 | 类型 | 示例值 |
|---|---|---|
| 请求体 | ||
| url | string | "https://x.com/SpaceX/status/1732824684683784516"带数字推文 ID 的规范 x.com 或 twitter.com 推文 URL。可传入帖子串中的任意一条推文;服务商会解析出帖子串的首帖。 |
| 响应 | ||
| data | object | |
| data.author | object | |
| data.author.handle | string | Populated whenever the provider has data for the entity. |
| data.author.id | string | Populated whenever the provider has data for the entity. |
| data.author.name | string | Populated whenever the provider has data for the entity. |
| data.avatarUrl | string | Avatar image URL of the author. |
| data.bio | string | Bio text on the author's profile. |
| data.blueVerified | boolean | Whether the author carries an X blue verification badge. |
| data.complete | boolean | Whether the provider reached the end of the self-thread without hitting its internal cap. |
| data.conversationId | string | Conversation ID shared by the self-thread tweets. Populated whenever the provider has data for the entity. |
| data.coverUrl | string | Profile banner image URL of the author. |
| data.createdUtc | number | UTC epoch timestamp in seconds (Unix time) the author's account was created. Multiply by 1000 for a JS Date in milliseconds. |
| data.followers | integer | Follower count of the author. |
| data.following | integer | Number of accounts the author follows. |
| data.location | string | Location text on the author's profile. |
| data.threadLength | integer | Number of tweets returned in the self-thread. |
| data.tweets | object[] | Ordered self-thread tweets. Replies from other users are excluded. Populated whenever the provider has data for the entity. |
| data.tweets[].authorHandle | string | Populated whenever the provider has data for the entity. |
| data.tweets[].authorId | string | Populated whenever the provider has data for the entity. |
| data.tweets[].authorName | string | Populated whenever the provider has data for the entity. |
| data.tweets[].bookmarkCount | integer | Bookmark count of the post. |
| data.tweets[].conversationId | string | |
| data.tweets[].createdUtc | number | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| data.tweets[].id | string | Populated whenever the provider has data for the entity. |
| data.tweets[].inReplyToId | string | |
| data.tweets[].isReply | boolean | Whether the post is a reply to another post. |
| data.tweets[].lang | string | Two-letter language code X detected for the post. |
| data.tweets[].likeCount | integer | Like count of the post. |
| data.tweets[].media | object[] | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| data.tweets[].media[].height | integer | Pixel height of the media item, when the lane reports it. |
| data.tweets[].media[].type | string | One of photo, video, or gif. |
| data.tweets[].media[].url | string | Image URL. For a video or GIF this is the poster/thumbnail frame. X media URLs on pbs.twimg.com are publicly fetchable without authentication; append ?name=orig for the full-resolution original. |
| data.tweets[].media[].videoUrl | string | Playable video file URL. Present only for video and gif items. |
| data.tweets[].media[].width | integer | Pixel width of the media item, when the lane reports it. |
| data.tweets[].quoteCount | integer | Quote count of the post. |
| data.tweets[].replyCount | integer | Reply count of the post. |
| data.tweets[].repostCount | integer | Repost count of the post. |
| data.tweets[].source | string | Client the post was sent from, e.g. "Twitter Web App". |
| data.tweets[].text | string | Populated whenever the provider has data for the entity. |
| data.tweets[].url | string | Populated whenever the provider has data for the entity. |
| data.tweets[].viewCount | integer | View count of the post. |
| data.url | string | Canonical X profile URL of the thread's author. |
| data.verified | boolean | Whether the author carries a legacy X verification badge. |
| found | boolean | Whether the provider returned a tweet thread result. |
| reason | "not_found" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| 价格 | ||
| 每次请求价格 | USD | US$0.00375 |
| 价格(/千次请求) | USD | US$3.75 |
常见问题
关于 X / Twitter 帖子串 API
AnyAPI 的 X / Twitter 帖子串 API 只需一次 POST 请求 /v1/run/twitter.thread,就以统一格式的 JSON 返回 X / Twitter 数据。解析包含某条 X (Twitter) 帖子的作者自发帖子串,从首帖一直到作者后续接续的帖子。不包含其他用户的回复。无论哪个数据源提供服务,AnyAPI 都返回同一套统一的 schema。费用:每千次请求 US$3.75 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 X / Twitter 帖子串 API 调用中有 100.0% 成功,响应时间中位数为 3.6 秒,共测量 337 次调用。
费用:每千次请求 US$3.75 起,以美元计价,无需订阅,也没有每月最低消费。你只需为一个美元钱包充值,每次调用从中扣费。部分由钱包付费的失败请求会产生处理费用,我们按成本原价转嫁,不加价;错误响应会显示收取的金额。
解析包含某条 X (Twitter) 帖子的作者自发帖子串,从首帖一直到作者后续接续的帖子。不包含其他用户的回复。响应是统一格式的 JSON,外层结构与每个 AnyAPI 接口相同,所以解析另一个接口只需换一个 URL,别的都不用改。
过去 30 天,通过 AnyAPI 发起的 X / Twitter 帖子串 API 调用中有 100.0% 成功,响应时间中位数为 3.6 秒,共测量 337 次调用。这些是 AnyAPI 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。