X (Twitter) API client for searching tweets, retrieving article content, and fetching trending topics. Supports both Bearer Token (app-only) and OAuth 2.0 authentication.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install x-twitter-api或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install x-twitter-api⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/x-twitter-api/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: x-twitter description: X (Twitter) API client for searching tweets, retrieving article content, and fetching trending topics. Supports both Bearer Token (app-only) and OAuth 2.0 authentication. homepage: https://developer.x.com metadata: { "openclaw": { "emoji": "𝕏", "requires": { "bins": ["python3"] }, "env": ["X_BEARER_TOKEN"], "primaryEnv": "X_BEARER_TOKEN" } } ---
Search tweets, retrieve article content, and fetch trending topics from X (Twitter).
# Set environment variable
export X_BEARER_TOKEN="your_bearer_token_here"
# Or temporarily for this session
X_BEARER_TOKEN="your_token" python3 scripts/search_tweets.py
Get API Token:
# Basic search
python3 scripts/search_tweets.py --query "AI OR 人工智能"
# Advanced search (Chinese original tweets only)
python3 scripts/search_tweets.py --query "AI -is:retweet lang:zh" --count 10
# Search by user
python3 scripts/search_tweets.py --query "from:elonmusk" --count 5
# Search hashtags
python3 scripts/search_tweets.py --query "#Crypto OR #Blockchain"
Query Operators:
-is:retweet - Original tweets onlylang:zh - Chinese languagefrom:username - Tweets from specific userhas:links - Tweets with linksis:verified - Verified users only# By URL (article or tweet)
python3 scripts/get_article.py --url "https://x.com/username/article/123456789"
# By Tweet ID
python3 scripts/get_article.py --id "123456789"
# Global trends
python3 scripts/get_trends.py
# Trends by WOEID (Yahoo Where On Earth ID)
python3 scripts/get_trends.py --woeid 1 # Global
python3 scripts/get_trends.py --woeid 23424977 # USA
| Tier | Cost | Tweets/Month | Notes | |------|------|--------------|-------| | Free | $0 | 500 | 1 request/day, testing only | | Basic | $200 | 500,000 | Minimum production tier | | Pro | $5,000 | 2,000,000+ | Real-time streaming |
Free tier restrictions:
The scripts automatically handle:
python3 scripts/search_tweets.py --query "AI OR 人工智能 -is:retweet" --count 5 --output pretty
python3 scripts/search_tweets.py --query "from:username" --count 10 --save output.json
python3 scripts/get_article.py --url "https://x.com/user/article/id" --output markdown --save article.md安装 X Twitter 后,可以对 AI 说这些话来触发它
Help me get started with X Twitter
Explains what X Twitter does, walks through the setup, and runs a quick demo based on your current project
Use X Twitter to x (Twitter) API client for searching tweets, retrieving article con...
Invokes X Twitter with the right parameters and returns the result directly in the conversation
What can I do with X Twitter in my marketing & growth workflow?
Lists the top use cases for X Twitter, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/x-twitter-api/ 目录(个人级,所有项目可用),或 .claude/skills/x-twitter-api/(项目级)。重启 AI 客户端后,用 /x-twitter-api 主动调用,或让 AI 根据上下文自动发现并使用。
X Twitter 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
X Twitter 可免费安装使用。请查阅仓库了解许可证信息。
X (Twitter) API client for searching tweets, retrieving article content, and fetching trending topics. Supports both Bearer Token (app-only) and OAuth 2.0 authentication.
X Twitter 属于「Marketing & Growth」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my marketing & growth tasks using X Twitter
Identifies repetitive steps in your workflow and sets up X Twitter to handle them automatically