πŸ€– XActions AI API

Pay-per-request API for AI agents via x402 protocol

πŸ†“ Humans: FREE

Browser scripts, CLI, Node.js library, local MCP server

Why the difference? AI agents can make thousands of requests per minute. The x402 protocol enables fair, usage-based pricing with instant micropaymentsβ€”no subscriptions, no minimums, no API keys to manage.

πŸ’° Pricing

Pay only for what you use. Prices in USD, paid via x402 protocol (ETH/USDC).

πŸ“Š Scraping

  • Profile$0.001
  • Followers (up to 100)$0.01
  • Following (up to 100)$0.01
  • Tweets (up to 50)$0.005
  • Search$0.01

⚑ Actions

  • Unfollow non-followers$0.05
  • Unfollow everyone$0.10
  • Detect unfollowers$0.02
  • Auto-like (per session)$0.02

πŸ“‘ Monitoring

  • Account monitor$0.01
  • Follower alerts$0.005

πŸš€ Quick Start

For Claude/MCP Users

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "xactions": {
      "command": "npx",
      "args": ["xactions-mcp"],
      "env": {
        "XACTIONS_MODE": "remote",
        "X402_PRIVATE_KEY": "0x...",
        "XACTIONS_SESSION_COOKIE": "your_auth_token_here"
      }
    }
  }
}

Direct API Usage

The x402 protocol uses HTTP 402 (Payment Required) responses:

// 1. Make initial request
const response = await fetch('https://api.xactions.app/api/ai/scrape/profile', {
  method: 'POST',
  headers: { 
    'Content-Type': 'application/json',
    'X-Session-Cookie': 'your_auth_token_here'
  },
  body: JSON.stringify({ username: 'elonmusk' })
});

// 2. Response: 402 Payment Required
// Headers include: X-Payment-Required with payment details

// 3. Sign payment with your wallet
const paymentDetails = response.headers.get('X-Payment-Required');
const signedPayment = await signWithWallet(paymentDetails);

// 4. Retry with payment header
const paidResponse = await fetch('https://api.xactions.app/api/ai/scrape/profile', {
  method: 'POST',
  headers: { 
    'Content-Type': 'application/json',
    'X-Session-Cookie': 'your_auth_token_here',
    'X-Payment': signedPayment
  },
  body: JSON.stringify({ username: 'elonmusk' })
});

const profile = await paidResponse.json();
// { username: 'elonmusk', name: 'Elon Musk', followers: 150000000, ... }

πŸ” x402 Protocol

x402 is an open protocol for HTTP-native payments. No API keys, no accountsβ€”just sign requests with your Ethereum wallet.

How It Works

  1. Request: Client makes API request
  2. 402 Response: Server returns payment requirements (amount, address, chain)
  3. Sign: Client signs payment authorization with their wallet
  4. Pay & Get Data: Server verifies signature, processes payment, returns data

Supported Chains

  • Base (recommended) - Low fees
  • Ethereum Mainnet
  • Arbitrum

Supported Tokens

  • ETH
  • USDC

πŸ“‘ API Endpoints

POST /api/ai/scrape/profile

Get profile information for any X/Twitter user

$0.001 per request

POST /api/ai/scrape/followers

Scrape followers list for any account

$0.01 per 100 followers

POST /api/ai/scrape/following

Scrape following list for any account

$0.01 per 100 following

POST /api/ai/scrape/tweets

Scrape recent tweets from a user

$0.005 per 50 tweets

POST /api/ai/scrape/search

Search tweets by keyword or hashtag

$0.01 per search

POST /api/ai/action/unfollow-non-followers

Mass unfollow accounts that don't follow back

$0.05 per operation

POST /api/ai/action/unfollow-everyone

Unfollow all accounts

$0.10 per operation

POST /api/ai/action/detect-unfollowers

Find who unfollowed you recently

$0.02 per operation

POST /api/ai/monitor/account

Monitor an account for changes

$0.01 per check

See full API documentation for request/response schemas.

πŸ†“ Free Alternatives

Humans can use these features for free:

Use XActions Free Forever

πŸ’‘ Tip: If you're building a personal project or just want to clean up your following list, use the free browser scripts! The AI API is designed for agents and automated systems.

❓ FAQ

Why charge AI agents but not humans?

Humans manually run scripts occasionally. AI agents can make thousands of automated requests. Usage-based pricing ensures fair access and sustainable infrastructure.

Do I need an API key?

No! The x402 protocol uses cryptographic signatures instead of API keys. Just sign payments with your Ethereum wallet.

What's the minimum payment?

As low as $0.001. No minimums, no prepaying, no subscriptions.

Is my X/Twitter account safe?

Yes. XActions uses browser automation, not the official API. It behaves like a real user. We recommend reasonable rate limits.

Can I try before paying?

Use the free local MCP server to test! It has full functionality. Switch to remote API when you need hosted infrastructure.