| name | x-embed |
| description | Extract and display X/Twitter post content when a user shares a twitter.com, x.com, or related link. Uses FxEmbed API (privacy-safe, no auth) as primary method, falls back to X API v2 (Bearer Token) if FxEmbed fails. NEVER uses browser sessions, cookies, or logged-in scraping — this causes instant account bans. Triggers on any message containing twitter.com, x.com, fxtwitter.com, or fixupx.com URLs with /status/ paths. |
X Embed — Tweet Content Extraction
When This Triggers
Any user message containing a URL matching:
twitter.com/*/status/*
x.com/*/status/*
fxtwitter.com/*/status/*
fixupx.com/*/status/*
⛔ CRITICAL SAFETY RULE
NEVER attempt to scrape X via browser automation, headless browsers, or any method that uses the user's cookies/session. This leads to instant account suspension. Only use:
- FxEmbed API (no auth, server-side)
- X API v2 with Bearer Token (official API)
How It Works
Extraction Chain
- FxEmbed API (primary) —
https://api.fxtwitter.com/{user}/status/{id}
- No authentication needed
- Returns full tweet text, author, metrics, media URLs, quotes
- Privacy-safe: no user credentials involved
- X API v2 (fallback) —
https://api.x.com/2/tweets/{id}
- Uses
$X_BEARER_TOKEN (read-only, app-level)
- Activated only if FxEmbed fails
Quick Usage
scripts/fetch-tweet.sh "https://x.com/elonmusk/status/1234567890"
scripts/fetch-tweet.sh "https://x.com/elonmusk/status/1234567890" --json
Output Includes
- Author name and handle
- Full tweet text
- Quoted tweet (if any)
- Media URLs (images, videos)
- Engagement metrics (likes, retweets, replies)
- Source indicator (fxembed or x-api-v2)
Presentation Guidelines
- Display tweet content inline in the chat — don't just dump raw JSON
- For threads, note if it looks like part of a thread and offer to fetch more
- For media (images/video), include the direct URLs
- If both methods fail, tell the user clearly — don't silently skip