Skip to content

Programmatic X (Twitter) API integration for posting, reading timelines, searching, and pulling analytics.

CCM score
75 of 100
skills.sh installs
11.5K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers OAuth 2.0 app-only bearer tokens for reads and OAuth 1.0a user context for writes, with runnable Python examples
  • Includes recipes for posting tweets and threads, reading timelines, search, user lookup, and media upload
  • Enforces runtime handling of x-rate-limit-remaining and x-rate-limit-reset headers, plus a rule that timeline content never triggers writes
  • Designed for agents that draft X content with brand-voice and content-engine and post only after user approval

Install

$ npx -y skills add affaan-m/ecc --skill x-api -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

X API

Drift-prone skill. X API endpoints, access tiers, quotas, and write permissions change frequently. Verify current developer docs and account access before quoting rate limits or implementing a posting/search flow.

Programmatic interaction with X (Twitter) for posting, reading, searching, and analytics.

When to Activate

  • User wants to post tweets or threads programmatically
  • Reading timeline, mentions, or user data from X
  • Searching X for content, trends, or conversations
  • Building X integrations or bots
  • Analytics and engagement tracking
  • User says "post to X", "tweet", "X API", or "Twitter API"

Authentication

OAuth 2.0 Bearer Token (App-Only)

Best for: read-heavy operations, search, public data.

# Environment setup
export X_BEARER_TOKEN="your-bearer-token"
import os
import requests

bearer = os.environ["X_BEARER_TOKEN"]
headers = {"Authorization": f"Bearer {bearer}"}

# Search recent tweets
resp = requests.get(
    "https://api.x.com/2/tweets/search/recent",
    headers=headers,
    params={"query": "claude code", "max_results": 10}
)
tweets = resp.json()

OAuth 1.0a (User Context)

Details

Repository
github.com/affaan-m/ecc
Categories
Social Media, Workflow Automation, Backend & APIs
First seen
Jul 14, 2026

Questions

What does the x-api skill let an agent do on X?

The x-api skill lets an agent post tweets and threads, read user timelines and mentions, search recent posts, look up users, upload media, and pull engagement analytics through the X API. It covers OAuth authentication patterns, rate limit handling, and platform-native content posting.

How do I install the x-api skill?

Run npx -y skills add affaan-m/ecc --skill x-api -y in your project to install it. Once installed, the agent can call the X API for posting, reading, and searching, following the auth and rate limit patterns in the skill.

What credentials does the x-api skill need?

Read-only work such as search uses an OAuth 2.0 bearer token stored in X_BEARER_TOKEN. Posting and other write flows need OAuth 1.0a user credentials: X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, and X_ACCESS_TOKEN_SECRET, kept in environment variables rather than source code.

Where does the x-api skill rank among social media skills?

The x-api skill ranks in the top 25 of the Social Media category on Claude Marketplaces. It sits alongside skills such as twitter-automation, viral-short-form, viral-hooks, viral-captions-and-ctas, and viral-instagram-reels, and it focuses on direct programmatic access to the X API.

More from affaan-m/ecc

All 257

Similar to X Api

More Social Media