Use this Twitter CLI & X CLI to work with X from a terminal. It works as a Twitter scraper & tweet scraper for search, profiles, followers & lists. Scrape Twitter timelines, communities & trends into JSON, YAML or an interactive view. Download media, monitor accounts, manage webhooks & run X automation from scripts. It is a Twitter API alternative built on the Xquik REST API.
Xquik is the world's fastest and cheapest X Twitter scraper service with the most complete X data. Xquik charges only for delivered, unique, filter-matching results and never pads rows.
Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.
- 51,000+ downloads of Xquik's Twitter API packages on npm, PyPI, RubyGems, NuGet, Packagist & Terraform (source)
- 7,800+ users of Xquik's Twitter scraper Actors on Apify (source)
- 5,700,000+ runs of Xquik's Twitter scraper Actors on Apify (source)
- 4.66 of 5 for the X Tweet Scraper from 16 Apify reviews (source)
- 3,900+ accounts on xquik.com (source)
- 1,600+ installs of Xquik's Twitter Skills on skills.sh (source)
- $38,000+ in revenue verified by TrustMRR (source)
- 501 ms median REST API read time over the last 7 days (source)
- 370+ GitHub stars across Xquik's repos (source)
- 67 downloads of x-twitter-scraper-cli on GitHub Releases (source)
- This repo meets the OpenSSF Best Practices passing criteria (source)
Checked on 2026-10-15. See each number with its date & source on xquik.com/trust or as JSON.
Install Node.js 18 or later.
npm install --global x-twitter-scraper-cliOr run the CLI once without installing it.
npx x-twitter-scraper-cli --helpnpm installs only the build for your platform. Nothing downloads when the CLI runs.
Install Go 1.21 or later. Go downloads the toolchain this CLI needs.
go install 'github.com/Xquik-dev/x-twitter-scraper-cli/cmd/x-twitter-scraper@latest'Go writes the binary to $GOBIN or $(go env GOPATH)/bin.
If the command is unavailable, add that directory to PATH.
export PATH="$PATH:$(go env GOPATH)/bin"Each GitHub release has archives for macOS, Linux & Windows.
Linux users can also pick a .deb, .rpm, .apk or Arch Linux package.
Compare each download with the release's checksums file.
From a cloned repository, run ./scripts/run args... instead.
The CLI follows a resource-based command structure.
x-twitter-scraper [resource] <command> [flags...]This command returns 10 recent posts from 1 account.
x-twitter-scraper x:tweets search \
--q from:elonmusk \
--limit 10Run each command with --help before adding flags.
| Task | Start command |
|---|---|
| Search tweets | x-twitter-scraper x:tweets search --help |
| Get a user's posts | x-twitter-scraper x:users retrieve-tweets --help |
| Scrape Twitter followers | x-twitter-scraper x:users retrieve-followers --help |
| Scrape following accounts | x-twitter-scraper x:users retrieve-following --help |
| Read a home timeline | x-twitter-scraper x get-home-timeline --help |
| Export a large dataset | x-twitter-scraper extractions estimate-cost --help |
| Monitor an account | x-twitter-scraper monitors create --help |
| Post or reply | x-twitter-scraper x:tweets create --help |
| Environment variable | Description | Required | Default value |
|---|---|---|---|
X_TWITTER_SCRAPER_API_KEY |
Xquik API key | no | null |
X_TWITTER_SCRAPER_BEARER_TOKEN |
OAuth 2.1 access token | no | null |
--api-keysets the Xquik API key.--bearer-tokensets an OAuth 2.1 access token.--helpshows command-line usage.--debugadds HTTP request & response details to logs.--versionor-vshows the CLI version.--base-urlsends requests to another API base URL.--formatsets the output format.--format-errorsets the error format.--transformfilters output with GJSON syntax.--transform-errorfilters errors with GJSON syntax.--raw-outputor-rprints a string result without JSON quotes.
Credential flags also read their matching environment variables. Debug logs may contain private response data. Do not share them.
Prefix a path with @ to send its contents.
x-twitter-scraper <command> --arg @abe.jpgUse file references inside JSON or YAML.
x-twitter-scraper <command> --arg '{image: "@abe.jpg"}'
# The same input as YAML.
x-twitter-scraper <command> <<YAML
arg:
image: "@abe.jpg"
YAMLEscape a leading @ when sending a literal value.
x-twitter-scraper <command> --username '\@abe'JSON endpoints detect text and binary files.
Use @file:// for text, @data:// for base64, and 3 slashes for absolute paths.
x-twitter-scraper <command> --arg @data://file.txtPass a module version or local path to ./scripts/link.
./scripts/link github.com/org/repo@version
./scripts/link ../path/to/xtwitterscraper-goThe script defaults to ../x-twitter-scraper-go.
Run bin/check-local before you open a pull request.
It runs REUSE, lint, script tests, Go tests, coverage, govulncheck, 2 reproducible builds, fuzzing & CodeQL.
It posts the result as the xquik-local-checks commit status.
Maintainers publish releases from main with bin/release-local.
bin/release-local --dry-run builds every release asset and publishes nothing.
After the GitHub release, bin/release-local runs bin/release-npm.
It publishes the x-twitter-scraper-cli package and 1 package per platform.
bin/release-npm --dry-run packs them from the published release and publishes nothing.
- X (Twitter) scraper API & Twitter MCP server with REST, MCP & Skill setup.
- Twitter API SDKs for TypeScript, Python, Go, Ruby, Java, Kotlin, C# & PHP.
- Twitter advanced search operators with tested examples.
- Xquik X API & Twitter scraper and the Twitter API documentation.
Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.