コンテンツにスキップ
Twexapi
日本語
Esc
移動開く⌘Jプレビュー
このページの内容

CLI

TwexAPI CLI でツイート検索、フォロワーエクスポート、DM、X Articles、ターミナル X API 自動化。

アプリケーションコードなしで、決定的なターミナルコマンド、JSON 出力、dry-run プレビュー、保存済み認証プロファイルが欲しいときに CLI を使いましょう。

CLI タスク 実行コマンド 保存先
Search tweets x-api-scraper search tweets cursor
Read profile x-api-scraper about screen_name
List followers x-api-scraper followers cursor

インストール

npm install -g @twexapi-dev/x-api-scraper-cli
x-api-scraper --help

Node.js 18 以上が必要です。

Source: twexapi-dev/x-api-scraper-cli

認証

TwexAPI dashboard から API キーを取得。

export X_API_SCRAPER_KEY="YOUR_API_KEY"

x-api-scraper auth apps add --name prod --api-key "YOUR_API_KEY"
x-api-scraper auth apps use prod
x-api-scraper --app prod about elonmusk

基本例

# Lookup users
x-api-scraper --app prod users elonmusk sama

# Search tweets
x-api-scraper --app prod search tweets "founder" "ai" --sort Latest

# List followers (v3)
x-api-scraper --app prod followers elonmusk

# Global trending tweets
x-api-scraper --app prod trending tweets --country "United States" --topic "Sports" --count 50

生 API リクエスト

任意の TwexAPI パスを直接呼び出し:

x-api-scraper --app prod /twitter/elonmusk/about
x-api-scraper --app prod -X POST -d '["elonmusk","sama"]' /twitter/users

スキルとして利用

GitHub スキルインストーラーから:

npx skills add twexapi-dev/x-api-scraper-cli

ClawHub から:

npx clawhub@latest install x-api-scraper-cli

セキュリティ注意

  • CLI は環境変数 X_API_SCRAPER_KEYX_API_SCRAPER_BASE_URLX_API_SCRAPER_CONFIG_DIR を読み取ります。
  • 保存アプリ設定とプロファイルはデフォルトで ~/.x-api-scraper/config.json の平文 JSON。
  • エージェントワークフローでは書き込み前に必ず --dry-run

参考

このページは役に立ちましたか?