fetch-tweet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fetch Tweet

获取推文

You fetch tweet content using the fxtwitter API, which returns structured JSON without requiring JavaScript rendering or authentication.
你可以使用fxtwitter API获取推文内容,该API会返回结构化JSON数据,无需JavaScript渲染或身份验证。

Why fxtwitter

为何选择fxtwitter

X/Twitter requires JavaScript to render tweets.
WebFetch
on
x.com
returns an empty shell. The fxtwitter API (
api.fxtwitter.com
) serves the same tweet data as plain JSON — no auth, no JS, no rate-limit friction for reasonable use.
X/Twitter需要借助JavaScript来渲染推文。在x.com上使用
WebFetch
只会返回空的页面框架。而fxtwitter API(
api.fxtwitter.com
)会以纯JSON格式提供相同的推文数据——无需身份验证、无需JavaScript,合理使用情况下也不会有速率限制问题。

URL Conversion

URL转换

Given any tweet URL, convert it to the fxtwitter API endpoint:
Input URL patternAPI URL
https://x.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://twitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://fxtwitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://vxtwitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
Extract the
<user>
and
<id>
from the input URL, then construct
https://api.fxtwitter.com/<user>/status/<id>
.
对于任意推文URL,可将其转换为fxtwitter API端点:
输入URL格式API地址
https://x.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://twitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://fxtwitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
https://vxtwitter.com/<user>/status/<id>
https://api.fxtwitter.com/<user>/status/<id>
从输入URL中提取
<user>
<id>
,然后构造
https://api.fxtwitter.com/<user>/status/<id>

How to Fetch

如何获取数据

Use
WebFetch
with the converted API URL:
WebFetch(url: "https://api.fxtwitter.com/<user>/status/<id>", prompt: "Extract the tweet JSON. Return: author name, handle, tweet text, date, media URLs (if any), likes, retweets, replies, views.")
使用
WebFetch
调用转换后的API地址:
WebFetch(url: "https://api.fxtwitter.com/<user>/status/<id>", prompt: "Extract the tweet JSON. Return: author name, handle, tweet text, date, media URLs (if any), likes, retweets, replies, views.")

Response Structure

响应结构

The fxtwitter API returns JSON with this structure:
json
{
  "code": 200,
  "message": "OK",
  "tweet": {
    "url": "https://x.com/user/status/123",
    "text": "The tweet content...",
    "author": {
      "name": "Display Name",
      "screen_name": "handle"
    },
    "created_at": "Thu Jan 30 12:00:00 +0000 2026",
    "likes": 1000,
    "retweets": 500,
    "replies": 200,
    "views": 50000,
    "media": {
      "photos": [...],
      "videos": [...]
    }
  }
}
fxtwitter API返回的JSON结构如下:
json
{
  "code": 200,
  "message": "OK",
  "tweet": {
    "url": "https://x.com/user/status/123",
    "text": "The tweet content...",
    "author": {
      "name": "Display Name",
      "screen_name": "handle"
    },
    "created_at": "Thu Jan 30 12:00:00 +0000 2026",
    "likes": 1000,
    "retweets": 500,
    "replies": 200,
    "views": 50000,
    "media": {
      "photos": [...],
      "videos": [...]
    }
  }
}

Usage Pattern

使用流程

When you receive a tweet URL (x.com, twitter.com, fxtwitter.com, or vxtwitter.com):
  1. Parse the URL to extract username and tweet ID
  2. Convert to
    https://api.fxtwitter.com/<user>/status/<id>
  3. Fetch using
    WebFetch
    with the API URL
  4. Present the tweet content in a readable format:
**Author Name** (@handle) — Date

"Tweet text here"

Engagement: X views, Y likes, Z retweets, W replies
If the tweet contains media (photos/videos), include the URLs.
当你收到推文URL(x.com、twitter.com、fxtwitter.com或vxtwitter.com)时:
  1. 解析URL以提取用户名和推文ID
  2. 转换
    https://api.fxtwitter.com/<user>/status/<id>
    格式
  3. 获取:使用
    WebFetch
    调用转换后的API地址
  4. 展示:以易读格式呈现推文内容:
**作者名称** (@用户名) — 发布日期

"推文文本内容"

互动数据:X次浏览,Y个点赞,Z次转发,W条回复
如果推文包含媒体内容(图片/视频),请附上对应的链接。

Error Handling

错误处理

  • If fxtwitter returns a non-200 status, the tweet may have been deleted or the account suspended
  • If the URL doesn't match any known tweet URL pattern, ask the user for a valid tweet link
  • 如果fxtwitter返回非200状态码,说明推文可能已被删除或账号已被封禁
  • 如果URL不符合任何已知的推文URL格式,请要求用户提供有效的推文链接