X / Twitter API

X / Twitter 文章 API

通过外层帖子 URL 获取公开的 X 长文章,包括作者、互动数据、封面图和结构化内容块。

POST/v1/run/twitter.article
可用率
99.52%
30d · 417 次调用
请求数
417
30d · 按周,近 12 周
响应时间
1.9s
中位数 · 30d

价格

一个价格,以美元计

试一试

发出你的第一个请求

打开于
获取免费密钥
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。
{
  "data": {
    "author": {
      "avatarUrl": "https://example.com/image.jpg",
      "bio": "A short example description of this item.",
      "blueVerified": true,
      "coverUrl": "https://example.com/page",
      "createdUtc": 12.5,
      "followers": 12500,
      "following": 12500,
      "handle": "alex_rivera",
      "id": "a1b2c3d4",
      "location": "example",
      "name": "Example title",
      "url": "https://example.com/page",
      "verified": true
    },
    "contentBlocks": [
      {
        "entities": [
          {
            "key": 42,
            "length": 180,
            "offset": 42
          }
        ],
        "height": 42,
        "image": "https://example.com/image.jpg",
        "inlineStyles": [
          {
            "length": 180,
            "offset": 42,
            "style": "example"
          }
        ],
        "text": "A short example description of this item.",
        "type": "general",
        "width": 1024
      }
    ],
    "coverImage": "https://example.com/image.jpg",
    "createdUtc": 12.5,
    "id": "a1b2c3d4",
    "likes": 12500,
    "mediaCount": 12500,
    "posts": 248,
    "previewText": "A short example description of this item.",
    "quotes": 42,
    "replies": 42,
    "title": "Example title",
    "views": 12500
  },
  "found": true,
  "reason": "not_found"
}
响应类型定义
interface TwitterArticleResponse {
  data: {
    author: {
      avatarUrl?: string;
      bio?: string;
      blueVerified?: boolean;
      coverUrl?: string;
      createdUtc?: number;
      followers?: number;
      following?: number;
      handle: string;
      id: string;
      location?: string;
      name?: string;
      url: string;
      verified?: boolean;
    };
    contentBlocks: {
      entities?: {
        key: number;
        length: number;
        offset: number;
      }[];
      height?: number;
      image?: string;
      inlineStyles?: {
        length: number;
        offset: number;
        style: string;
      }[];
      text?: string;
      type: string;
      width?: number;
    }[];
    coverImage?: string;
    createdUtc: number;
    id: string;
    likes?: number;
    mediaCount?: number;
    posts?: number;
    previewText?: string;
    quotes?: number;
    replies?: number;
    title: string;
    views?: number;
  } | null;
  found: boolean;
  reason?: "not_found";
}

完整的参数与响应参考:这个接口的每个字段、类型和示例。

参考

请求、响应与价格

最近验证于 2026-09-29 · 可用率和延迟按 30d 统计
POST /v1/run/twitter.article
curl -X POST https://api.getanyapi.com/v1/run/twitter.article \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://x.com/Decentralisedco/status/1905545699552375179"}'
字段类型示例值
请求体
urlstring"https://x.com/Decentralisedco/status/1905545699552375179"X 文章外层公开帖子的规范 x.com 或 twitter.com URL。
响应
dataobjectNormalized public article, or null when the wrapper post is not an article.
data.authorobjectArticle author profile at retrieval time. Populated whenever the provider has data for the entity.
data.author.avatarUrlstringProfile avatar image URL.
data.author.biostringProfile biography.
data.author.blueVerifiedbooleanWhether the account has X blue verification.
data.author.coverUrlstringProfile cover image URL when available.
data.author.createdUtcnumberUTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.
data.author.followersintegerFollower count at retrieval time.
data.author.followingintegerFollowing count at retrieval time.
data.author.handlestringCurrent X handle without @. Populated whenever the provider has data for the entity.
data.author.idstringStable numeric X user ID. Populated whenever the provider has data for the entity.
data.author.locationstringSelf-reported profile location.
data.author.namestringProfile display name.
data.author.urlstringCanonical public X profile URL. Populated whenever the provider has data for the entity.
data.author.verifiedbooleanWhether the account has legacy verification.
data.contentBlocksobject[]Ordered, explicitly normalized article blocks. Unknown future block types remain representable through type and optional fields. Populated whenever the provider has data for the entity.
data.contentBlocks[].entitiesobject[]Entity references within the block text.
data.contentBlocks[].entities[].keyintegerUpstream entity table key.
data.contentBlocks[].entities[].lengthintegerEntity character length.
data.contentBlocks[].entities[].offsetintegerZero-based character offset.
data.contentBlocks[].heightintegerImage height in pixels when supplied.
data.contentBlocks[].imagestringCanonical image URL for an image block.
data.contentBlocks[].inlineStylesobject[]Formatting ranges within the block text.
data.contentBlocks[].inlineStyles[].lengthintegerFormatted character length.
data.contentBlocks[].inlineStyles[].offsetintegerZero-based character offset.
data.contentBlocks[].inlineStyles[].stylestringInline style name reported by X.
data.contentBlocks[].textstringText content for a text-bearing block.
data.contentBlocks[].typestringBlock type reported by X, such as unstyled, header-two, image, divider, blockquote, or list item. Populated whenever the provider has data for the entity.
data.contentBlocks[].widthintegerImage width in pixels when supplied.
data.coverImagestringCanonical article cover image URL when available.
data.createdUtcnumberUTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity.
data.idstringStable X Article entity ID. Populated whenever the provider has data for the entity.
data.likesintegerWrapper post like count at retrieval time.
data.mediaCountintegerNumber of media items the author has published.
data.postsintegerNumber of posts the author has published.
data.previewTextstringPreview text supplied by X.
data.quotesintegerWrapper post quote count at retrieval time.
data.repliesintegerWrapper post reply count at retrieval time.
data.titlestringArticle title. Populated whenever the provider has data for the entity.
data.viewsintegerWrapper post view count at retrieval time.
foundbooleanTrue when the wrapper post contains a public X Article.
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.00075
价格(/千次请求)USDUS$0.75

常见问题

关于 X / Twitter 文章 API

AnyAPI 的 X / Twitter 文章 API 只需一次 POST 请求 /v1/run/twitter.article,就以统一格式的 JSON 返回 X / Twitter 数据。通过外层帖子 URL 获取公开的 X 长文章,包括作者、互动数据、封面图和结构化内容块。无论哪个数据源提供服务,AnyAPI 都返回同一套统一的 schema。费用:每千次请求 US$0.75 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 X / Twitter 文章 API 调用中有 99.5% 成功,响应时间中位数为 1.9 秒,共测量 417 次调用。

费用:每千次请求 US$0.75 起,以美元计价,无需订阅,也没有每月最低消费。你只需为一个美元钱包充值,每次调用从中扣费。部分由钱包付费的失败请求会产生处理费用,我们按成本原价转嫁,不加价;错误响应会显示收取的金额。

通过外层帖子 URL 获取公开的 X 长文章,包括作者、互动数据、封面图和结构化内容块。响应是统一格式的 JSON,外层结构与每个 AnyAPI 接口相同,所以解析另一个接口只需换一个 URL,别的都不用改。

过去 30 天,通过 AnyAPI 发起的 X / Twitter 文章 API 调用中有 99.5% 成功,响应时间中位数为 1.9 秒,共测量 417 次调用。这些是 AnyAPI 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。