# twscrape

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

Source: https://osinttools.io/tools/twscrape/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

- **Inputs:** Username
- **Category:** Social media intelligence
- **Pricing:** Free, open source
- **Footprint:** passive (does not contact the target)
- **Account required:** yes, for full results
- **API:** no public API
- **Platforms:** Python CLI · library
- **Website:** https://github.com/vladkens/twscrape
- **GitHub:** vladkens/twscrape, 3,001 stars · Python · MIT · last commit 2026-11-23
- **Listed:** Nov 27
- **Last verified by an editor:** Nov 27, 2026

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

## Features

- Advanced search queries
- User profiles, timelines, followers and following
- Tweet details, replies and retweeters
- Multi-account rotation on rate limits
- Cookie-based account setup
- Raw or parsed JSON output

## 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

- Use it when you need to collect a large set of tweets for a search query or hashtag.
- Use it when you want to map the followers or retweeters of an account for network analysis.

## Quick start

Install with pip:

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

## Alternatives

- [Sherlock](https://osinttools.io/tools/sherlock/): Command-line tool that checks hundreds of websites for an account with a given username. (Open source · Username · active · 118,238 GitHub stars)
- [BskyFollowFinder](https://osinttools.io/tools/bsky-follow-finder/): Lists Bluesky accounts that many of a profile's followed accounts follow, but the profile itself does not. (Free · Username · active)
- [ChatCrawler](https://osinttools.io/tools/chatcrawler/): Search engine for public Telegram that shows a username's history and which open groups and channels an author posted in. (Free · Username · passive)
- [Combot Telegram Rankings](https://osinttools.io/tools/combot-telegram-top/): Ranked directory of public Telegram groups and channels from Combot, filterable by language, with member counts. (Free · Username · passive)
- [Exolyt](https://osinttools.io/tools/exolyt/): TikTok analytics platform for tracking accounts, hashtags and sounds, with social listening and influencer research. (Freemium · Username · passive)
- [FollowerAudit](https://osinttools.io/tools/followeraudit/): Audits the followers of any public X (Twitter) account and estimates how many are fake, spam, bot or inactive. (Freemium · Username · passive)

All alternatives to twscrape in one table: https://osinttools.io/tools/twscrape/alternatives/

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
