# Install twscrape on Windows, macOS and Linux

Search and collect X (Twitter) posts, profiles and followers.

twscrape collects data from X (Twitter): search results, a user's posts, followers and profile details. It works through accounts that you add to it and switches between them when one reaches its rate limit.

## How to install twscrape

```
ot install twscrape
```

ot installs twscrape 0.21.1 with uv into a Python environment of its own under `~/.ot`, so it cannot conflict with your system Python or with any other tool.

Before first use: Needs one or more X accounts of your own, added with "ot run twscrape add_accounts".

If you do not have ot yet:

macOS and Linux:

```
curl -fsSL https://otinstaller.com/install.sh | sh
```

Windows (PowerShell):

```
irm https://otinstaller.com/install.ps1 | iex
```

Current version: 0.3.0. Both scripts verify the download against its [SHA-256 checksum](https://otinstaller.com/releases/v0.3.0/checksums.txt) before installing.

## How to use twscrape

Arguments after the tool's name go straight to twscrape.

Add your accounts from a file with one account per line.

```
ot run twscrape add_accounts accounts.txt username:password:email:email_password
```

Log the accounts in.

```
ot run twscrape login_accounts
```

Search posts and print them as JSON.

```
ot run twscrape search "from:nasa" --limit 20
```

Show a profile.

```
ot run twscrape user_by_login nasa
```

`ot run twscrape --help` lists every option.

An AI agent can run twscrape too: `ot mcp` serves it over the Model Context Protocol. See [OSINT with AI agents](https://otinstaller.com/mcp/).

## twscrape licence, platforms and versions

- Project: https://github.com/vladkens/twscrape
- Licence: MIT
- Runs on: Windows, macOS and Linux
- Takes: username, query
- Categories: twitter, social
- Sends traffic to the target: no
- Python package: twscrape 0.21.1, in its own isolated environment

## Questions about twscrape

### How do I install twscrape on Windows?

Open PowerShell and install ot with `irm https://otinstaller.com/install.ps1 | iex`. Then run `ot install twscrape`. ot fetches a pinned version of twscrape and keeps it under `~/.ot`, apart from the rest of your system.

### Is twscrape free?

Yes. twscrape is open source, released under the MIT licence. ot, which installs it, is free under the Apache 2.0 licence.

### Do I need to set up Python to use twscrape?

No. ot installs twscrape with uv into a virtual environment of its own, separate from your system Python. If uv is not installed, ot fetches its own copy first.

### How do I update or remove twscrape?

`ot update twscrape` moves it to the version pinned in ot's registry, and `ot update twscrape --latest` to the newest upstream release. `ot remove twscrape` uninstalls it.

## Tools related to twscrape

- [instaloader](https://otinstaller.com/tools/instaloader/): Download Instagram profiles, posts, stories and metadata.
- [linkook](https://otinstaller.com/tools/linkook/): Find a username on social sites, then follow links to connected accounts.
- [maigret](https://otinstaller.com/tools/maigret/): Build a dossier on a username from 3000+ sites, with profile data extraction.
- [masto](https://otinstaller.com/tools/masto/): Find Mastodon accounts by username across instances and read their details.
- [naminter](https://otinstaller.com/tools/naminter/): Check a username against the WhatsMyName site list.
- [nexfil](https://otinstaller.com/tools/nexfil/): Find profiles for a username across several hundred sites.

More: [Social media](https://otinstaller.com/osint-tools/social-media/).
