| name | x-api-scraper-cli |
|---|---|
| description | Use this skill when the task should be done through the x-api-scraper command-line client, including installing the CLI, configuring an API key, previewing requests, and fetching Twitter/X data through convenience commands or raw paths. |
Use this skill when the task should be completed by running x-api-scraper commands instead of re-implementing request logic by hand.
Public docs for this skill focus on API-key read workflows: fetch, search, profile, and timeline.
- the user wants to install or run the
x-api-scraperCLI - the user wants to configure an API key / app config
- the user wants to test or inspect requests with
--dry-run - the user wants to call supported Twitter/X read commands for users, tweets, articles lookup, profile, timeline, global trending tweets, search, followers, following, or lists
- the user knows an endpoint path and wants to call it through the generic
x-api-scraper <path>form
Do not treat this skill as the main interface when the task is to edit the CLI source code itself.
- Confirm the CLI is available.
- Make sure an app config or API key is available.
- Prefer convenience read commands first.
- Fall back to
x-api-scraper <path>only when no convenience command fits. - Use
--dry-runto preview request construction when helpful.
For normal users, prefer the published npm package:
npm install -g @twexapi-dev/x-api-scraper-cli
x-api-scraper --helpWhen working from this repository:
node ./bin/x-api-scraper.js --helpIf a local executable is needed while developing:
npm link
x-api-scraper --helpRequires Node.js 18 or newer.
- API keys come from
https://twexapi.io/dashboard. - For one-off commands,
X_API_SCRAPER_KEYor--api-keyis acceptable. - The CLI also respects
X_API_SCRAPER_BASE_URLandX_API_SCRAPER_CONFIG_DIR. - For repeated usage, prefer saved app configs with
auth apps add. - By default the CLI reads and writes persistent config in
~/.x-api-scraper/config.json. - Saved app configs may include API keys in plain JSON.
- On shared machines or CI, prefer
--config-dirorX_API_SCRAPER_CONFIG_DIRto isolate credentials.
App setup:
x-api-scraper auth apps add --name prod --api-key "twitterx_..."
x-api-scraper auth apps use prodInspect config:
x-api-scraper config show
x-api-scraper config pathPrefer convenience read commands such as:
x-api-scraper --app prod about elonmusk
x-api-scraper --app prod users elonmusk sama
x-api-scraper --app prod search users "openai" --count 20
x-api-scraper --app prod trending tweets --country "United States" --topic "Sports" --count 50
x-api-scraper --app prod timeline user elonmusk
x-api-scraper --app prod tweet lookup 1900000000000000000 --summaryUse the generic path form when the endpoint is known but not wrapped:
x-api-scraper /twitter/elonmusk/about
x-api-scraper -X POST -d '["elonmusk","sama"]' /twitter/users- Put global options such as
--app,--api-key, and--dry-runbefore the command. - Prefer read workflows documented here; do not treat account-session write flows as the default path.
- The CLI masks secrets in config output and dry-run previews, but still avoid echoing raw credentials back to the user.
Use an isolated config directory for local testing:
x-api-scraper --config-dir ./.x-api-scraper-local config showRecommended order:
- Verify the CLI starts with
x-api-scraper --helpornode ./bin/x-api-scraper.js --help. - Verify a read command such as
aboutorusers. - Verify a raw-path request if needed.