XActions について
XActions は X/Twitter の自動化ツールキットで、スクレイパー、MCP サーバー、コマンドライン、ブラウザスクリプト、ブラウザ拡張機能を含みます。API キーは不要です。MCP サーバーは AI エージェント向けで、書き込み操作を人間が確認するドラフトとして保留できます。
主な機能
- 01API キー不要のプロフィールとポストの取得
- 02ツールグループで絞り込み可能な MCP サーバー
- 0356 コマンドを備えたコマンドライン
- 04書き込みをレビュー用のドラフトとして保留
- 05アカウントごとの日次操作上限をディスクに保存
活用シーン
- 01公開アカウントのタイムラインを CSV に書き出す
- 02AI エージェントが MCP 経由で検索や投稿を行う
- 03自分のアカウントの返信やエンゲージメントを一括管理
MCP 対応
このプロジェクトは MCP サーバーであり、X/Twitter の読み取り、書き込み、分析ツールを stdio または Streamable HTTP で MCP クライアントに提供します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
npx -y xactionsX_COOKIESシークレットX/Twitter authentication cookies (JSON string or path to cookies file)X_USERNAMEX/Twitter username for loginX_PASSWORDシークレットX/Twitter password for loginローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。
ツール
145掲載時のツール一覧 · 2 週間前に更新
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
| cookie | string | はい | X.com の auth_token Cookie 値 |
詳細
██╗ ██╗ █████╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗███████╗ ╚██╗██╔╝██╔══██╗██╔════╝╚══██╔══╝██║██╔═══██╗████╗ ██║██╔════╝ ╚███╔╝ ███████║██║ ██║ ██║██║ ██║██╔██╗ ██║███████╗ ██╔██╗ ██╔══██║██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║ ██╔╝ ██╗██║ ██║╚██████╗ ██║ ██║╚██████╔╝██║ ╚████║███████║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
X/Twitter 自動化のための完全なツールキット
スクレイパー · AI エージェント向け MCP サーバー · CLI · ブラウザスクリプト · ブラウザ拡張機能
API キー不要。月額料金不要。100%オープンソース。
⚡ 30 秒で試す
npx xactions profile nasa
⚡ @NASA
Name: NASA
Bio: Making the seemingly impossible, possible. ✨
Location: Pale Blue Dot
Website: http://www.nasa.gov/
Joined: 2007-12-19
Following: 117 Followers: 92.4M
Tweets: 74.2K Listed: 0
✓ Verified
API キー不要。アカウント不要。ブラウザ不要。約 1 秒で実際のデータを取得できます。
npx xactions tweets nasa --limit 100 --output nasa.csv # timeline to a spreadsheet
npx xactions login # unlock search, followers, DMs
npx xactions search "your brand" --limit 50 # what people are saying
⚡ 動作を見る
🏆 XActions の比較
代替手段ではなく、XActions を使って開発する理由は何ですか?
| 機能 | XActions | twikit | twscrape | x-use | xmcp (official) | bird | twitter-cli | Agent-Reach |
|---|---|---|---|---|---|---|---|---|
| API キー不要 | ✅ | ✅ Cookie | ✅ アカウントプール | ✅ ブラウザー | ❌ X API キー | ✅ Cookie | ❌ X API キー | ✅ |
| MCP サーバー(AI エージェント) | ✅ 154 個のツール | ❌ | ❌ | ✅(33 個のツールを備えたサーバー) | ✅(140 個のツール、従量課金制) | ❌ | ❌ | ❌ MCP ではなくスキル |
| ブラウザーコンソールスクリプト | ✅ 95 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Spaces の AI 音声エージェント | ✅ 参加、聞く、話す | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| CLI | ✅ 56 個のコマンド | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ |
| 書き込み時の人間による承認ゲート | ✅ すべての書き込みを下書きとして保留 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 再起動後も維持される1日の操作上限 | ✅ アカウントごとにディスク上で管理 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| ローテーション機能付きアカウントプール | ✅ SQLite、操作ごとのウィンドウ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 再開可能な長時間スクレイピング | ✅ カーソルチェックポイント | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| インストール済みブラウザーの Cookie | ✅ --from-browser、--cookies-file | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
| X 公式アーカイブのインポート | ✅ xactions archive | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 言語 | JavaScript | Python | Python | TypeScript | TypeScript | TypeScript | Python | Python |
XActions は API キーなしで、ブラウザー、ターミナル、AI エージェントのすべてに対応する唯一のツールキットです。
競合製品の列は、各プロジェクトとそれぞれが当社より優れている点を記載した競合監査に基づいています。競合が先行していた機能は、当社でも実装しました。承認ゲートと1日の操作上限は x-use、アカウントプールは twscrape、カーソルによる再開は Scweet、ブラウザーの Cookie インポートは bird と twitter-cli に倣っています。
🆕 最新情報
| 分野 | 変更内容 |
|---|---|
| あるアカウントに送った返信をすべて削除 | scripts/searchSweep.js を使えば、X の検索を一括操作に変えられます。x.com/search?q=from:you @someone&f=live を開いて貼り付けると、フローティングパネル、ドライラン、反響の大きかった投稿を保護するフィルターを使って、検索結果をすべて削除、いいね、リポスト、または返信できます。X の検索結果は一度に一部しか返さないため、複数回に分けて処理します。削除の対象は、常に自分の投稿だけです。ドキュメント。 |
| プロフィール全体を一括処理 | scripts/engageProfile.js は、フローティングパネル、ドライラン、再開、取り消しに対応し、コンソールからアカウントのすべての投稿にいいね、リポスト、返信を行います。返信にはテンプレートを使うか、1 行の概要を渡した LLM を使えます(Grok はコンソールからそのまま利用でき、拡張機能を通じて任意のプロバイダーも利用できます)。ターミナルで xactions engage USERNAME --like --repost --comment --prompt "..." を実行しても、任意のプロバイダーを使って同じ操作ができます。ドキュメント。 |
| 操作しやすい CLI | 56 個すべてのコマンドを、アルファベット順ではなくタスクごとに分類しました。xactions quickstart を実行すると、すでに設定済みの内容に合わせて初回実行をガイドします。 |
| タブ補完 | xactions completion bash|zsh|fish は、実際のコマンドツリーから生成した補完スクリプトを出力するため、すべてのコマンド、サブコマンド、フラグを補完できます。 |
| DevTools を使わずにログイン | xactions login --from-browser は、インストール済みの Chrome、Chromium、Brave、Edge、Arc、Firefox のプロファイルから x.com の Cookie を直接読み取ります。--cookies-file は、Netscape 形式の cookies.txt、Cookie-Editor または EditThisCookie の JSON エクスポート、Playwright または Puppeteer の storageState をインポートします。完全な Cookie セットには、書き込みのたびに必要な ct0 が含まれているため、auth_token だけの場合より確実です。 |
| 自動で修復するクエリ ID | X は GraphQL のクエリ ID をローテーションし、そのたびに固定 ID を使うすべてのクライアントが一斉に 404 を返します。このプロジェクトでは x.com 自身のバンドルから ID を検出してキャッシュするため、ローテーションがあっても気づかずに使えます。xactions doctor でキャッシュの経過時間を確認できます。 |
| 実際のクライアントと同じ署名付きリクエスト | すべての GraphQL 呼び出しには、x.com 自身のウェブクライアントと同じ方法で計算した x-client-transaction-id ヘッダーが含まれるため、読み取りではブラウザーと同じ結果が得られます。 |
| アカウントプールと再開可能なスクレイピング | セッションは SQLite データベースに保存され、それぞれに専用のプロキシと、X 自身のヘッダーから読み取った操作ごとのレート制限期間が設定されます。プールクライアントは 429 が返るとアカウントを切り替え、401 が返るとそのアカウントをロックします。各ページの処理後にチェックポイントを書き込むため、5 万人のフォロワーをスクレイピングして 400 ページ目で停止しても、最初のページからではなく、カーソルの位置から再開できます。 |
| 1 日あたりの操作上限 | MCP の書き込みはすべて、アカウントごとのディスク上に保存されるローリング 24 時間予算から差し引かれます。上限は再起動、クラッシュ、新しい npx xactions-mcp の実行後も維持され、上限を超える呼び出しは X に到達する前に拒否されます。デフォルト値は X が公開している制限に準拠しています。 |
| 人間が承認する書き込み | XACTIONS_MCP_REQUIRE_APPROVAL=1 を設定すると、すべての書き込みツールが下書きになります。xactions drafts list で確認し、xactions drafts approve <id> で公開するか、x_list_drafts/x_approve_draft/x_discard_draft ツールを使用してください。 |
| MCP ツールグループ | ツール一覧はフィルタリングできます。--tools read,analytics または XACTIONS_MCP_TOOLS=read を指定すると、そのセッションで必要なツールだけが公開され、フィルターされたツールは公開も呼び出しもできません。グループ:read、write、dm、lists、spaces、analytics、ai、grok、automation、monitoring、workflows、persona、graph、data、x402、drafts、auth。 |
| HTTP 経由の MCP | xactions-mcp --http は、リモートクライアントやホスト型クライアント向けに、/mcp で Streamable HTTP トランスポートを提供します。XACTIONS_MCP_TOKEN による任意のベアラートークン認証にも対応しています。デフォルトは引き続き stdio です。 |
| Claude Desktop にドラッグ 1 回でインストール | .mcpb バンドルにはサーバーとその依存関係が含まれ、インストール時にセッション Cookie とツールグループを入力するため、設定ファイルに何も記述する必要はありません。すべてのリリースに添付されています。 |
| インストール可能なスキル | xactions skills install --all は、同梱されている 50 個のスキルを Claude Code、Cursor、Codex、Windsurf、または現在のプロジェクトにコピーします。xactions skills show <name> を使うと、インストールせずにスキルを 1 つ確認できます。 |
| X アーカイブを取り込む | xactions archive summary|export|migrate は、X 公式データのエクスポート ZIP を読み取ります。件数、日付範囲、最も投稿の多かった年、上位のハッシュタグを確認したり、JSON、CSV、Markdown、閲覧可能な HTML ビューアーに書き換えたり、Bluesky または Mastodon に移行したりできます。ドキュメント。 |
| リアルタイムイベントストリーミング | src/streaming/livePipeline.js は、x.com 自身のイベントパイプラインを読み取ります。エンゲージメント数、DM の更新、入力中のインジケーターがポーリングではなくプッシュで届き、セッション中にサブスクリプションを変更できます。これはチャンク化された改行区切り JSON のレスポンスであり、WebSocket ではありません。x.com がそのエンドポイントに対して 101 を返さないためです。 |
| 署名付きウェブフック | 送信されるデータには HMAC-SHA256 署名、タイムスタンプ、イベントタイプ、安定した配信 ID が付与されます。バックオフ付きで 3 回再試行され、再生可能な配信ログに記録されます。受信側では、エクスポートされた verifyWebhookSignature を使って検証できます。 |
--compact と --fields | すべての読み取りコマンドで共通して使えます。--compact は、色やスピナーを使わず、1 レコードを 1 行のタブ区切り key=value ペアで出力します。--fields id,text,likes は、指定した列だけに絞り込みます。エージェントやパイプでの利用を想定しています。 |
すべてのコマンドで --json | すべての読み取りコマンドで --json が使えます。データを標準出力に出力し、それ以外は出力しません。--output より優先されるため、パイプ処理が知らないうちにファイルへの書き込みに変わることはありません。 |
| 信頼性 | 公開情報の読み取りに、ブラウザーは不要になりました。プロフィールとタイムラインは、Chromium をダウンロードせずに、内部 GraphQL API から約 1 秒で取得できます。 |
| 正直なエラー報告 | 空の結果を成功として報告することはなくなりました。完了できない読み取りは理由と対処方法を示します。 |
| 写真と動画をすべてアーカイブ | xactions download @nichxbt:all --archive は、プロフィールのメディア、アバター、バナーを gallery-dl 形式のファイル名テンプレートで保存し、その後は差分を取得します。Range を使って中断したファイルを再開し、レート制限を再試行します。リポスト経由で同じ写真に再度アクセスした場合は、二重に保存せずハードリンクを作成します。xactions/media と x_download_media MCP ツールにも対応しています。ドキュメント。 |
| XActions に質問 | xactions.app/ask では、ドキュメント、スキル、スクリプト、リポジトリをもとに、「〜するにはどうすればよいですか?」という質問に平易な言葉で回答し、コンソールスクリプト(ソースからコピー)、ターミナルコマンド、MCP ツールのいずれかを最後に提示します。ターミナルで xactions ask "how do I unfollow everyone?" を実行しても質問できます。また、エージェントが実行前にマニュアルを読めるように x_ask も用意されています。キー不要のものを 3 つ含む、無料の LLM 利用枠があります。ドキュメント。 |
| サンプル | examples/:最初のプロフィール検索から MCP の下書き承認ゲートまで、実行可能なプログラムを 9 件収録しています。すべて記載どおりに実行できます。 |
| チュートリアル | tutorials/:アカウントを使わない最初のスクレイピングから、独自のパイプライン内で XActions をスクリプトから実行する方法まで、6 件の手順付きガイドを収録しています。 |
| 常に正確なドキュメント | npm run docs:check は、リンク切れ、古いバージョン、誤ったツール数、存在しないコマンドの記載があるとビルドを失敗させます。 |
| クロスプラットフォーム対応 | Bluesky、Mastodon、Threads のスクレイパーを、1 つの正規化されたインターフェースから利用できます。 |
| プラグインシステム | npm を通じてコミュニティプラグインを利用できます。xactions-plugin-* パッケージで、スクレイパー、MCP ツール、自動化機能を拡張できます。 |
| ワークフローエンジン | トリガー、条件、連鎖アクションに対応した宣言型 JSON パイプラインです。 |
| 感情分析 | オフラインで動作するルールベースの分析機能を備え、同じインターフェースから任意の LLM モードも利用できます。 |
| ブラウザー拡張機能 | Chrome/Edge の Manifest V3 に対応しています。コンソールを使わず、ポップアップから自動化を実行できます。 |
ヒント
🤖 AI コーディングアシスタント: 月額 100 ドルの API を使わずに Twitter/X を自動化したい方におすすめです。
📦 インストール
| npm |
|
| CLI |
|
| ブラウザー |
インストール不要です。スクリプトをコピーして、x.com のブラウザーコンソールに貼り付けてください |
📖 目次
学ぶ
- チュートリアル:アカウント不要で最初のスクレイピングを行う方法から、独自のパイプラインで XActions をスクリプト化する方法まで、6 つのガイド付きチュートリアル
- サンプル:初めてのプロフィール検索から MCP の下書き承認ゲートまで、実行可能な 9 つのプログラム
- 始める:インストール、認証、最初のコマンド
- トラブルシューティング:うまく動作しない場合の対処方法
リファレンス
- XActions の比較:あらゆる代替手段との比較
- クイックスタート(30 秒):コピーしてすぐに実行
- インストール:npm、CLI、Docker、またはブラウザー
- 機能一覧:すべての機能とプラットフォーム
- MCP サーバー(AI):Claude、GPT、Cursor 向け
- Space エージェント(AI 音声):ライブ Spaces で動作する AI エージェント
- CLI リファレンス:コマンドラインの使い方
- Node.js API:プログラムからのアクセス
- ブラウザースクリプト:インストール不要のコンソールスクリプト 95 種類
- Docker:1 つのコマンドでデプロイ
- API リファレンス:関数の完全なドキュメント
- Claude チュートリアル:そのまま貼り付けて使えるプロンプト 23 件
- コントリビューション:XActions の改善にご協力ください
✨ 動作の仕組み
| 1. 貼り付ける スクリプトをコピーして x.com の DevTools コンソールに貼り付けます | 2. 実行する CLI、MCP サーバー、 またはブラウザー拡張機能を使用します | 3. 完了 すべてローカルで実行されます。 データがマシンの外に送信されることはありません |
x.com のタブがすべての処理を行います。スクレイピングしたデータがこちらのサーバーに送信されることはありません。ご自身で管理できます。
💰 料金
🆓 100% 無料・オープンソース
ブラウザースクリプト、CLI、Node.js ライブラリ、MCP サーバー、API のすべてを完全無料で利用できます。
API キーもサブスクリプションもペイウォールもありません。クローンして実行するだけです。
🤖 オプション:AI エージェント向けリモート API
リモートの AI エージェントからアクセスできるよう XActions API をセルフホストする場合、x402 プロトコルを使ったリクエストごとの少額決済を任意で有効にできます。この機能は完全に任意で、デフォルトでは無効です。
| 操作 | 料金 |
|---|---|
| プロフィールのスクレイピング | $0.001 |
| フォロワー/フォロー中のユーザー | $0.01 |
| ツイートのスクレイピング | $0.005 |
| ツイートの検索 | $0.01 |
| フォローバックしていないユーザーのフォロー解除 | $0.05 |
| フォロー解除したユーザーの検出 | $0.02 |
| 自動いいね | $0.02 |
| 動画のダウンロード | $0.005 |
これはホスト型のリモート API のみに適用されます。ローカルモードは常に無料です。
🎯 XActions を選ぶ理由は?
| XActions | その他 | |
| 対応範囲 | ブラウザー+CLI+Node.js+MCP+拡張機能 | 通常は1つのみ |
| API キー | 不要 | 多くの場合、Twitter API が必要(月額100ドル) |
| MCP ツール | Claude、GPT、Cursor 向けに152個 | 0~2個のツール |
| AI 機能 | 感情分析、Grok、レピュテーション | なし |
| エクスポート | JSON、CSV、Markdown、HTML | JSON のみ(対応している場合) |
| 移行 | 稼働中のアカウントまたは X のアーカイブ ZIP から Bluesky と Mastodon へ移行 | なし |
| チュートリアル | Claude 向けプロンプト23個 | なし |
🐳 Docker
1つのコマンドで、どこでも XActions を実行できます。
# Quick start
docker build -t xactions .
docker run -it xactions xactions profile elonmusk
# Run the MCP server
docker run -p 3000:3000 xactions npm run mcp
# With environment variables
docker run -e XACTIONS_SESSION_COOKIE=your_cookie xactions xactions followers elonmusk
または Docker Compose を使用します。
docker compose up
詳細は Dockerfile をご覧ください。
📖 API リファレンス
型宣言を含む、TypeScript に対応した完全な API です。
import { createBrowser, createPage, scrapeProfile, scrapeFollowers } from 'xactions';
import { scrapeFollowing, scrapeTweets, searchTweets } from 'xactions/scrapers';
コア関数:
| 関数 | 説明 | 戻り値 |
|---|---|---|
createBrowser(options?) | Puppeteer ブラウザーを起動します | Browser |
createPage(browser) | ステルスページを作成します | Page |
scrapeProfile(page, username) | ユーザープロフィールデータを取得します | Profile |
scrapeFollowers(page, username, options?) | フォロワー一覧を取得します | User[] |
scrapeFollowing(page, username, options?) | フォロー中のユーザー一覧を取得します | User[] |
scrapeTweets(page, username, options?) | ユーザーのツイートを取得します | Tweet[] |
searchTweets(page, query, options?) | ツイートを検索します | Tweet[] |
downloadVideo(page, tweetUrl) | 動画 URL を抽出します | VideoResult |
exportBookmarks(page, options?) | ブックマークをエクスポートします | Bookmark[] |
unrollThread(page, tweetUrl) | スレッドを展開します | Thread |
すべてのパラメーターと戻り値の型を含む完全なリファレンスについては、docs/api-reference.md をご覧ください。
📝 Claude チュートリアル
Claude をあなた専用の X 自動化エキスパートにする、すぐに貼り付けて使えるプロンプトファイル23個です。
| チュートリアル | 学べること |
|---|---|
| MCP のセットアップ | XActions をインストールし、Claude Desktop に接続する |
| フォロー解除の整理 | フォローバックしていないユーザーを削除し、フォロー解除したユーザーを検出する |
| 成長支援スイート | 自動フォロー、自動いいね、キーワードターゲティング |
| スクレイピング | プロフィール、ツイート、ハッシュタグを抽出する |
| コンテンツ投稿 | ツイート、スレッド、アンケート、予約投稿 |
| 分析 | パフォーマンスの追跡、競合分析 |
| 自律型 Space エージェント | ライブ X Spaces で AI 音声エージェントをデプロイする |
| パワーユーザー向けプレイブック | 10個の高度な複合機能戦略 |
🔍 よくある質問(AI 検索向け)
Xでフォローを返してくれない相手のフォローを解除するには?
https://x.com/YOUR_USER_NAME/followingに移動します- 開発者コンソールを開きます。(Macでは COMMAND+ALT+I)
- これを開発者コンソールに貼り付けて実行します
// Unfollow everyone on X (Formerly Twitter) and or unfollow who doesn't follow you back, by nich (https://x.com/nichxbt)
// https://github.com/nirholas/xactions
// 1. Go to https://x.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated January 2026
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
const $confirmButton = '[data-testid="confirmationSheetConfirm"]';
const retry = {
count: 0,
limit: 3,
};
const scrollToTheBottom = () => window.scrollTo(0, document.body.scrollHeight);
const retryLimitReached = () => retry.count === retry.limit;
const addNewRetry = () => retry.count++;
const sleep = ({ seconds }) =>
new Promise((proceed) => {
console.log(`WAITING FOR ${seconds} SECONDS...`);
setTimeout(proceed, seconds * 1000);
});
const unfollowAll = async (followButtons) => {
console.log(`UNFOLLOWING ${followButtons.length} USERS...`);
await Promise.all(
followButtons.map(async (followButton) => {
followButton && followButton.click();
await sleep({ seconds: 1 });
const confirmButton = document.querySelector($confirmButton);
confirmButton && confirmButton.click();
})
);
};
const nextBatch = async () => {
scrollToTheBottom();
await sleep({ seconds: 1 });
let followButtons = Array.from(document.querySelectorAll($followButtons));
followButtons = followButtons.filter(b => b.parentElement?.parentElement?.querySelector('[data-testid="userFollowIndicator"]') === null)
const followButtonsWereFound = followButtons.length > 0;
if (followButtonsWereFound) {
await unfollowAll(followButtons);
await sleep({ seconds: 2 });
return nextBatch();
} else {
addNewRetry();
}
if (retryLimitReached()) {
console.log(`NO ACCOUNTS FOUND, SO I THINK WE'RE DONE`);
console.log(`RELOAD PAGE AND RE-RUN SCRIPT IF ANY WERE MISSED`);
} else {
await sleep({ seconds: 2 });
return nextBatch();
}
};
nextBatch();
})();
プロフィールのすべての投稿に「いいね」、リポスト、返信をするには?
https://x.com/USERNAMEに移動します- 開発者コンソールを開きます。(Macでは COMMAND+ALT+I)
scripts/engageProfile.jsを貼り付けて実行します。パネルが表示されたら、「いいね」/リポスト/返信を選び、ドライランをオンのままにして「Start」を押し、ログを確認してからドライランをオフにします。
返信には、自分で用意したテンプレート、または「支持的で、具体的で、誠実な質問を1つ含む」のような簡単な指示を与えた LLM による文を使用します。ターミナルから実行する場合:npx xactions engage USERNAME --like --repost --comment --prompt "..."。詳しいガイド:docs/engage.md。
Twitter/Xで一括フォロー解除するには?
https://x.com/YOUR_USER_NAME/followingに移動します- 開発者コンソールを開きます。(Macでは COMMAND+ALT+I)
- スクリプトを開発者コンソールに貼り付けて実行します
// Unfollow everyone on X (Formerly Twitter) and or unfollow who doesn't follow you back, by nich (https://x.com/nichxbt)
// https://github.com/nirholas/xactions
//
// 1. Go to https://x.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: January 2026
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
const $confirmButton = '[data-testid="confirmationSheetConfirm"]';
const retry = {
count: 0,
limit: 3,
};
const scrollToTheBottom = () => window.scrollTo(0, document.body.scrollHeight);
const retryLimitReached = () => retry.count === retry.limit;
const addNewRetry = () => retry.count++;
const sleep = ({ seconds }) =>
new Promise((proceed) => {
console.log(`WAITING FOR ${seconds} SECONDS...`);
setTimeout(proceed, seconds * 1000);
});
const unfollowAll = async (followButtons) => {
console.log(`UNFOLLOWING ${followButtons.length} USERS...`);
await Promise.all(
followButtons.map(async (followButton) => {
followButton && followButton.click();
await sleep({ seconds: 1 });
const confirmButton = document.querySelector($confirmButton);
confirmButton && confirmButton.click();
})
);
};
const nextBatch = async () => {
scrollToTheBottom();
await sleep({ seconds: 1 });
const followButtons = Array.from(document.querySelectorAll($followButtons));
const followButtonsWereFound = followButtons.length > 0;
if (followButtonsWereFound) {
await unfollowAll(followButtons);
await sleep({ seconds: 2 });
return nextBatch();
} else {
addNewRetry();
}
if (retryLimitReached()) {
console.log(`NO ACCOUNTS FOUND, SO I THINK WE'RE DONE`);
console.log(`RELOAD PAGE AND RE-RUN SCRIPT IF ANY WERE MISSED`);
} else {
await sleep({ seconds: 2 });
return nextBatch();
}
};
nextBatch();
})();
このスクリプトの特徴:
- 完全に無料です。
- サインインを求めたり、個人データを取得したりすることはありません。
- ウェブブラウザーを自動操作して、フォロー解除ボタンをクリックし、下にスクロールしてさらに表示し、これを繰り返します。
- 仕掛けはありません。コードはすべて公開されているため、動作を正確に確認できます。
Twitterで誰にフォロー解除されたかを調べるには?
src/detectUnfollowers.js を使用します。フォロワーのスナップショットを保存し、次回の実行時に比較します。
Twitter/Xの動画をダウンロードするには?
src/scrapers/videoDownloader.js を使用します。あらゆるツイートから MP4 の URL を抽出します。
無料で使えるTwitter APIの代替手段は?
XActions は API の代わりにブラウザー自動化を使用します。API キーは不要で、レート制限もなく、月額100ドルの料金もかかりません。
Hypefury / Tweethunter の代替手段は?
XActions はオープンソースで、人間は完全無料で利用できます。AI エージェントはリクエストごとに少額のマイクロペイメントを支払います。
⚠️ 免責事項
警告
教育目的の資料のみ
このプロジェクトは教育および研究目的のみで提供されています。スクリプトやツールは、個人アカウントで広範にテストされていません。
- ご自身の責任でご利用ください
- アカウントの制限や凍結について、当方は責任を負いません
- X/Twitter の利用規約を必ず遵守してください
- 少量から始め、慎重にテストしてください
X/Twitter 向け: このプロジェクトについて懸念がある場合や、機能の変更または削除をご希望の場合は、@nichxbt まで直接ご連絡ください。喜んで協力いたします。
謝辞: このプロジェクトは、X と xAI で進む革新に着想を得ています。X をあらゆる機能を備えたアプリにするという Elon Musk のビジョンと、Grok の AI へのアプローチに敬意を表します。XActions は、エコシステムを尊重しながら、開発者や研究者がプラットフォームの機能を探求できるよう支援することを目指しています。
🚀 クイックスタートの例
60秒で開始、アカウント不要
ほとんどの読み取り機能は、インストールした時点ですぐに使えます。X アカウント、API キー、ブラウザーは必要ありません。
npm install -g xactions
xactions doctor # what works right now, and why
xactions profile NASA # any public account
xactions analyze NASA # engagement rate, cadence, content mix, best hour
xactions tweets NASA --limit 50 --json | jq -r '.[].text'
次に、検索、フォロワー、フォロー中、いいね、ブックマーク、DM を利用するには、実際のブラウザーで一度ログインしてください。
xactions connect
xactions search "your topic" --limit 50
引数なしで xactions を実行すると、56個すべてのコマンドがタスク別に表示されます。xactions completion bash(または zsh、fish)を実行すると、タブ補完が有効になります。
例 1:フォロー返しをしていないアカウントのフォローを解除(30 秒)
ブラウザーコンソール:インストール不要です!
// Go to: x.com/YOUR_USERNAME/following
// Press F12 → Console → Paste this:
(() => {
const sleep = (s) => new Promise(r => setTimeout(r, s * 1000));
const run = async () => {
const buttons = [...document.querySelectorAll('[data-testid$="-unfollow"]')]
.filter(b => !b.closest('[data-testid="UserCell"]')
?.querySelector('[data-testid="userFollowIndicator"]'));
for (const btn of buttons) {
btn.click();
await sleep(1);
document.querySelector('[data-testid="confirmationSheetConfirm"]')?.click();
await sleep(2);
}
window.scrollTo(0, document.body.scrollHeight);
await sleep(2);
if (document.querySelectorAll('[data-testid$="-unfollow"]').length) run();
else console.log('✅ Done! Reload page to continue.');
};
run();
})();
CLI:
xactions login
xactions non-followers YOUR_USERNAME --output non-followers.json
Node.js:
import { createBrowser, createPage, scrapeFollowing } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const following = await scrapeFollowing(page, 'your_username', { limit: 500 });
const nonFollowers = following.filter(u => !u.followsBack);
console.log(`Found ${nonFollowers.length} non-followers`);
await browser.close();
💡 コードを書きたくない場合は? xactions.app をご利用ください。ログインしてクリックするだけです!
例 2:任意のプロフィールをスクレイピング
ブラウザーコンソール:
// Go to any profile on x.com, then run:
(() => {
const profile = {
name: document.querySelector('[data-testid="UserName"]')?.textContent?.split('@')[0]?.trim(),
username: location.pathname.slice(1),
bio: document.querySelector('[data-testid="UserDescription"]')?.textContent,
followers: document.querySelector('a[href$="/followers"] span')?.textContent,
following: document.querySelector('a[href$="/following"] span')?.textContent,
};
console.log(profile);
copy(JSON.stringify(profile, null, 2)); // Copies to clipboard!
})();
CLI:
xactions profile elonmusk --json
Node.js:
import { createBrowser, createPage, scrapeProfile } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const profile = await scrapeProfile(page, 'elonmusk');
console.log(profile);
// { name: 'Elon Musk', followers: '200M', bio: '...', ... }
await browser.close();
例 3:ツイートを検索してスクレイピング
ブラウザーコンソール:
// Go to: x.com/search?q=YOUR_KEYWORD&f=live
(() => {
const tweets = [...document.querySelectorAll('article[data-testid="tweet"]')]
.map(article => ({
text: article.querySelector('[data-testid="tweetText"]')?.textContent,
author: article.querySelector('[data-testid="User-Name"] a')?.href?.split('/')[3],
time: article.querySelector('time')?.getAttribute('datetime'),
}));
console.table(tweets);
copy(JSON.stringify(tweets, null, 2));
})();
CLI:
xactions search "AI startup" --limit 100 --output ai-tweets.json
Node.js:
import { createBrowser, createPage, searchTweets } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const tweets = await searchTweets(page, 'AI startup', { limit: 100 });
console.log(`Found ${tweets.length} tweets`);
await browser.close();
例 4:フォローを解除された相手を特定
ブラウザーコンソール:
// Go to: x.com/YOUR_USERNAME/followers
(() => {
const KEY = 'xactions_followers';
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
const scrape = async () => {
const users = new Set();
let retries = 0;
while (retries < 5) {
document.querySelectorAll('[data-testid="UserCell"] a')
.forEach(a => users.add(a.href.split('/')[3]?.toLowerCase()));
window.scrollTo(0, document.body.scrollHeight);
await sleep(1500);
retries++;
}
return [...users].filter(Boolean);
};
scrape().then(current => {
const saved = localStorage.getItem(KEY);
if (saved) {
const old = JSON.parse(saved);
const gone = old.filter(u => !current.includes(u));
console.log('🚨 Unfollowed you:', gone);
}
localStorage.setItem(KEY, JSON.stringify(current));
console.log(`💾 Saved ${current.length} followers`);
});
})();
CLI:
# First run saves snapshot
xactions followers YOUR_USERNAME --output snapshot1.json
# Later, compare
xactions followers YOUR_USERNAME --output snapshot2.json
# Use diff tools to compare
例 5:キーワードに基づいて投稿に自動で「いいね」する
ブラウザーコンソール:
// Go to: x.com/search?q=YOUR_KEYWORD&f=live
(async () => {
const sleep = (s) => new Promise(r => setTimeout(r, s * 1000));
const liked = new Set();
while (liked.size < 20) { // Like 20 posts
const buttons = [...document.querySelectorAll('[data-testid="like"]')]
.filter(b => !liked.has(b));
for (const btn of buttons.slice(0, 3)) {
btn.click();
liked.add(btn);
console.log(`❤️ Liked ${liked.size} posts`);
await sleep(3 + Math.random() * 2); // Random delay
}
window.scrollTo(0, document.body.scrollHeight);
await sleep(2);
}
console.log('✅ Done!');
})();
⚠️ ゆっくり進めてください! Twitter ではレート制限がかかる場合があります。ウェブサイト版ではこれを自動的に処理します。
例 6:すべてのコミュニティから退出
ブラウザーコンソール:
// Go to: x.com/YOUR_USERNAME/communities
(() => {
const $communityLinks = 'a[href^="/i/communities/"]';
const $joinedButton = 'button[aria-label^="Joined"]';
const $confirmButton = '[data-testid="confirmationSheetConfirm"]';
const $communitiesNav = 'a[aria-label="Communities"]';
const getLeftCommunities = () => {
try { return JSON.parse(sessionStorage.getItem('xactions_left_ids') || '[]'); }
catch { return []; }
};
const markAsLeft = (id) => {
const left = getLeftCommunities();
if (!left.includes(id)) {
left.push(id);
sessionStorage.setItem('xactions_left_ids', JSON.stringify(left));
}
};
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
const getCommunityId = () => {
const leftAlready = getLeftCommunities();
for (const link of document.querySelectorAll($communityLinks)) {
const match = link.href.match(/\/i\/communities\/(\d+)/);
if (match && !leftAlready.includes(match[1])) return { id: match[1], element: link };
}
return null;
};
const run = async () => {
console.log(`🚀 Left so far: ${getLeftCommunities().length}`);
await sleep(1500);
const joinedBtn = document.querySelector($joinedButton);
if (joinedBtn) {
const urlMatch = window.location.href.match(/\/i\/communities\/(\d+)/);
const currentId = urlMatch ? urlMatch[1] : null;
joinedBtn.click();
await sleep(1000);
const confirmBtn = document.querySelector($confirmButton);
if (confirmBtn) { confirmBtn.click(); if (currentId) markAsLeft(currentId); await sleep(1500); }
const communitiesLink = document.querySelector($communitiesNav);
if (communitiesLink) { communitiesLink.click(); await sleep(2500); return run(); }
}
const community = getCommunityId();
if (community) { community.element.click(); await sleep(2500); return run(); }
else { console.log(`🎉 DONE! Left ${getLeftCommunities().length} communities`); sessionStorage.removeItem('xactions_left_ids'); }
};
run();
})();
📖 詳細なドキュメント:docs/examples/leave-all-communities.md
📋 機能一覧
機能の対応状況
| 機能 | コンソールスクリプト | CLI | Node.js | ウェブサイト |
|---|---|---|---|---|
| スクレイピング | ||||
| プロフィールのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| フォロワーのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| フォロー中のアカウントのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| ツイートのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| ツイートの検索 | ✅ | ✅ | ✅ | ✅ |
| スレッドのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| ハッシュタグのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| メディアのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| リストメンバーのスクレイピング | ✅ | ✅ | ✅ | ✅ |
| 「いいね」のスクレイピング | ✅ | ✅ | ✅ | ✅ |
| フォロー解除 | ||||
| フォロー返しをしていないアカウントのフォローを解除 | ✅ | ✅ | ✅ | ✅ |
| すべてのアカウントのフォローを解除 | ✅ | ✅ | ✅ | ✅ |
| スマートフォロー解除(X 日後) | ⚠️ | ✅ | ✅ | ✅ |
| ログを記録しながらフォローを解除 | ✅ | ✅ | ✅ | ✅ |
| フォロー | ||||
| ユーザーをフォロー | ✅ | ✅ | ✅ | ✅ |
| キーワードに基づいてフォロー | ⚠️ | ✅ | ✅ | ✅ |
| エンゲージメントしたユーザーをフォロー | ⚠️ | ✅ | ✅ | ✅ |
| 対象アカウントのフォロワーをフォロー | ⚠️ | ✅ | ✅ | ✅ |
| エンゲージメント | ||||
| ツイートに「いいね」する | ✅ | ✅ | ✅ | ✅ |
| リツイート | ✅ | ✅ | ✅ | ✅ |
| 自動「いいね」 | ⚠️ | ✅ | ✅ | ✅ |
| 自動コメント | ⚠️ | ✅ | ✅ | ✅ |
| ツイートを投稿 | ✅ | ✅ | ✅ | ✅ |
| モニタリング | ||||
| フォロー解除したユーザーを検出 | ✅ | ✅ | ✅ | ✅ |
| 新しいフォロワーの通知 | ✅ | ✅ | ✅ | ✅ |
| 任意のアカウントをモニタリング | ✅ | ✅ | ✅ | ✅ |
| 継続的なモニタリング | ⚠️ | ✅ | ✅ | ✅ |
| コミュニティ | ||||
| すべてのコミュニティから退出 | ✅ | ⚠️ | ⚠️ | ⚠️ |
| スペース | ||||
| ライブスペースを検索 | ✅ | ✅ | ✅ | ✅ |
| スペースのメタデータをスクレイピング | ✅ | ✅ | ✅ | ✅ |
| AI エージェントがスペースに参加 | ❌ | ✅ | ✅ | ❌ |
| エージェントが聞いて話す | ❌ | ✅ | ✅ | ❌ |
| 高度な機能 | ||||
| 複数アカウント | ❌ | ✅ | ✅ | ✅ Pro |
| リンクスクレイパー | ✅ | ✅ | ✅ | ✅ |
| グローススイート | ❌ | ✅ | ✅ | ✅ Pro |
| カスタマーサービスボット | ❌ | ✅ | ✅ | ✅ Pro |
| MCP サーバー(AI エージェント) | ❌ | ✅ | ✅ | ❌ |
| CSV/JSON にエクスポート | ✅ | ✅ | ✅ | ✅ |
凡例: ✅ フルサポート | ⚠️ 基本/手動 | ❌ 利用不可
🤖 MCP サーバー(AI エージェント)
XActions には、X/Twitter 向けの最も包括的な無料 MCP サーバーが含まれています。Claude、Cursor、Windsurf、VS Code およびあらゆる MCP クライアントで動作します。
クイックセットアップ(30 秒)
Claude Desktop の設定(claude_desktop_config.json)に追加します:
{
"mcpServers": {
"xactions": {
"command": "npx",
"args": ["-y", "xactions-mcp"],
"env": {
"XACTIONS_SESSION_COOKIE": "your_auth_token_here"
}
}
}
}
auth_token の取得方法:x.com → DevTools(F12)→ Application → Cookies →
auth_tokenの値をコピー
または設定を自動生成します:
npx xactions mcp-config --client claude
npx xactions mcp-config --client cursor
npx xactions mcp-config --client windsurf
利用可能な MCP ツール (152)
| カテゴリ | ツール |
|---|---|
| スクレイピング | x_get_profile、x_get_followers、x_get_following、x_get_tweets、x_search_tweets、x_get_thread、x_download_video、x_get_replies、x_get_hashtag、x_get_likers、x_get_retweeters、x_get_media、x_get_mentions、x_get_quote_tweets、x_get_likes、x_get_recommendations |
| 分析 | x_detect_unfollowers、x_analyze_sentiment、x_best_time_to_post、x_competitor_analysis、x_brand_monitor、x_audience_insights、x_engagement_report、x_crypto_analyze |
| アクション | x_follow、x_unfollow、x_like、x_post_tweet、x_post_thread、x_reply、x_retweet、x_quote_tweet、x_bookmark、x_send_dm、x_create_poll、x_delete_tweet |
| 自動化 | x_auto_follow、x_follow_engagers、x_unfollow_all、x_smart_unfollow、x_auto_comment、x_auto_retweet、x_auto_like、x_engage、x_unfollow_non_followers |
| AI | x_analyze_voice、x_generate_tweet、x_summarize_thread、x_rewrite_tweet、x_detect_bots、x_find_influencers、x_smart_target、x_grok_analyze_image |
| 監視 | x_monitor_account、x_monitor_keyword、x_follower_alerts、x_track_engagement、x_monitor_reputation、x_stream_start |
| ワークフロー | x_workflow_create、x_workflow_run、x_workflow_list、x_workflow_actions |
| ペルソナ | x_persona_create、x_persona_run、x_persona_edit、x_persona_list、x_persona_presets |
| ポータビリティ | x_export_account、x_migrate_account、x_diff_exports、x_import_data、x_convert_format |
| スペース | x_get_spaces、x_scrape_space、x_space_join、x_space_leave、x_space_status、x_space_transcript |
| グラフ | x_graph_build、x_graph_analyze、x_graph_recommendations、x_graph_list |
| 下書き | x_list_drafts、x_approve_draft、x_discard_draft、x_draft_status |
すべてのツールは必ずいずれか 1 つのグループに属し、リストはフィルタリング可能なため、クライアントは そのセッションに必要なものだけを読み込みます:
npx xactions-mcp --tools read,analytics # advertise these groups only
npx xactions-mcp --exclude write,dm # or subtract from the full list
XACTIONS_MCP_TOOLS=read npx xactions-mcp # same thing through the environment
フィルタリングされたツールは公開もされず、呼び出すこともできません。グループをサイズの大きい順に示します:
read、analytics、write、monitoring、data、workflows、automation、
ai、persona、spaces、graph、drafts、dm、grok、lists、auth、
さらにサーバーがリモートモードで動作する場合は x402 です。
すべての書き込みを人の承認待ちにする
XACTIONS_MCP_REQUIRE_APPROVAL=1 npx xactions-mcp
投稿、削除、フォロー、ミュート、送信を行うすべてのツールは、実行される代わりに下書きとして保存されます。
x_list_drafts、x_approve_draft、x_discard_draft で承認または破棄するか、シェルから
xactions drafts list、xactions drafts approve <id>、xactions drafts discard <id> で操作できます。
このゲートとは別に、すべての書き込みは ~/.xactions 配下のファイルで管理される
アカウントごとのローリング 24 時間上限に対して課金されるため、再起動後も維持され、
この上限を超える呼び出しが X に到達することはありません。
HTTP 経由でサーバーを実行する
npx xactions-mcp --http --port 3000 # Streamable HTTP on /mcp
stdio がデフォルトであり、ローカルクライアントが求めるものです。--http (または
MCP_TRANSPORT=http) はリモートおよびホスト型クライアント向けです。これに
Authorization: Bearer <token> を要求させるには XACTIONS_MCP_TOKEN を設定します。
設定ファイルなしで Claude Desktop にインストールする
.mcpb バンドルにはサーバーとその依存関係が含まれており、インストール時に
セッション Cookie とツールグループの入力を求めます。最新リリース
からダウンロードし、Claude Desktop > Settings > Extensions にドラッグしてください。
プロンプトの例
「@paulg の文体を分析して、その人らしい口調でスタートアップに関するツイートのアイデアを3つ生成して」 → ツイートをスクレイピング → 文体を分析 → AI でコンテンツを生成
「フォローしている人のうち、フォローバックしていない人をフォロワー数順に表示して」 → x_get_following と x_get_followers を使用 → 差分を計算 → 結果を整形
「@openai、@anthropic、@google のエンゲージメント指標を比較して」 → プロフィールと最近のツイートをスクレイピング → 平均エンゲージメントを計算 → 比較結果を表示
📖 完全なセットアップガイド:docs/mcp-setup.md
🎙️ 自律型スペースエージェント
AI エージェントはライブの X スペースに参加し、会話を聞き、音声 AI を使って自律的に発言できます。xspace-agent SDK を利用しています。
できること
- ヘッドレスブラウザーを起動して X スペースに参加します
- 他の話者の発言をリアルタイムで文字起こしします(Whisper STT)
- 選択した LLM(OpenAI、Claude、または Groq)で適切な応答を生成します
- テキスト読み上げ(ElevenLabs、OpenAI、またはブラウザー)でスペース内に応答を発話します
- 発言の順番、コンテキストの追跡、正常なシャットダウンを処理します
セットアップ
npm install xactions xspace-agent
認証情報を設定します:
export X_AUTH_TOKEN="your_auth_token" # From x.com cookies
export X_CT0="your_ct0_token" # From x.com cookies
export OPENAI_API_KEY="sk-..." # Or ANTHROPIC_API_KEY / GROQ_API_KEY
使用方法
MCP(Claude Desktop / Cursor):
「このスペースに AI エージェントとして参加して:https://x.com/i/spaces/1abc123」
Claude が x_space_join を呼び出すと、エージェントがスペースに参加します。
Node.js:
import { joinSpace, leaveSpace } from 'xactions/spaces/agent';
await joinSpace({
url: 'https://x.com/i/spaces/1abc123',
provider: 'openai',
systemPrompt: 'You are a helpful AI participant. Keep responses concise.',
});
// Later...
const summary = await leaveSpace();
// { duration: '300s', transcriptions: 42, responses: 8 }
MCP ツール:
| ツール | 説明 |
|---|---|
x_space_join | 自律型 AI 音声エージェントとしてスペースに参加します |
x_space_leave | アクティブなスペースから退出し、セッションの概要を取得します |
x_space_status | エージェントの状態(経過時間、文字起こし数/応答数)を取得します |
x_space_transcript | アクティブなスペースの最近の文字起こしを取得します |
📖 完全なガイド:docs/spaces-agent.md:設定、環境変数、イベント、マルチエージェントのセットアップ、使用例。
💻 CLI リファレンス
タスク別にグループ化された56個のコマンドと、その配下にある85個のサブコマンドがあります。引数なしで xactions を実行するとグループ一覧が表示されます。特定のコマンドについては xactions help <command> を実行してください。xactions completion bash|zsh|fish を実行すると、現在のコマンドツリーから生成されたタブ補完を利用できます。
ここから始める quickstart doctor connect login logout mcp-config skills drafts info
xactions quickstart # guided first run, adapts to what you already have
xactions doctor # what works right now, and what each failure needs
xactions connect # log in through a real browser, no DevTools
xactions login --from-browser chrome # or read cookies from an installed browser
xactions login --cookies-file cookies.txt # or import a cookie export
xactions skills install --all # 50 agent skills into Claude Code, Cursor, Codex, Windsurf
xactions drafts list # MCP writes waiting for your approval
アカウントを読み取る(ログイン不要) profile tweets thread media analyze report history snapshot
xactions profile NASA
xactions tweets NASA --limit 50 --output nasa.csv
xactions thread https://x.com/NASA/status/1234567890
xactions media NASA --limit 30
xactions analyze NASA SpaceX # engagement rate, cadence, content mix, best hour
フォロワーとオーディエンス followers following non-followers audience crm graph
xactions followers YOUR_USERNAME --limit 1000 --output followers.json
xactions non-followers YOUR_USERNAME # who does not follow back
xactions audience nasa spacex # follower overlap between two accounts
xactions graph build nasa # build and analyse a social graph
検索とモニタリング search hashtag scrape platforms monitor sentiment rss stream
xactions search "your brand" --filter latest --limit 50
xactions hashtag ai --limit 50
xactions monitor yourbrand # sentiment over time
xactions stream start tweet nasa # tweet, follower or mention streams
執筆と成長 engage ai optimize hashtags predict variations evergreen persona schedule bulk
xactions engage USERNAME --like --repost --comment --prompt "supportive, one honest question"
xactions ai generate "shipping fast" --voice nichxbt
xactions evergreen YOUR_USERNAME # find and recycle top performers
xactions persona run my-persona
自動化 workflow agent notify plugin team dataset
xactions workflow run daily-digest
xactions notify test slack
データの移動 export export-data archive import convert migrate diff
xactions export YOUR_USERNAME # profile, tweets, followers, following, bookmarks
xactions archive summary ~/Downloads/twitter-archive.zip
xactions archive migrate ~/Downloads/twitter-archive.zip --to bluesky --execute
xactions diff exports/january exports/february
低レベル client
xactions client profile nasa # the raw HTTP client, no browser at all
エージェントとパイプ向けの出力フラグ
すべての読み取りコマンドでグローバルに使用できます:
xactions profile NASA --compact # one record per line, key=value
xactions tweets NASA --limit 200 --fields id,likes,text --compact
xactions tweets NASA --limit 200 --json | jq 'sort_by(-.likes) | .[:5]'
--compact は、色やスピナーを使わず、タブ区切りの key=value ペアを出力します。
--fields を指定すると、指定した列だけを指定した順序で出力できます。
--json は構造化オブジェクト全体を出力し、--output より優先されるため、パイプが意図せずファイルへの書き込みに変わることはありません。--compact と --json の両方を指定した場合は、--compact が優先されます。
公開データの読み取りはアカウントなしで行えます:profile、tweets、thread、media、analyze、hashtag。検索、followers、following、non-followers、いいね、ブックマーク、DM にはセッションが必要です。完全なリファレンス:
docs/cli-reference.md。
📚 Node.js API
クイックスタート
import {
createBrowser,
createPage,
loginWithCookie,
scrapeProfile,
scrapeFollowers,
scrapeFollowing,
scrapeTweets,
searchTweets,
exportToJSON,
exportToCSV
} from 'xactions';
// Initialize
const browser = await createBrowser({ headless: true });
const page = await createPage(browser);
// Optional: Login for private data
await loginWithCookie(page, 'your_auth_token_cookie');
// Scrape profile
const profile = await scrapeProfile(page, 'elonmusk');
// Scrape followers with progress
const followers = await scrapeFollowers(page, 'elonmusk', {
limit: 1000,
onProgress: ({ scraped, limit }) => console.log(`${scraped}/${limit}`)
});
// Export data
await exportToJSON(followers, 'followers.json');
await exportToCSV(followers, 'followers.csv');
await browser.close();
すべてのスクレイパー関数
// Profile
scrapeProfile(page, username)
// Followers & Following
scrapeFollowers(page, username, { limit, onProgress })
scrapeFollowing(page, username, { limit, onProgress })
// Tweets
scrapeTweets(page, username, { limit, includeReplies, onProgress })
searchTweets(page, query, { limit, filter: 'latest'|'top' })
scrapeThread(page, tweetUrl)
scrapeHashtag(page, hashtag, { limit, filter })
// Media
scrapeMedia(page, username, { limit })
scrapeLikes(page, tweetUrl, { limit })
// Lists
scrapeListMembers(page, listUrl, { limit })
// Export
exportToJSON(data, filename)
exportToCSV(data, filename)
🌐 コーディングしたくない方へ
ノーコードソリューションについては、xactions.appをご覧ください
ブラウザスクリプトを使う · コンソールスクリプトをコピー&ペーストする · チュートリアルを見る
完全無料です。 API キー不要、支払い不要、利用制限もありません。
🔒 安全性とベストプラクティス
|
レート制限:1~3秒の遅延、人間のようなスクロール、レート制限時の自動一時停止を組み込み済みです |
|
認証トークン: |
注意
推奨事項: 2~5秒の遅延を設定する · 自動操作と手動操作を組み合わせる · 少量のバッチでテストする
避けること: 1日に何千人も一括フォローする · 24時間365日実行する · コメントをスパム投稿する
🛠️ 使用技術
📁 プロジェクト構成
トップレベルのディレクトリをすべて示しているため、ここに意外なものはありません。
src/ The library. cli/ mcp/ scrapers/ client/ automation/ agents/
analytics/ streaming/ workflows/ plugins/ portability/ graph/
a2a/ spaces/ ai/ auth/ scheduler/ notifications/, plus the
browser console scripts that sit at the top level
api/ Express REST API: routes/ services/ middleware/ realtime/
bin/ Legacy command name (unfollowx), forwards to the CLI
packages/ xactions-mcp, the thin MCP wrapper published to npm
skills/ 50 Agent Skills, one directory each
extension/ Chrome and Edge extension (Manifest V3)
integrations/ Third-party glue (n8n and friends)
worker/ Cloudflare Worker entry point
functions/ Cloudflare Pages Functions for the /api/* edge surface
site/ The marketing landing page served at /
dashboard/ The signed-in app shell at /dashboard, plus the generated
docs, guides, skills and script pages the site serves
public/ Static assets: OG images, robots.txt, sitemap
playground/ Standalone in-browser playground
docs/ Documentation source (Markdown)
tutorials/ Guided walkthroughs
examples/ Runnable programs, from a profile lookup to the MCP draft gate
prompts/ Prompt library for coding agents
tests/ Vitest suite
scripts/ The 95 browser console scripts, plus build, docs and
maintenance tooling. twitter/ holds standalone console variants
config/ Agent, niche and persona configuration
prisma/ Database schema and migrations
deploy/ Cloudflare and GCP deployment assets
types/ TypeScript declarations
data/ Runtime output (gitignored, keeps a .gitkeep)
archive/ Retired code, kept for reference. Do not modify
python/ xeepy, the Python twin of the library
xspace-agents/ The Spaces agent monorepo
python/とxspace-agents/は、このリポジトリ内にありながら、それぞれ独立してビルドされる自己完結型プロジェクトです。こちらではなく、それぞれのREADMEから始めてください。
🤝 コントリビューション
コントリビューションを歓迎します。CONTRIBUTING.mdと、リポジトリの構成および3つの実行コンテキストをまとめたAGENTS.mdをご覧ください。
git clone https://github.com/nirholas/xactions.git
cd xactions && npm install
npm run cli -- profile elonmusk # run the CLI from the source tree
npm run mcp # run the MCP server
Node.js 22.12以降が必要です(engines.nodeは>=22.12です)。CIでは22と24でテストスイートを実行します。PRを作成する前に、次の3つのコマンドを実行してください。いずれもCIで実行されます。
npm test # the whole suite, offline, under a minute
npm run lint # ESLint over the repo
npm run docs:check # dead links, stale counts, invented CLI commands
コントリビューター
コード、バグ報告、調査を通じてXActionsの改善に貢献してくださった皆さんに感謝します。@RandyLu87、@ni3a、@nelsongallardo、@azeezalhajj570-ai、@stone-w4tch3r、@avner-assistantをはじめ、多くの方にご協力いただきました。各人が発見・構築した内容を含む全リストは、CONTRIBUTORS.mdにあります。明確なバグ報告も、マージされたPRと同じように、ここに掲載されます。
⭐ スター履歴
XActionsのおかげでTwitter APIの月額100ドルの支払いを避けられたなら、リポジトリにスターを付けてください。それがオープンソースの成長につながります。
📚 チュートリアルライブラリ全編
XActionsは完全無料のオープンソースです。 インタラクティブなチュートリアルについては、xactions.appをご覧ください。
🚀 ワンクリックスクリプトランナー
新機能! コーディングの知識がなくてもスクリプトを実行できます。
- xactions.app/run.htmlにアクセスする
- 青いボタンをブックマークバーにドラッグする
- x.comにアクセスしてブックマークレットをクリックする
コンソールも、コードも、セットアップも不要です!
カテゴリ別クイックリンク
| カテゴリ | スクリプト | チュートリアル |
|---|---|---|
| フォロー解除 | 全員のフォロー解除、フォローバックしていないユーザーのフォロー解除、スマートフォロー解除 | チュートリアル |
| 自動化 | 自動いいね、自動コメント、エンゲージしたユーザーをフォロー | チュートリアル |
| スクレイピング | 動画のダウンロード、フォロワー、ツイート、ハッシュタグ | チュートリアル |
| モニタリング | フォロー解除の検出、アカウントの追跡、アラート | チュートリアル |
| コミュニティ | すべてのコミュニティから退出 | チュートリアル |
| AI/MCP | Claude Desktop、GPT 連携 | チュートリアル |
ドキュメント一覧
ドキュメントの例(完全なコード)
| 機能 | ドキュメント |
|---|---|
| 全員のフォロー解除 | unfollow-everyone.md |
| フォローバックしていないユーザーのフォロー解除 | unfollow-non-followers.md |
| フォロー解除の検出 | detect-unfollowers.md |
| 自動いいね | auto-liker.md |
| 自動コメント | auto-commenter.md |
| エンゲージしたユーザーをフォロー | follow-engagers.md |
| 動画ダウンローダー | video-downloader.md |
| フォロワーのスクレイピング | followers-scraping.md |
| ツイートのスクレイピング | tweet-scraping.md |
| コミュニティから退出 | leave-all-communities.md |
| MCP サーバー | mcp-server.md |
| アカウントのモニタリング | monitor-account.md |
| 新規フォロワーのアラート | new-follower-alerts.md |
⚡ XActions、X/Twitter 向けの完全な自動化ツールキット
100% 無料・オープンソース · Apache 2.0 ライセンス
xactions.app ·
GitHub ·
@nichxbt
🌐 MCP サーバーを HTTP 経由で実行する
stdio はデフォルトのトランスポートであり、ローカルクライアントで使用します。リモートクライアントまたはホスト型クライアント向けには、同じサーバーが /mcp で
MCP Streamable HTTP
を使用し、同じ 154 個のツールと同じツールグループのフィルタリングを提供します。
npx xactions-mcp --http --port 3000
# or: MCP_TRANSPORT=http PORT=3000 npx xactions-mcp
XACTIONS_MCP_TOKEN を設定してトークンを必須にします。クライアントは
Authorization: Bearer <token> を送信します。
任意の MCP クライアントから接続する
{
"mcpServers": {
"xactions": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}
シェルから確認する
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
公開環境にデプロイする場合は、XACTIONS_MCP_TOKEN を設定して TLS の背後で実行し、
すべてのツールではなく、絞り込んだツールセット(--tools read,analytics)を使用してください。
Dockerfile と docs/deployment.md では、
Railway、Fly.io、Docker、Cloudflare へのデプロイ方法を説明しています。
🏆 完全比較マトリクス
すべての代替製品を対象とした、機能ごとの詳細な比較です。
| 機能 | XActions | twikit | twscrape | x-use | xmcp (official) | bird | twitter-cli | Agent-Reach |
|---|---|---|---|---|---|---|---|---|
| Node.js ライブラリ | ✅ | ❌ Python | ❌ Python | ✅ | ✅ | ✅ | ❌ Python | ❌ Python |
| ワークフローエンジン | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| センチメント分析 | ✅ 組み込み | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| リアルタイムストリーミング | ✅ ポーリングストリーム + x.com のライブイベントパイプライン | ✅ live_pipeline | ❌ | ❌ | ✅ API のみ | ❌ | ❌ | ❌ |
| アカウントのエクスポート/移行 | ✅ JSON/CSV/HTML、および X の公式アーカイブ ZIP | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| ダッシュボード(ノーコード) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Grok AI 連携 | ✅ | ✅ 別パッケージ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Docker 対応 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| TypeScript 型定義 | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
| MCP ツールの許可リスト | ✅ 17 グループ | 該当なし | 該当なし | ❌ | ✅ | 該当なし | 該当なし | 該当なし |
| Streamable HTTP 経由の MCP | ✅ /mcp で --http | 該当なし | 該当なし | ❌ | ✅ | 該当なし | 該当なし | 該当なし |
| 署名付き送信 Webhook | ✅ HMAC-SHA256、再試行、リプレイ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Claude チュートリアル | ✅ 23 個のプロンプト | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| マルチプラットフォーム(X + その他) | ✅ Bluesky、Mastodon、Threads | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| 費用 | 無料 | 無料 | 無料 | 無料 | 無料 + X API プラン | 無料 | 無料 + X API プラン | 無料 |
比較内容は、執筆時点(2026 年 8 月)で各プロジェクトの公開 README に基づいています。内容が古い列があれば、issue を作成してください。
ドキュメント
ドキュメントサイト全文はこちらです:https://nirholas.github.io/XActions/
プロジェクトを支援する
XActions が時間の節約に役立ったら、GitHub でスターを付けてください。スターがあると、ほかの開発者や AI エージェントが信頼できるリポジトリを見つけやすくなります。クリック 1 回で応援できます。
活用してくれそうな人を知っていますか? X に投稿 · Bluesky で共有 · LinkedIn で共有 · Hacker News に投稿 · Reddit で共有
AI エージェントにも対応
コーディングエージェントや LLM ツールから、このリポジトリを直接読み取れます:AGENTS.md、llms.txt、llms-full.txt。エージェントに https://github.com/nirholas/XActions を指定すれば、必要なコンテキストを取得できます。
同じ作者によるその他のプロジェクト
- nirholas のすべてのリポジトリ:トピック別に分類された全カタログ
- three.ws:Solana ウォレット、スキルマーケットプレイス、x402 決済に対応した 3D AI エージェント向けプラットフォーム
- 質問やアイデア:issue を作成するか、ディスカッションを始めてください
Contributors
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。