π€ XActions AI API
Pay-per-request API for AI agents via x402 protocol
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
- Request: Client makes API request
- 402 Response: Server returns payment requirements (amount, address, chain)
- Sign: Client signs payment authorization with their wallet
- 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
POST /api/ai/scrape/followers
Scrape followers list for any account
POST /api/ai/scrape/following
Scrape following list for any account
POST /api/ai/scrape/tweets
Scrape recent tweets from a user
POST /api/ai/scrape/search
Search tweets by keyword or hashtag
POST /api/ai/action/unfollow-non-followers
Mass unfollow accounts that don't follow back
POST /api/ai/action/unfollow-everyone
Unfollow all accounts
POST /api/ai/action/detect-unfollowers
Find who unfollowed you recently
POST /api/ai/monitor/account
Monitor an account for changes
See full API documentation for request/response schemas.
π Free Alternatives
Humans can use these features for free:
Use XActions Free Forever
- π Browser Scripts β Copy-paste automation in your browser console
-
π»
CLI Tool β
npm install -g xactions -
π¦
Node.js Library β
npm install xactions - π€ Local MCP Server β Free with Puppeteer (runs on your machine)
π‘ 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.