Twitter / X Data
Read-only access to Twitter/X via twitterapi.io. Use these tools to look up tweets, users, followers, and social activity.
⚡ FAST PATHS (act immediately, no clarification needed)
| Trigger keywords |
Action |
| crypto sentiment / 情绪扫描 / market mood / BTC ETH SOL 讨论 |
Call twitter_search_tweets once per coin: "$BTC", "$ETH", "$SOL" — summarize tone, no user profile lookups |
| search tweets about X |
Call twitter_search_tweets with the topic |
| who is @username |
Call twitter_user_info |
| what did @username post |
Call twitter_user_tweets |
Tool Decision Tree
"Search for tweets about a topic" → twitter_search_tweets
Advanced query with operators: keywords, from:user, #hashtag, $cashtag, min_faves, date ranges.
"Look up a specific tweet or set of tweets" → twitter_get_tweets
Pass one or more tweet IDs directly.
"Who is this Twitter account?" → twitter_user_info
Profile data: bio, follower count, tweet count, verification.
"What has this account been posting?" → twitter_user_tweets
Recent tweets from a specific user.
"Who follows this account?" → twitter_user_followers
List of followers for a user.
"Who does this account follow?" → twitter_user_followings
List of accounts a user follows.
"What are people saying in reply to this tweet?" → twitter_tweet_replies
Replies to a specific tweet by ID.
"Who retweeted this?" → twitter_tweet_retweeters
Users who retweeted a specific tweet.
"Find accounts related to a topic" → twitter_search_users
Search users by name or keyword.
"Crypto sentiment scan / 情绪扫描 / market mood" → twitter_search_tweets (call once per coin)
For BTC/ETH/SOL sentiment: search "$BTC", "$ETH", "$SOL" separately, then summarize tone inline.
⛔ NEVER call twitter_user_info, twitter_user_followers, or twitter_user_tweets during a sentiment scan — text analysis only.
Available Tools
| Tool |
Description |
Key Params |
twitter_search_tweets |
Advanced tweet search |
query (required), cursor |
twitter_get_tweets |
Get tweets by ID |
tweet_ids (array, required) |
twitter_user_info |
User profile lookup |
username (required) |
twitter_user_tweets |
User's recent tweets |
username (required), cursor |
twitter_user_followers |
User's followers |
username (required), cursor |
twitter_user_followings |
User's followings |
username (required), cursor |
twitter_tweet_replies |
Replies to a tweet |
tweet_id (required), cursor |
twitter_tweet_retweeters |
Who retweeted |
tweet_id (required), cursor |
twitter_search_users |
Search for users |
query (required), cursor |
Usage Patterns
⚠️ Token Budget Rules
- Sentiment scan: max 3
twitter_search_tweets calls (one per coin), then summarize. Stop.
- Account research: max 2 tool calls total unless user asks for more depth.
- Never chain more than 5 Twitter tool calls in one response.
Research an account
twitter_user_info — get profile, follower count, bio
twitter_user_tweets — see what they've been posting
twitter_user_followings — who they follow (reveals interests)
Track a topic or token
twitter_search_tweets with query like "$SOL min_faves:50" — find popular tweets
twitter_search_users with the topic — find relevant accounts
Output Constraints (IMPORTANT for small models)
- Max 1
twitter_search_tweets call per coin/topic — do not repeat searches for same query.
- Max 3
twitter_user_info calls per response — profile lookups are expensive; only look up the most relevant accounts.
- Never call
bash or write_file for Twitter data — summarize results inline in your reply.
- Sentiment summaries: after fetching tweets, write a short inline summary (3–5 sentences). Do not produce files or run scripts.
- Pagination: only fetch next page if user explicitly asks for more results.with
twitter_user_info on interesting accounts
Analyze engagement on a tweet
twitter_get_tweets — get the tweet and its metrics
twitter_tweet_replies — see the conversation
twitter_tweet_retweeters — see who amplified it
Find influencers in a space
twitter_search_users with keyword (e.g. "DeFi analyst")
twitter_user_info on top results to compare follower counts
twitter_user_tweets to check content quality
Search Query Operators
The twitter_search_tweets tool supports advanced operators:
| Operator |
Example |
Description |
| keyword |
bitcoin |
Tweets containing the word |
| exact phrase |
"ethereum merge" |
Exact phrase match |
from: |
from:elonmusk |
Tweets by a specific user |
to: |
to:elonmusk |
Tweets replying to a user |
#hashtag |
#crypto |
Tweets with hashtag |
$cashtag |
$BTC |
Tweets with cashtag |
lang: |
lang:en |
Filter by language |
has:media |
has:media |
Tweets with images/video |
has:links |
has:links |
Tweets with URLs |
is:reply |
is:reply |
Only replies |
min_faves: |
min_faves:100 |
Minimum likes |
min_retweets: |
min_retweets:50 |
Minimum retweets |
since: |
since:2024-01-01 |
Tweets after date |
until: |
until:2024-12-31 |
Tweets before date |
Combine operators: from:VitalikButerin $ETH min_faves:100 since:2024-01-01
Pagination
Most endpoints support cursor-based pagination. When a response includes a cursor value, pass it as the cursor parameter to get the next page. If no cursor is returned, you've reached the end.
Notes
- API key required: Set
TWITTER_API_KEY environment variable. Tools will error without it.
- Read-only: These tools only retrieve data. No posting, liking, or following.
- Usernames: Always pass without the
@ prefix (e.g. "elonmusk" not "@elonmusk").
- Tweet IDs: Use string format for tweet IDs to avoid integer overflow issues.
- Rate limits: The API has rate limits. If you get rate-limited, wait before retrying.