Install
openclaw skills install x-twitter-apiX (Twitter) API client for searching tweets, retrieving article content, and fetching trending topics. Supports both Bearer Token (app-only) and OAuth 2.0 authentication.
openclaw skills install x-twitter-apiSearch tweets, retrieve article content, and fetch trending topics from X (Twitter).
# Set environment variable
export X_BEARER_TOKEN="your_bearer_token_here"
# Or temporarily for this session
X_BEARER_TOKEN="your_token" python3 scripts/search_tweets.py
Get API Token:
# Basic search
python3 scripts/search_tweets.py --query "AI OR 人工智能"
# Advanced search (Chinese original tweets only)
python3 scripts/search_tweets.py --query "AI -is:retweet lang:zh" --count 10
# Search by user
python3 scripts/search_tweets.py --query "from:elonmusk" --count 5
# Search hashtags
python3 scripts/search_tweets.py --query "#Crypto OR #Blockchain"
Query Operators:
-is:retweet - Original tweets onlylang:zh - Chinese languagefrom:username - Tweets from specific userhas:links - Tweets with linksis:verified - Verified users only# By URL (article or tweet)
python3 scripts/get_article.py --url "https://x.com/username/article/123456789"
# By Tweet ID
python3 scripts/get_article.py --id "123456789"
# Global trends
python3 scripts/get_trends.py
# Trends by WOEID (Yahoo Where On Earth ID)
python3 scripts/get_trends.py --woeid 1 # Global
python3 scripts/get_trends.py --woeid 23424977 # USA
| Tier | Cost | Tweets/Month | Notes |
|---|---|---|---|
| Free | $0 | 500 | 1 request/day, testing only |
| Basic | $200 | 500,000 | Minimum production tier |
| Pro | $5,000 | 2,000,000+ | Real-time streaming |
Free tier restrictions:
The scripts automatically handle:
python3 scripts/search_tweets.py --query "AI OR 人工智能 -is:retweet" --count 5 --output pretty
python3 scripts/search_tweets.py --query "from:username" --count 10 --save output.json
python3 scripts/get_article.py --url "https://x.com/user/article/id" --output markdown --save article.md