Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Read-only Twitter/X data: search tweets, user profiles, followers, replies, and retweets via twitterapi.io.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: twitter3version: 2.0.14description: "Twitter/X (x.com) data lookup โ fetch tweets by URL or ID, search tweets, user profiles, followers, replies. Use for ANY x.com or twitter.com URL."5delivery: script6metadata:7starchild:8emoji: "๐ฆ"9skillKey: twitter10requires:11env:12- TWITTER_API_KEY1314user-invocable: false15disable-model-invocation: false16---1718# Twitter / X (script-mode)1920Read-only access to twitterapi.io endpoints. 13 functions covering tweets,21users, followers, replies, threads, quotes, articles, and trends.2223All requests go through sc-proxy via `core.http_client.proxied_get`. The24`TWITTER_API_KEY` env var is auto-injected server-side, no local key needed25on the agent machine.2627## Script Usage2829Standard invocation pattern:3031```bash32python3 - <<'EOF'33import sys, json34sys.path.insert(0, "/data/workspace/skills/twitter")35from exports import twitter_user_info, twitter_user_tweets3637profile = twitter_user_info(username="vitalikbuterin")38print(json.dumps(profile, indent=2))3940recent = twitter_user_tweets(username="vitalikbuterin")41print(f"got {len(recent.get('tweets', []))} tweets")42EOF43```4445Tweet ID extraction from URL: the last path segment of any46`x.com/{user}/status/{id}` or `twitter.com/{user}/status/{id}` URL is the47tweet ID. Pass it as a string (Python int will lose precision on long IDs).4849## Function Reference (signatures)5051All 13 functions live in `exports.py`. Returns are dicts straight from52twitterapi.io โ keys vary per endpoint, inspect once before scripting.5354### Tweet endpoints5556| Function | Description |57|---|---|58| `twitter_search_tweets(query, cursor=None)` | Advanced search. Operators: `from:user`, `to:user`, `#tag`, `$cashtag`, `lang:en`, `has:media`, `has:links`, `is:reply`, `min_faves:N`, `since:YYYY-MM-DD`, `until:YYYY-MM-DD`. |59| `twitter_get_tweets(tweet_ids)` | Fetch one or more tweets by ID. `tweet_ids` = list of strings (also accepts comma-string). |60| `twitter_tweet_replies(tweet_id, cursor=None)` | Replies to a tweet. |61| `twitter_tweet_retweeters(tweet_id, cursor=None)` | Users who retweeted. |62| `twitter_tweet_thread_context(tweet_id)` | Full thread context (parents + direct replies). |63| `twitter_tweet_quote(tweet_id, cursor=None)` | Quote tweets. |64| `twitter_get_article(tweet_id)` | Long-form X article body. |65| `twitter_get_trends(woeid=None, country=None, category=None, limit=None)` | Trending topics; all filters optional. |6667### User endpoints6869| Function | Description |70|---|---|71| `twitter_user_info(username)` | Profile: bio, follower/following counts, tweet count, verified. |72| `twitter_user_tweets(username, cursor=None)` | User's recent tweets. |73| `twitter_user_followers(username, cursor=None)` | Follower list. |74| `twitter_user_followings(username, cursor=None)` | Accounts followed. |75| `twitter_search_users(query, cursor=None)` | Search users by name/keyword. |7677`username` is the handle WITHOUT `@` (e.g. `"elonmusk"`, not `"@elonmusk"`).78Pagination: when a response includes `next_cursor`, pass it back as `cursor`79on the next call.8081## When to use this skill8283- ANY `x.com/...` or `twitter.com/...` URL โ start here, NOT `web_fetch`84(Twitter blocks scrapers).85- Single tweet detail โ `twitter_get_tweets([tweet_id])`.86- "What's @user been posting?" โ `twitter_user_tweets`.87- KOL discovery / cashtag mentions โ `twitter_search_tweets("$SOL min_faves:50")`.88- Trending topics โ `twitter_get_trends`.8990## Error handling9192- `402 Credits is not enough` โ upstream proxy credits exhausted; tell user93to top up. Don't retry.94- `429` โ rate limited; surface to user, don't auto-retry.95- `404 user not found` โ suggest verifying the handle spelling.9697## Version Policy (hard rule)9899This skill is **script-mode** (`delivery: script`). It does NOT register100runtime tools โ agent must `read_file` SKILL.md and call functions via101`bash` + `python3`. The legacy `tools.py` / `__init__.py` files are kept102for backward compatibility but are no longer the preferred entry point.103104Bump rules:105- Any signature change, env-var change, or sc-proxy contract change โ MAJOR106- New function added, response schema clarified โ MINOR107- Bug fix or doc-only change โ PATCH108