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"}'
字段类型示例值
请求体
urlstring"https://x.com/SpaceX/status/1732824684683784516"带数字推文 ID 的规范 x.com 或 twitter.com 推文 URL。可传入帖子串中的任意一条推文;服务商会解析出帖子串的首帖。
响应
dataobject
data.authorobject
data.author.handlestringPopulated whenever the provider has data for the entity.
data.author.idstringPopulated whenever the provider has data for the entity.
data.author.namestringPopulated whenever the provider has data for the entity.
data.avatarUrlstringAvatar image URL of the author.
data.biostringBio text on the author's profile.
data.blueVerifiedbooleanWhether the author carries an X blue verification badge.
data.completebooleanWhether the provider reached the end of the self-thread without hitting its internal cap.
data.conversationIdstringConversation ID shared by the self-thread tweets. Populated whenever the provider has data for the entity.
data.coverUrlstringProfile banner image URL of the author.
data.createdUtcnumberUTC epoch timestamp in seconds (Unix time) the author's account was created. Multiply by 1000 for a JS Date in milliseconds.
data.followersintegerFollower count of the author.
data.followingintegerNumber of accounts the author follows.
data.locationstringLocation text on the author's profile.
data.threadLengthintegerNumber of tweets returned in the self-thread.
data.tweetsobject[]Ordered self-thread tweets. Replies from other users are excluded. Populated whenever the provider has data for the entity.
data.tweets[].authorHandlestringPopulated whenever the provider has data for the entity.
data.tweets[].authorIdstringPopulated whenever the provider has data for the entity.
data.tweets[].authorNamestringPopulated whenever the provider has data for the entity.
data.tweets[].bookmarkCountintegerBookmark count of the post.
data.tweets[].conversationIdstring
data.tweets[].createdUtcnumberUTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.
data.tweets[].idstringPopulated whenever the provider has data for the entity.
data.tweets[].inReplyToIdstring
data.tweets[].isReplybooleanWhether the post is a reply to another post.
data.tweets[].langstringTwo-letter language code X detected for the post.
data.tweets[].likeCountintegerLike count of the post.
data.tweets[].mediaobject[]Photo, video, and GIF attachments on the post. Empty when the post has none.
data.tweets[].media[].heightintegerPixel height of the media item, when the lane reports it.
data.tweets[].media[].typestringOne of photo, video, or gif.
data.tweets[].media[].urlstringImage 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[].videoUrlstringPlayable video file URL. Present only for video and gif items.
data.tweets[].media[].widthintegerPixel width of the media item, when the lane reports it.
data.tweets[].quoteCountintegerQuote count of the post.
data.tweets[].replyCountintegerReply count of the post.
data.tweets[].repostCountintegerRepost count of the post.
data.tweets[].sourcestringClient the post was sent from, e.g. "Twitter Web App".
data.tweets[].textstringPopulated whenever the provider has data for the entity.
data.tweets[].urlstringPopulated whenever the provider has data for the entity.
data.tweets[].viewCountintegerView count of the post.
data.urlstringCanonical X profile URL of the thread's author.
data.verifiedbooleanWhether the author carries a legacy X verification badge.
foundbooleanWhether 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.
价格
每次请求价格USDUS$0.00375
价格(/千次请求)USDUS$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 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。