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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "x-twitter" with this command: npx skills add zaaachary/x-twitter-api

X (Twitter) API

Search tweets, retrieve article content, and fetch trending topics from X (Twitter).

Features

  • Search Tweets: Search recent tweets (last 7 days) with advanced query operators
  • Get Article Content: Retrieve tweet and article details by URL or ID
  • Trending Topics: Fetch trending topics (requires Basic tier or higher)
  • User Info: Get user profile and tweet history

Setup

# 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:

  1. Visit https://developer.x.com
  2. Create a project and app
  3. Generate Bearer Token in "Keys and Tokens" tab
  4. Set the environment variable

Usage

Search Tweets

# 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 only
  • lang:zh - Chinese language
  • from:username - Tweets from specific user
  • has:links - Tweets with links
  • is:verified - Verified users only

Get Article/Tweet Content

# 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"

Get Trending Topics

# 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

API Limits

TierCostTweets/MonthNotes
Free$05001 request/day, testing only
Basic$200500,000Minimum production tier
Pro$5,0002,000,000+Real-time streaming

Free tier restrictions:

  • 500 tweets/month (~16-17/day)
  • 1 request/day per endpoint
  • No publishing/liking
  • Suitable for development testing only

Output Formats

  • JSON: Structured data with all fields
  • Pretty: Human-readable formatted text
  • Save: Optional file export (JSON/Markdown)

Error Handling

The scripts automatically handle:

  • Rate limiting (429 errors)
  • Invalid tokens (401 errors)
  • Network errors with retry logic
  • Missing required parameters

Examples

Example 1: Search AI tweets

python3 scripts/search_tweets.py --query "AI OR 人工智能 -is:retweet" --count 5 --output pretty

Example 2: Monitor specific user

python3 scripts/search_tweets.py --query "from:username" --count 10 --save output.json

Example 3: Get article and analyze

python3 scripts/get_article.py --url "https://x.com/user/article/id" --output markdown --save article.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

redmine-tools

Fetch, update, and summarize Redmine issue attachments from CLI.

Registry SourceRecently Updated
Coding

进出口许可文档智能预审系统

进出口许可文档智能预审系统。支持 PDF 和图片处理:自动提取合同号、出口国、进口商、总金额、数量、重量、合格证编号、生产商、报关口岸等字段,检测公章,按审核规则执行审核,生成 MD 和 JSON 审核报告。支持 CLI 和对话交互两种方式触发。

Registry SourceRecently Updated
Coding

Coding Rules

当用户要求生成、修改或审查 Vue3 + TypeScript 子项目代码时触发。 覆盖 kb-pro-table / useTable / useForm 使用规范、arco design + unocss 样式规则、 模块组织与命名规范、枚举与类型约束、ref 优先的响应式规范等。 无论用户是否明确提到"规范...

Registry SourceRecently Updated
Coding

gspread-sheets

Batch read/write Google Sheets using the gspread Python library with service account authentication. Use when the user needs to: (1) read/write/update/clear...

Registry SourceRecently Updated