X Search (Local)
Search X (Twitter) posts using the xAI API. Use when the user wants to find tweets, search X/Twitter, look up what people are saying on X, or find social med...
Latest: v1.0.0
- Initial release of x-search: search posts on X (Twitter) via the xAI API.
- Supports searching by keyword, filtering by or excluding handles, setting date ranges, and enabling image/video understanding.
- Displays results with post content, authors, and direct links to original posts.
- Simple setup using the XAI API key with environment variables or config file.
- Uses the xAI Grok API for real-time, summarized X content search.
duplicate of@perfectworldltd/x-search-1-0-0
Full description
Search X (Twitter) posts using the xAI API. Use when the user wants to find tweets, search X/Twitter, look up what people are saying on X, or find social media posts about a topic.
X Search
Search X (Twitter) posts using the xAI Grok API with real-time access to X content.
Setup
- Get your API key: https://console.x.ai
- Set environment variable:
bash export XAI_API_KEY="xai-your-key-here" - Or set
skills."x-search".apiKey/skills."x-search".env.XAI_API_KEYin~/.openclaw/openclaw.json
Usage
python3 {baseDir}/scripts/search.py "what is trending in AI right now"
Useful flags:
# Filter by handles (max 10)
python3 {baseDir}/scripts/search.py --handles jaaneek,OpenClaw "latest posts"
# Exclude handles (max 10)
python3 {baseDir}/scripts/search.py --exclude spambot,crypto_shill "trending AI"
# Date range (YYYY-MM-DD)
python3 {baseDir}/scripts/search.py --from 2026-03-01 --to 2026-03-20 "xAI grok updates"
# Enable image/video understanding in posts
python3 {baseDir}/scripts/search.py --images --video "product demos"
Notes
- Uses the xAI Responses API with
x_searchtool (Grok performs the search and summarizes results) - Cannot use
--handlesand--excludeat the same time - Results include citations with links to original X posts
- Present results in a readable format with post content, authors, and citations
