x-api
Skill by affaan-m
Guides an AI assistant through the X (Twitter) API for posting tweets and threads, reading timelines, searching, and tracking engagement. Aimed at developers and users who want to interact with X programmatically.
Install x-api
Built from the published package, never by AI.
git clone --depth 1 https://github.com/affaan-m/ECC /tmp/ECC && mkdir -p ~/.claude/skills && cp -r /tmp/ECC/.agents/skills/x-api ~/.claude/skills/x-apiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/affaan-m/ECC /tmp/ECC && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ECC/.agents/skills/x-api ~/.gemini/antigravity-cli/skills/x-apiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The x-api skill gives an AI assistant guidance for working with the X (Twitter) API. It covers posting tweets and threads, reading user timelines, searching recent tweets, looking up users by username, uploading media, and tracking engagement through public metrics. The skill includes Python examples for OAuth 2.0 bearer token and OAuth 1.0a authentication, along with rate limit and error handling patterns.
The skill also describes how to combine it with brand-voice and content-engine to draft platform-native posts. According to its workflow, drafts are returned for approval unless the user explicitly asks to post now. It is aimed at developers and users who want to build X integrations or bots. Its security notes cover keeping tokens in environment variables and using read-only tokens when write access is not needed.
Written from the project's SKILL.md and checked against it.
What it can do
- Post tweetsPublishes a single tweet through the X API using OAuth 1.0a user context.
- Post threadsPosts a sequence of tweets, each replying to the previous one.
- Read user timelineFetches a user's tweets with created_at and public_metrics fields.
- Search tweetsSearches recent tweets using X query operators such as from: and -is:retweet.
- Get user by usernameLooks up an X user profile by username with public metrics.
- Upload media and postUploads an image through the v1.1 media endpoint and attaches it to a tweet.
- Pull original posts for voice modelingRetrieves recent original posts, excluding retweets and replies, for voice matching.
- Handle rate limitsReads rate limit headers at runtime and backs off when the remaining count is low.
- Handle API errorsMaps 201, 429, 403 and other status codes to clear error messages.
What you need
- X developer account to generate tokens at developer.x.com
- X bearer token for read and search operations
- OAuth 1.0a consumer and access tokens for posting
- Python with requests and requests_oauthlib
Try asking
- Post a thread to X about my new release, with one idea per tweet
- Search X for recent tweets about claude code and summarize them
- Pull my last 25 original X posts so you can match my writing voice
Good to know
- Writing and posting require OAuth 1.0a user context tokens
- X rate limits vary by endpoint, auth method and account tier, and change over time
- The workflow returns drafts for approval before posting unless the user asks to post now
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/x-api/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md6 KB -
agents/openai.yaml254 B
Alternatives to x-api
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
x-api: common questions
Which X authentication method should I use?
The skill uses OAuth 2.0 bearer tokens for read-heavy operations like search and public data. It requires OAuth 1.0a user context for posting tweets, managing the account, DMs and other write flows.
How does the skill handle X rate limits?
It recommends checking the current X developer docs and reading the x-rate-limit-remaining and x-rate-limit-reset headers at runtime. It suggests backing off automatically instead of relying on static tables in code.
Will the skill post to X without my approval?
No. The source says the workflow returns the draft for approval and posts via the X API only after approval, unless the user explicitly asks to post now.
How do I install x-api?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is x-api free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is x-api safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to x-api?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
