x-api
X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics.
Skill by ysyecust
Chalk Labs
Need help deploying x-api?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ysyecust-x-api
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, data, security, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
x-api- Description
- X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.
- License
- MIT
- Instructions
- 226 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (2)
- SKILL.md
- openai.yaml · agents/
SKILL.md (first lines)
# X API
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.
```bash
# Environment setup
export X_BEARER_TOKEN="your-bearer-token"
```
```python
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)
Required for: posting tweets, managing account, DMs, and any write flow.
```bash
# Environment setup — source before use
export X_CONSUMER_KEY="your-consumer-key"
export X_CONSUMER_SECRET="your-consumer-secret"
export X_ACCESS_TOKEN="your-access-token"
export X_ACCESS_TOKEN_SECRET="your-access-token-secret"
```
Legacy aliases such as `X_API_KEY`, `X_API_SECRET`, and `X_ACCESS_SECRET` may exist in older setups. Prefer the `X_CONSUMER_*` and `X_ACCESS_TOKEN_SECRET` names when documenting or wiring new flows.
```python
import os
from requests_oauthlib import OAuth1Session
oauth = OAuth1Session(
os.environ["X_CONSUMER_KEY"],
client_secret=os.environ["X_CONSUMER_SECRET"],
resource_owner_key=os.environ["X_ACCESS_TOKEN"],
resource_owner_secret=os.environ["X_ACCESS_TOKEN_SECRET"],
)
```
## Core Operations
### Post a Tweet
```python
resp = oauth.post(
"https://api.x.com/2/tweets",
json={"text": "Hello from Claude Code"}
)
resp.raise_for_status()
tweet_id = resp.json()["data"]["id"]
```
### Post a Thread
```python
def post_thread(oauth, tweets: list[str]) -> list[str]:
ids = []
reply_to = None
for text in tweets:
payload = {"text": text}
if reply_to:
payload["reply"] = {"in_reply_to_tweet_id": reply_to}
resp = oauth.post("https://api.x.com/2/tweets", json=payload)
tweet_id = resp.json()["data"]["id"]
ids.append(tweet_id)
reply_to = tweet_id
return ids
```
### Read User Timeline
```python
resp = requests.get(
f"https://api.x.com/2/users/{user_id}/tweets",
headers=headers,
params={
"max_results": 10,
"tweet.fields": "created_at,public_metrics",
}
)
```
### Search Tweets
```python
resp = requests.get(
"https://api.x.com/2/tweets/search/recent",
headers=headers,
params={
"query": "from:affaanmustafa -is:retweet",
"max_results": 10,
"tweet.fields": "public_metrics,created_at",From ysyecust/everything-claude-code, MIT.
More from ysyecust/everything-claude-code
- 0.581score
brand-discovery
ysyecust
Use when a brand needs to discover or articulate its identity through structured multi-session interviews.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
competitive-platform-analysis
ysyecust
Use when scoping a competitive landscape — identifying, categorising, and score-filtering a competitor set before any benchmarking begins.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
benchmark-methodology
ysyecust
Use after competitive-platform-analysis has produced a tiered competitor set.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
competitive-report-structure
ysyecust
Use after benchmark-methodology has produced scored competitor profile cards.
SkillCFreshness: C★ 59Claude Code +9 - 0.570score
everything-claude-code
ysyecust
Development conventions and patterns for everything-claude-code.
SkillCFreshness: C★ 59Claude Code +9 - 0.570score
verification-loop
ysyecust
A comprehensive verification system for Claude Code sessions.
SkillCFreshness: C★ 59Claude Code +9 - 0.501score
everything-claude-code-conventions
ysyecust
Development conventions and patterns for everything-claude-code.
SkillDFreshness: D★ 59Claude Code +9
Signals
- Stars
- 59
- Forks
- 11
- Open issues
- 3
- Last commit (this folder)
- Apr 29, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.581score
x-api
mturac
X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics.
SkillCFreshness: C★ 83Claude Code +9 - 0.401score
x-api
Fmarzochi
X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics.
SkillAFreshness: A★ 67Claude Code +9
More from ysyecust
- 0.581score
brand-discovery
ysyecust
Use when a brand needs to discover or articulate its identity through structured multi-session interviews.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
competitive-platform-analysis
ysyecust
Use when scoping a competitive landscape — identifying, categorising, and score-filtering a competitor set before any benchmarking begins.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
benchmark-methodology
ysyecust
Use after competitive-platform-analysis has produced a tiered competitor set.
SkillCFreshness: C★ 59Claude Code +9 - 0.576score
competitive-report-structure
ysyecust
Use after benchmark-methodology has produced scored competitor profile cards.
SkillCFreshness: C★ 59Claude Code +9 - 0.570score
everything-claude-code
ysyecust
Development conventions and patterns for everything-claude-code.
SkillCFreshness: C★ 59Claude Code +9 - 0.570score
verification-loop
ysyecust
A comprehensive verification system for Claude Code sessions.
SkillCFreshness: C★ 59Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get x-api running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
x-api skill. Agent Mart. https://agentmart.dev/skills/ysyecust-x-api (last updated 2026-10-24)