{"skill":{"slug":"x-api","displayName":"X Api","summary":"Post to X (Twitter) using the official API with OAuth 1.0a. Use when you need to tweet, post updates, or publish content. Bypasses rate limits and bot detection that affect cookie-based approaches like bird CLI.","description":"---\nname: x-api\ndescription: Post to X (Twitter) using the official API with OAuth 1.0a. Use when you need to tweet, post updates, or publish content. Bypasses rate limits and bot detection that affect cookie-based approaches like bird CLI.\n---\n\n# x-api 🐦\n\nPost to X using the official API (OAuth 1.0a).\n\n## When to Use\n\n- Posting tweets (cookie-based `bird tweet` gets blocked by bot detection)\n- Official API access is needed for reliability\n\nFor **reading** (timeline, search, mentions), use `bird` CLI instead — it's free and works well for reads.\n\n## Setup\n\n### 1. Get API Credentials\n\n1. Go to https://developer.x.com/en/portal/dashboard\n2. Create a Project and App\n3. Set App permissions to **Read and Write**\n4. Get your keys from \"Keys and tokens\" tab:\n   - API Key (Consumer Key)\n   - API Key Secret (Consumer Secret)\n   - Access Token\n   - Access Token Secret\n\n### 2. Configure Credentials\n\n**Option A: Environment variables**\n```bash\nexport X_API_KEY=\"your-api-key\"\nexport X_API_SECRET=\"your-api-secret\"\nexport X_ACCESS_TOKEN=\"your-access-token\"\nexport X_ACCESS_SECRET=\"your-access-token-secret\"\n```\n\n**Option B: Config file** at `~/.clawdbot/secrets/x-api.json`\n```json\n{\n  \"consumerKey\": \"your-api-key\",\n  \"consumerSecret\": \"your-api-secret\",\n  \"accessToken\": \"your-access-token\",\n  \"accessTokenSecret\": \"your-access-token-secret\"\n}\n```\n\n### 3. Install Dependency\n\n```bash\nnpm install -g twitter-api-v2\n```\n\n## Post a Tweet\n\n```bash\nx-post \"Your tweet text here\"\n```\n\nOr with full path:\n```bash\nnode /path/to/skills/x-api/scripts/x-post.mjs \"Your tweet text here\"\n```\n\nSupports multi-line tweets:\n```bash\nx-post \"Line one\n\nLine two\n\nLine three\"\n```\n\nReturns the tweet URL on success.\n\n## Limits\n\n- Free tier: 1,500 posts/month (requires credits in X Developer Portal)\n- Basic tier ($100/mo): Higher limits\n\n## Reading (use bird)\n\nFor reading, searching, and monitoring — use the `bird` CLI:\n\n```bash\nbird home                    # Timeline\nbird mentions                # Mentions\nbird search \"query\"          # Search\nbird user-tweets @handle     # User's posts\nbird read <tweet-url>        # Single tweet\n```\n\n## Troubleshooting\n\n**402 Credits Depleted**: Add credits in X Developer Portal → Dashboard\n\n**401 Unauthorized**: Regenerate Access Token (ensure Read+Write permissions are set first)\n\n**No credentials found**: Set env vars or create config file (see Setup above)\n","tags":{"latest":"0.1.0"},"stats":{"comments":5,"downloads":7397,"installsAllTime":65,"installsCurrent":64,"stars":45,"versions":1},"createdAt":1769635911554,"updatedAt":1778485867301},"latestVersion":{"version":"0.1.0","createdAt":1769635911554,"changelog":"- Initial release of x-api: post tweets to X (Twitter) using the official API with OAuth 1.0a.\n- Bypasses rate limits and bot detection—more reliable than cookie-based CLI tools.\n- Clear setup instructions for obtaining and configuring API credentials.\n- Supports multi-line tweet posts and returns the tweet URL on success.\n- Specifies API usage limits, troubleshooting steps, and distinguishes use cases vs. the bird CLI for reading.","license":null},"metadata":null,"owner":{"handle":"lobstergeneralintelligence","userId":"s1738x16pa753833jd1tmqbagd88456k","displayName":"lobstergeneralintelligence","image":"https://avatars.githubusercontent.com/u/257770873?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779917514776}}