Loading...
Loading...
Fetch X/Twitter tweet content by URL and search X posts. Resolves tweet links that WebFetch cannot scrape. Use for: reading saved X/Twitter links, fetching tweet content from URLs, searching X for posts on a topic, batch-processing X links from notes. Triggers: x.com link, twitter.com link, fetch tweet, read tweet, what does this tweet say, X search, twitter search.
npx skill4agent add molechowski/claude-skills res-xx_search| Capability | API Tool | Cost |
|---|---|---|
| Fetch tweet by URL | xAI | ~$0.005/call |
| Search X | xAI | ~$0.005/call |
| Tool | Purpose | Install |
|---|---|---|
| uv | Python package manager (handles dependencies) | |
| Service | Purpose | Required | Get Key |
|---|---|---|---|
| xAI | X/Twitter access via Grok | Yes | https://console.x.ai |
# 1. Create a dedicated keychain (skip if already exists)
security create-keychain -p 'YourPassword' ~/Library/Keychains/claude-keys.keychain-db
# 2. Add keychain to search list
security list-keychains -s ~/Library/Keychains/claude-keys.keychain-db ~/Library/Keychains/login.keychain-db /Library/Keychains/System.keychain
# 3. Store your xAI API key
echo -n "Enter xAI API key: " && read -s key && security add-generic-password -s "xai-api" -a "$USER" -w "$key" ~/Library/Keychains/claude-keys.keychain-db && unset key && echosecurity unlock-keychain ~/Library/Keychains/claude-keys.keychain-db# Fetch single tweet
uv run scripts/x_fetch.py fetch "https://x.com/user/status/123456"
# Fetch multiple tweets (batched, 3 per API call)
uv run scripts/x_fetch.py fetch "url1" "url2" "url3" "url4" "url5"
# Force one-per-URL for max fidelity
uv run scripts/x_fetch.py fetch "url1" "url2" --single
# Search X
uv run scripts/x_fetch.py search "query terms"
uv run scripts/x_fetch.py search "query terms" --quick
# JSON output (both commands)
uv run scripts/x_fetch.py fetch "url" --json
uv run scripts/x_fetch.py search "query" --jsonsecurity find-generic-password -s "xai-api" -w ~/Library/Keychains/claude-keys.keychain-db 2>/dev/null && echo "XAI_AVAILABLE=true" || echo "XAI_AVAILABLE=false"XAI_AVAILABLE=false--quickhttps://x.com/{user}/status/{id}
https://twitter.com/{user}/status/{id}
https://x.com/{user}/status/{id}?s=20
https://x.com/{user}/status/{id}?t=...&s=...
https://x.com/i/article/{id}https://x.com/{user}/status/{id}https://x.com/i/article/{id}https?://(?:x\.com|twitter\.com)/\w+/status/\d+https?://(?:x\.com|twitter\.com)/i/article/[\w\-]+uv run scripts/x_fetch.py fetch "url1" "url2" ...| Action | API Calls | Cost |
|---|---|---|
| Fetch 1-3 tweets | 1 | ~$0.005 |
| Fetch 4-6 tweets | 2 | ~$0.010 |
| Fetch 10 tweets | 4 | ~$0.020 |
| Fetch 10 tweets (--single) | 10 | ~$0.050 |
| X search | 1 | ~$0.005 |
| X search (--quick) | 1 | ~$0.005 |
--jsonres-webres-deepsecurity find-generic-password -s "xai-api" ~/Library/Keychains/claude-keys.keychain-dbsecurity unlock-keychain ~/Library/Keychains/claude-keys.keychain-dbwhich uv