X (Twitter) Data Scraper
/install claude-code-x-scraper
X (Twitter) Data Scraper
Extract and analyze X/Twitter data programmatically.
When to Use
- Fetch tweets from a specific user
- Search X for keywords/topics
- Analyze Twitter data and sentiment
- Monitor social media trends
Quick Start
# Get user tweets
python3 scripts/get_user_tweets.py elonmusk 20
# Search for topic
python3 scripts/search_tweets.py "machine learning" 30
Setup
Credentials: Create ~/.openclaw/credentials/x_api_tokens.env:
X_BEARER_TOKEN=Bearer YOUR_TOKEN_HERE
Get token: https://developer.twitter.com/en/portal/dashboard
Scripts
| Script | Purpose |
|---|---|
get_user_tweets.py |
Fetch user timeline |
search_tweets.py |
Search by keyword |
fetch_x_playwright.py |
Browser-based scraping |
x_api_client.py |
API client module |
Advanced Search
# Exclude replies/retweets
python3 scripts/get_user_tweets.py elonmusk 20 --no-replies --no-retweets
# Complex search
python3 scripts/search_tweets.py "(AI OR ML) from:elonmusk lang:en" 20
Troubleshooting
- 401 Unauthorized: Check Bearer token format
- 403 Forbidden: Search API needs Elevated access
- 429 Rate Limited: Wait 15 minutes
License
MIT
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-code-x-scraper - After installation, invoke the skill by name or use
/claude-code-x-scraper - Provide required inputs per the skill's parameter spec and get structured output
What is X (Twitter) Data Scraper?
X (Twitter) data extraction and analysis. Use when user asks to "get tweets from @username", "search X for", "analyze Twitter data", "fetch tweets about [top... It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.
How do I install X (Twitter) Data Scraper?
Run "/install claude-code-x-scraper" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is X (Twitter) Data Scraper free?
Yes, X (Twitter) Data Scraper is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does X (Twitter) Data Scraper support?
X (Twitter) Data Scraper is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created X (Twitter) Data Scraper?
It is built and maintained by lamtest556-blip (@lamtest556-blip); the current version is v1.0.1.