📚 XActions Documentation

🎉 100% Free & Open Source No API fees, no accounts required

🚀 Quick Start (60 Seconds)

Get started with XActions in under a minute. Choose your preferred method:

1 Browser Scripts (Easiest)

No installation needed. Just paste code in your browser console.

1. Go to x.com and log in
2. Navigate to the relevant page (e.g., /following)
3. Press F12 to open DevTools
4. Click "Console" tab
5. Paste the script and press Enter

2 CLI Tool (Power Users)

Install globally for command-line access to all features.

# Install globally
npm install -g xactions

# Or use npx (no install)
npx xactions --help

3 Node.js Library

Import into your own projects for programmatic access.

npm install xactions

// In your code:
const xactions = require('xactions');
const profile = await xactions.scrapeProfile('elonmusk');

đŸ’ģ CLI Installation

Requirements

  • Node.js 18+ (check with node --version)
  • npm or yarn package manager

Install Globally

# npm
npm install -g xactions

# yarn
yarn global add xactions

# Verify installation
xactions --version

Or Use Without Installing

# Run any command with npx
npx xactions scrape profile elonmusk
npx xactions mcp

âš ī¸ Note: Some features require Puppeteer for browser automation. It will be installed automatically but may need additional dependencies on Linux.

📖 CLI Reference

xactions scrape profile <username>

Scrape a user's profile information.

  • --output, -o - Output format (json, csv, table)
  • --file, -f - Save to file
xactions scrape followers <username>

Scrape a user's followers list.

  • --limit, -l - Maximum followers to scrape (default: 100)
  • --output, -o - Output format
xactions scrape following <username>

Scrape who a user follows.

  • --limit, -l - Maximum users to scrape
  • --output, -o - Output format
xactions scrape tweets <username>

Scrape a user's recent tweets.

  • --limit, -l - Maximum tweets (default: 50)
  • --include-replies - Include replies
  • --include-retweets - Include retweets
xactions mcp

Start the MCP (Model Context Protocol) server for AI agent integration.

  • Works with Claude Desktop, Cursor, and other MCP clients
  • Exposes all XActions features as AI tools

đŸ“Ļ Node.js API

Installation

npm install xactions

Basic Usage

const xactions = require('xactions');

// Scrape a profile
const profile = await xactions.scrapeProfile('elonmusk');
console.log(profile);
// { username, name, bio, followers, following, tweets, ... }

// Scrape followers
const followers = await xactions.scrapeFollowers('elonmusk', { limit: 100 });
console.log(`Found ${followers.length} followers`);

// Scrape following
const following = await xactions.scrapeFollowing('elonmusk', { limit: 100 });

// Scrape tweets
const tweets = await xactions.scrapeTweets('elonmusk', { limit: 50 });

// Search tweets
const results = await xactions.searchTweets('web3 crypto', { limit: 100 });

Advanced Options

// Configure scraper options
const xactions = require('xactions');

// With authentication (for protected actions)
const client = xactions.createClient({
  authToken: process.env.X_AUTH_TOKEN,
  headless: true,  // Run browser in background
  timeout: 30000,  // 30 second timeout
});

// Use authenticated client
const myFollowers = await client.scrapeFollowers('myusername');
await client.close();

🤖 MCP Server Setup

Connect XActions to Claude Desktop or any MCP-compatible AI agent.

Quick Setup

# Start MCP server
npx xactions mcp

Claude Desktop Configuration

Add to your ~/.claude/config.json:

{
  "mcpServers": {
    "xactions": {
      "command": "npx",
      "args": ["xactions", "mcp"],
      "env": {
        "X_AUTH_TOKEN": "your_auth_token_here"
      }
    }
  }
}

Available MCP Tools

  • scrape_profile - Get user profile information
  • scrape_followers - Get user's followers
  • scrape_following - Get who user follows
  • scrape_tweets - Get user's tweets
  • search_tweets - Search tweets by keyword
  • unfollow_everyone - Mass unfollow all
  • unfollow_non_followers - Unfollow non-followers
  • detect_unfollowers - Find who unfollowed
  • auto_like - Like posts by keyword
  • download_video - Download tweet videos

💡 Tip: Once configured, just ask Claude "scrape Elon Musk's profile" and it will use XActions automatically!

🌐 Browser Scripts Guide

Browser scripts are the easiest way to use XActions. No installation required!

How to Use

  1. Go to x.com and log in
  2. Navigate to the relevant page
  3. Press F12 (or Cmd+Option+J on Mac) to open DevTools
  4. Click the Console tab
  5. Paste the script and press Enter

Available Scripts

See the Features page for all scripts with full code.

âš ī¸ Safety Tips:

  • Don't run scripts from untrusted sources
  • Start with small batches to test
  • Aggressive automation may trigger rate limits
  • Scripts only work while the browser tab is open

🔐 Authentication

Some features require authentication. Here's how to get your auth token:

Getting Your Auth Token

  1. Go to x.com and log in
  2. Open DevTools (F12)
  3. Go to Application → Cookies → x.com
  4. Find the auth_token cookie
  5. Copy the value

âš ī¸ Security Warning: Never share your auth token! It provides full access to your account. Treat it like a password.

Using Auth Token

# Set as environment variable
export X_AUTH_TOKEN="your_auth_token_here"

# Or pass to CLI
xactions scrape followers myuser --auth-token="your_token"

# Or in Node.js
const client = xactions.createClient({
  authToken: process.env.X_AUTH_TOKEN
});

❓ FAQ

Is XActions free?

Yes! XActions is 100% free and open source under the MIT license. No API fees, no subscriptions.

Do I need to pay for Twitter/X API?

No! XActions uses browser automation, not the official API. This means you avoid the $100+/month API fees.

Is it safe to use?

Browser scripts run entirely in your browser. The CLI uses Puppeteer to automate a real browser. Nothing is sent to third-party servers.

Can I get banned?

Any automation carries some risk. XActions includes rate limiting and human-like delays, but aggressive use may trigger spam detection. Use responsibly!

Why did my script stop?

Browser scripts stop when you navigate away. For long-running tasks, keep the tab open or use the CLI.

How do I report bugs?

Open an issue on GitHub!

đŸ’Ŧ Support

⭐ If XActions helped you, please star us on GitHub!