Skip to content

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

X API & Twitter API CLI by Xquik

OpenSSF Best Practices

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.

Trust & usage

Twitter API package downloads Twitter scraper users on Apify Twitter scraper runs on Apify Tweet scraper rating on Apify Xquik Twitter API accounts Twitter Skill installs Xquik verified revenue on TrustMRR Twitter API median response time Xquik GitHub stars x-twitter-scraper-cli downloads on GitHub Releases OpenSSF Best Practices

  • 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.

Installation

Install with npm

Install Node.js 18 or later.

npm install --global x-twitter-scraper-cli

Or run the CLI once without installing it.

npx x-twitter-scraper-cli --help

npm installs only the build for your platform. Nothing downloads when the CLI runs.

Install with Go

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"

Download a release

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.

Usage

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 10

Common commands

Run 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 variables

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

Global flags

  • --api-key sets the Xquik API key.
  • --bearer-token sets an OAuth 2.1 access token.
  • --help shows command-line usage.
  • --debug adds HTTP request & response details to logs.
  • --version or -v shows the CLI version.
  • --base-url sends requests to another API base URL.
  • --format sets the output format.
  • --format-error sets the error format.
  • --transform filters output with GJSON syntax.
  • --transform-error filters errors with GJSON syntax.
  • --raw-output or -r prints 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.

Passing files as arguments

Prefix a path with @ to send its contents.

x-twitter-scraper <command> --arg @abe.jpg

Use 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"
YAML

Escape 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.txt

Test another Go SDK version

Pass a module version or local path to ./scripts/link.

./scripts/link github.com/org/repo@version
./scripts/link ../path/to/xtwitterscraper-go

The script defaults to ../x-twitter-scraper-go.

Checks & releases

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.

More Xquik tools

Support & policies

Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.

Releases

Packages

Contributors

Languages