SuperAPI AI Directory

fetch-tweet

Writing & research

View repository

Updated 10-15 16:43

About this skill

Fetch Tweet

A skill that fetches the tweet original text, author information, and engagement data from an X/Twitter URL. Utilizing the API of the FxEmbed open-source project (api.fxtwitter.com), it extracts tweet data without JavaScript.

How It Works

If you convert the domain of the X/Twitter URL to api.fxtwitter.com, it returns the full tweet data as JSON.

https://x.com/user/status/123456
  → https://api.fxtwitter.com/user/status/123456

Script

scripts/fetch_tweet.py - Uses only the standard library, no external dependencies.

# 기본 사용 (포맷팅된 출력)
python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909

# JSON 출력 (프로그래밍 활용)
python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909 --json

Supported URL formats: x.com, twitter.com, fxtwitter.com, fixupx.com

API Response Fields

Field Description
tweet.text Tweet body (URLs expanded)
tweet.author Author (name, screen_name, bio, followers)
tweet.likes/retweets/replies/bookmarks/views Engagement
tweet.created_at Date and time posted
tweet.media Attached media (photos, videos)
tweet.quote Quoted tweet (same structure)
tweet.lang Language code

Workflow

Fetch a single tweet

  1. Extract screen_name and status_id from the URL
  2. scripts/fetch_tweet.py <url> run
  3. Display the result to the user or translate it

When a translation is requested

  1. Fetch the original text with the script
  2. Provide the fetched text translated into Korean
  3. Also display the engagement numbers

Interworking with other skills

When batch-processing a list of X URLs collected from Contents Hub, etc.:

# JSON 출력으로 파이프라인 연동
python scripts/fetch_tweet.py <url> --json | python3 -c "import sys,json; print(json.load(sys.stdin)['tweet']['text'])"

WebFetch Fallback

If it is difficult to run the script, you can call the API directly with the WebFetch tool:

URL: https://api.fxtwitter.com/{screen_name}/status/{status_id}
Prompt: "Extract the full tweet text and author name"

Limitations

  • Tweets from private accounts cannot be viewed
  • Deleted tweets cannot be viewed
  • The API rate limit follows the FxEmbed server policy (no problem at the normal usage level)