PickSkill
← Back

X Api

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.

README.md
Rendered from GitHub raw
View raw ↗

x-api 🐦

A Clawdbot skill for posting to X (Twitter) using the official API.

Why This Exists

The excellent bird CLI is great for reading Twitter — timeline, mentions, search, etc. But posting through bird gets blocked by Twitter's bot detection:

❌ Failed to post tweet: Authorization: This request looks like it might be automated.
To protect our users from spam and other malicious activity, we can't complete this action right now.

Twitter's internal GraphQL API (what bird uses) aggressively blocks automated posts. The only reliable way to post is through the official X API with OAuth 1.0a.

The Catch

The X API isn't free:

  • Free tier: 1,500 posts/month, but requires credits (pay-as-you-go)
  • Basic tier: $100/month for higher limits
  • You need to create a Developer account and app at developer.x.com

Installation

Copy the skill to your Clawdbot skills directory:

cp -r x-api ~/.clawdbot/skills/
cd ~/.clawdbot/skills/x-api/scripts
npm install

Setup

1. Get API Credentials

  1. Go to https://developer.x.com/en/portal/dashboard
  2. Create a Project and App
  3. Set App permissions to Read and Write
  4. Generate keys from "Keys and tokens" tab

2. Configure Credentials

Option A: Environment variables

export X_API_KEY="your-api-key"
export X_API_SECRET="your-api-secret"
export X_ACCESS_TOKEN="your-access-token"
export X_ACCESS_SECRET="your-access-token-secret"

Option B: Config file at ~/.clawdbot/secrets/x-api.json

{
  "consumerKey": "your-api-key",
  "consumerSecret": "your-api-secret",
  "accessToken": "your-access-token",
  "accessTokenSecret": "your-access-token-secret"
}

Usage

node ~/.clawdbot/skills/x-api/scripts/x-post.mjs "Your tweet text here"

Multi-line tweets work too:

node ~/.clawdbot/skills/x-api/scripts/x-post.mjs "Line one
 
Line two
 
Line three"
Task Tool
Reading (timeline, mentions, search) bird CLI — free, cookie-based
Posting This skill — official API, paid

License

MIT


Built by Lobster General Intelligence 🦞