Fetch X/Twitter data via Apify actors. Search tweets, get user profiles, retrieve specific tweets with replies. Features local caching to save API costs. Wor...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install x-apify或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install x-apify⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/x-apify/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: x-apify version: 1.0.5 description: Fetch X/Twitter data via Apify actors. Search tweets, get user profiles, retrieve specific tweets with replies. Features local caching to save API costs. Works from any IP via Apify's proxy infrastructure. tags: [twitter, x, apify, tweets, social-media, search, scraping, caching] metadata: {"openclaw":{"requires":{"bins":["python3"],"env":{"APIFY_API_TOKEN":{"required":true,"description":"Apify API token from https://console.apify.com/account/integrations"},"APIFY_ACTOR_ID":{"required":false,"default":"quacker~twitter-scraper","description":"Apify actor ID to use (default: quacker~twitter-scraper)"},"X_APIFY_CACHE_DIR":{"required":false,"description":"Custom cache directory (default: .cache/ in skill dir)"}}}}} ---
Fetch X/Twitter data via Apify API (search tweets, user profiles, specific tweets).
X/Twitter's official API is expensive and restrictive. Apify provides reliable access to public tweet data through its actor ecosystem, with residential proxy support.
# Add to ~/.bashrc or ~/.zshrc
export APIFY_API_TOKEN="apify_api_YOUR_TOKEN_HERE"
# Or use .env file (never commit this!)
echo 'APIFY_API_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env
# Search for tweets containing keywords
python3 scripts/fetch_tweets.py --search "artificial intelligence"
# Search with hashtags
python3 scripts/fetch_tweets.py --search "#AI #MachineLearning"
# Limit results
python3 scripts/fetch_tweets.py --search "OpenAI" --max-results 10
# Get tweets from a specific user
python3 scripts/fetch_tweets.py --user "elonmusk"
# Multiple users (comma-separated)
python3 scripts/fetch_tweets.py --user "OpenAI,AnthropicAI"
# Get a specific tweet and its replies
python3 scripts/fetch_tweets.py --url "https://x.com/user/status/123456789"
# Also works with twitter.com URLs
python3 scripts/fetch_tweets.py --url "https://twitter.com/user/status/123456789"
# JSON output (default)
python3 scripts/fetch_tweets.py --search "query" --format json
# Summary format (human-readable)
python3 scripts/fetch_tweets.py --search "query" --format summary
# Save to file
python3 scripts/fetch_tweets.py --search "query" --output results.json
Tweets are cached locally by default to save API costs.
# First request: fetches from Apify (costs credits)
python3 scripts/fetch_tweets.py --search "query"
# Second request: uses cache (FREE!)
python3 scripts/fetch_tweets.py --search "query"
# Output: [cached] Results for: query
# Bypass cache (force fresh fetch)
python3 scripts/fetch_tweets.py --search "query" --no-cache
# View cache stats
python3 scripts/fetch_tweets.py --cache-stats
# Clear all cached results
python3 scripts/fetch_tweets.py --clear-cache
Cache TTL:
Cache location: .cache/ in skill directory (override with X_APIFY_CACHE_DIR env var)
{
"query": "OpenAI",
"mode": "search",
"fetched_at": "2026-02-11T10:30:00Z",
"count": 20,
"tweets": [
{
"id": "1234567890",
"text": "OpenAI just announced...",
"author": "techreporter",
"author_name": "Tech Reporter",
"created_at": "2026-02-11T09:00:00Z",
"likes": 1500,
"retweets": 300,
"replies": 50,
"url": "https://x.com/techreporter/status/1234567890"
}
]
}
=== X/Twitter Search Results ===
Query: OpenAI
Fetched: 2026-02-11 10:30:00 UTC
Results: 20 tweets
---
@techreporter (Tech Reporter)
2026-02-11 09:00
OpenAI just announced...
[Likes: 1500 | RTs: 300 | Replies: 50]
https://x.com/techreporter/status/1234567890
---
...
The script handles common errors:
metadata:
openclaw:
emoji: "X"
requires:
env:
APIFY_API_TOKEN: required
APIFY_ACTOR_ID: optional
X_APIFY_CACHE_DIR: optional
bins:
- python3安装 X Apify 后,可以对 AI 说这些话来触发它
Help me get started with X Apify
Explains what X Apify does, walks through the setup, and runs a quick demo based on your current project
Use X Apify to fetch X/Twitter data via Apify actors
Invokes X Apify with the right parameters and returns the result directly in the conversation
What can I do with X Apify in my data & analytics workflow?
Lists the top use cases for X Apify, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/x-apify/ 目录(个人级,所有项目可用),或 .claude/skills/x-apify/(项目级)。重启 AI 客户端后,用 /x-apify 主动调用,或让 AI 根据上下文自动发现并使用。
X Apify 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
X Apify 可免费安装使用。请查阅仓库了解许可证信息。
Fetch X/Twitter data via Apify actors. Search tweets, get user profiles, retrieve specific tweets with replies. Features local caching to save API costs. Wor...
X Apify 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my data & analytics tasks using X Apify
Identifies repetitive steps in your workflow and sets up X Apify to handle them automatically