Skip to content
OSINTtools.io

twscrape

Verified yesterday

Python library and CLI that pulls X/Twitter search results, profiles, followers and tweets through your own pool of accounts.

Python CLI · library · Open source · Social media intelligence · github.com

Takes
Username
Pricing
Free, open source
Footprint
Passive · no contact with target
Account
Needed for full results
API
No public API
Last verified
Nov 27, 2026
Summary

Python library and CLI that pulls X/Twitter search results, profiles, followers and tweets through your own pool of accounts. It takes username. Read the cons before you build a workflow on it.

What it does

twscrape is an asynchronous Python library and command-line tool for X/Twitter's search and GraphQL endpoints. It runs on accounts you add yourself, usually from browser cookies, stores their sessions in a local SQLite database and switches between them when one hits a rate limit. Results come back as parsed models compatible with the old snscrape format or as raw API responses.

Researchers use it to collect tweets matching an advanced search query, to pull a user's profile, timeline, followers or following list, and to gather replies or retweeters of a post for network analysis. Because the official X API is costly, it is one of the more common ways to get X data into a notebook or database for a study.

Footprint is passive: it reads its own index or third-party records and does not contact the target. An account is needed for full results. There is no public API.

Pros
  • +Free and actively maintained
  • +Works from the command line or as a Python library
  • +Handles rate limits by rotating accounts
  • +Output fits existing snscrape-based workflows
Cons
  • −Needs one or more logged-in X accounts, which X's terms discourage
  • −Breaks whenever X changes its internal API
  • −Accounts used for scraping can be suspended

When to use it

  1. 01Use it when you need to collect a large set of tweets for a search query or hashtag.
  2. 02Use it when you want to map the followers or retweeters of an account for network analysis.
Key featuresAdvanced search queriesUser profiles, timelines, followers and followingTweet details, replies and retweetersMulti-account rotation on rate limitsCookie-based account setupRaw or parsed JSON output

Next steps from this result

Suggested from the inputs twscrape takes
  • Found a resultConfirm it with a second, independent source before you record it
  • Found a new identifierPivot on it only if your scope covers the new target
    Depends

Quick start

Install with pip
pip install twscrape
twscrape add_cookie my_account
twscrape search "from:xdevelopers lang:en" --limit=20

Technical details

Listing verified by an editor on Nov 27, 2026
API
No public API
Account
Needed for full results
Footprint
Passive · no contact with target
Pricing
Free, open source
Platforms
Python CLI · library
Repository
vladkens/twscrape 3,001 stars
Language
Python
Licence
MIT
Last commit
Nov 2026
Listed
Nov 27

Reviews

No reviews yet

Written by signed-in members. Each review appears here after an editor has read it.

Used twscrape? Sign in to say what you used it for and how it went.

Sign in to review

Alternatives to twscrape

Listed tools that take the same inputs, closest match first.

twscrapeOpen source · verified yesterday
Visit github.com (opens in new tab)