twitter-search
Advanced Twitter search and social media data analysis. Fetches tweets by keywords using Twitter API, processes up to 1000 results, and generates professional data analysis reports with insights and actionable recommendations. Use when user requests Twitter/X social media search, social media trend analysis, tweet data mining, social listening, influencer identification, topic sentiment analysis from tweets, or any task involving gathering and analyzing Twitter data for insights.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/flyfoxci/twitter-search-skillTwitter Search and Analysis
Overview
Search Twitter for keywords using advanced search syntax, fetch up to 1000 relevant tweets, and analyze the data to produce professional reports with insights, statistics, and actionable recommendations.
Prerequisites
API Key Required: Users must configure their Twitter API key from https://twitterapi.io
The API key can be provided in three ways:
- Environment variable (recommended): Set
TWITTER_API_KEYin your~/.bashrcor~/.zshrcecho 'export TWITTER_API_KEY="your_key_here"' >> ~/.bashrc source ~/.bashrc - As an argument: Use
--api-key YOUR_KEYwith the wrapper script - Passed directly: As first argument to the Python script
Quick Start
Using the Wrapper Script (Recommended)
The wrapper script automatically handles environment variable loading and dependency checks:
# Basic search (uses TWITTER_API_KEY from shell config)
./scripts/run_search.sh "AI"
# With custom API key
./scripts/run_search.sh "AI" --api-key YOUR_KEY
# With options
./scripts/run_search.sh "\"Claude AI\"" --max-results 100 --format summary
# Advanced query
./scripts/run_search.sh "from:elonmusk since:2024-01-01" --query-type Latest
Direct Python Script Usage
# Search for a keyword
scripts/twitter_search.py "$API_KEY" "AI"
# Search with multiple keywords
scripts/twitter_search.py "$API_KEY" "\"ChatGPT\" OR \"Claude AI\""
# Search from specific user
scripts/twitter_search.py "$API_KEY" "from:elonmusk"
# Search with date range
scripts/twitter_search.py "$API_KEY" "Bitcoin since:2024-01-01"
Advanced Queries
# Complex query: AI tweets from verified users, English only
scripts/twitter_search.py "$API_KEY" "AI OR \"machine learning\" lang:en filter:verified"
# Recent crypto tweets with minimum engagement
scripts/twitter_search.py "$API_KEY" "Bitcoin min_retweets:10 lang:en"
# From specific influencers
scripts/twitter_search.py "$API_KEY" "from:elonmusk OR from:VitalikButerin since:2024-01-01"
Output Format
# Full JSON with all tweets
scripts/twitter_search.py "$API_KEY" "AI" --format json
# Summary with statistics (default)
scripts/twitter_search.py "$API_KEY" "AI" --format summary
Options
--max-results N: Maximum tweets to fetch (default: 1000)--query-type Latest|Top: Sort order (default: Top for relevance)--format json|summary: Output format (default: summary)
Workflow
1. Understand User Requirements
Clarify the analysis goal:
- What topic/keyword to search?
- Date range preference?
- Specific users to include/exclude?
- Language preference?
- Type of insights needed (trends, sentiment, influencers)?
2. Build the Search Query
Use Twitter Advanced Search syntax:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-flyfoxci-twitter-search-skill": {
"enabled": true,
"auto_update": true
}
}
}