Skip to main content

🐦 Scweet: A Simple and Unlimited Twitter Scraper in Python

Note: Scweet is not affiliated with Twitter/X. Use responsibly and lawfully.


🚀 Recent X Platform Changes & Scweet v3.0 Update

Scweet has recently encountered challenges due to major changes on X (formerly Twitter). In response, we’re excited to announce the new Scweet v3.0 release!

✨ What’s New in v3.0:

  • ✅ Fully asynchronous architecture for faster, smoother scraping
  • 🧠 No more manual Chromedriver setup – Scweet handles Chromium internally
  • 🚀 Enhanced for personal and research-level scraping
  • ⚠️ Follower/following scraping temporarily disabled (to return in future updates)

🔧 For heavy-duty scraping, we recommend using Scweet on Apify – a cloud-based solution offering higher throughput and stability (up to 1000 tweets/minute), no infrastructure setup needed.

⚠️ Responsible Use Reminder
Whether running locally or in the cloud, always scrape tweets ethically, lawfully, and respectfully.


📌 What is Scweet?

Scweet is a Python-based scraping tool designed to fetch tweets and user data without relying on traditional Twitter APIs, which have become increasingly restricted.

With Scweet, you can:

  • Scrape tweets by keywords, hashtags, mentions, accounts, or timeframes
  • Get detailed user profile information
  • (Coming soon) Retrieve followers/following lists again!

🔧 Key Features

🐤 scrape() – Tweet Scraper

Scrape tweets between two dates using keywords, hashtags, mentions, or specific accounts.

✅ Available arguments include:

- since, until            # Date range (format: YYYY-MM-DD)
- words                   # Keywords (string or list, use "//" separator for strings)
- from_account            # Tweets from a user
- to_account              # Tweets to a user
- mention_account         # Tweets mentioning a user
- hashtag                 # Search by hashtag
- lang                    # Language code (e.g. "en")
- limit                   # Max number of tweets
- display_type            # "Top" or "Latest"
- resume                  # Resume from previous CSV
- filter_replies          # Include/exclude replies
- proximity               # Local tweet filtering
- geocode                 # Geolocation filtering
- minlikes, minretweets, minreplies
- save_dir, custom_csv_name

👤 get_user_information() – User Info Scraper

Fetch profile details for a list of handles. Returns a dictionary with:

  • username (display name)
  • following (number of accounts they follow)
  • verified_followers (number of verified followers)
  • location, website, join_date, description

🧩 Arguments:

- handles        # List of Twitter/X handles
- login (bool)   # Set True to login and access full data

🔒 get_users_followers() & get_users_following()

⚠️ Currently Disabled due to platform changes
These will be re-enabled in future versions as we work around new limitations.


🛠️ Class Initialization & Configuration

You can customize Scweet’s behavior during initialization:

scweet = Scweet(
  proxy=None,                              # Dict or None {host, post, username, pasword}
  cookies=None,                            # Use saved cookies file
  cookies_path='cookies',                  # Folder path where cookies will be saved/loaded in future usage
  user_agent=None,                         # Custom user agent string
  env_path='.env',                         # Environment variables
  n_splits=-1,                             # Split date interval (-1 for daily)
  concurrency=5,                           # Concurrent tabs
  headless=True,                           # Run headlessly
  scroll_ratio=100,                        # Adjust scroll behavior
  code_callback=None                       # Optional custom login code handler. Scweet only handles MailTM emails to get the code if X asks for it.
)

🔐 Authentication

Scweet requires login to fetch tweets. Set up your .env file like this:

EMAIL=your_email@example.com
EMAIL_PASSWORD
USERNAME=your_username
PASSWORD=your_password

Use the built-in helper to create disposable login emails:

from Scweet.utils import create_mailtm_email

For custom email providers, pass your own code_callback.


💡 Example Usage

🐍 Python Script

from Scweet.scweet import Scweet
from Scweet.user import get_user_information

scweet = Scweet(proxy=None, cookies=None, cookies_path='cookies',
                user_agent=None, disable_images=True, env_path='.env',
                n_splits=-1, concurrency=5, headless=True, scroll_ratio=100)

# Get user profile info
handles = ['nagouzil', 'yassineaitjeddi', 'TahaAlamIdrissi']
infos = scweet.get_user_information(handles=handles, login=True)
print(infos)

# Scrape tweets with keywords
results = scweet.scrape(
  since="2022-10-01",
  until="2022-10-06",
  words=['bitcoin', 'ethereum'],
  lang="en",
  limit=20,
  display_type="Top",
  resume=False,
  filter_replies=False,
  minlikes=10,
  minretweets=10,
  save_dir='outputs',
  custom_csv_name='crypto.csv'
)
print(len(results))
scweet.close()

🖥️ Terminal Usage

python scweet.py --words "excellent//car" --to_account "tesla" \
  --until 2020-01-05 --since 2020-01-01 --limit 10 \
  --interval 1 --display_type Latest --lang "en" --headless True

☁️ Scweet on Apify (Cloud)

Need powerful, scalable, high-volume scraping?
Try Scweet on Apify – a no-setup cloud solution:

  • 🚀 Up to 1000 tweets/minute
  • 📦 Exports to datasets or files
  • 🔒 Secure, isolated runs
  • 🔁 Ideal for automation, long-term projects

🙏 Responsible Use

We care deeply about ethical scraping.

Please: Use Scweet for research, archiving, and lawful purposes only.


📎 Resources


⭐ Star & Contribute

If you find Scweet useful, consider starring the repo ⭐
We welcome PRs, bug reports, and ideas for new features!


MIT License • © 2020–2025 Altimis

Metadata

Release files for Scweet 3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Scweet 3.0
File Size Uploaded Provenance Actions
scweet-3.0.tar.gz 25.1 kB Without provenance Details for scweet-3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Scweet 3.0
File Interpreter ABI Platform Actions
scweet-3.0-py3-none-any.whl Python 3 none any Details for scweet-3.0-py3-none-any.whl

Total release size: 49.3 kB

Release files / scweet-3.0.tar.gz

Download URL scweet-3.0.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
22e386a86037ad62b92461e716437f1dae111bbf4f06dea5e58a865ad20bc20c
BLAKE2b-256 checksum
How to use checksums
d9f4081f78ac7a998d345dbd9891982420ccd8071d3fda518411a1e3a364109a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / scweet-3.0-py3-none-any.whl

Download URL scweet-3.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a95c7150d32557ac43b4e13d54a6cb97b54bec378d10fb990ab72f42c36062
BLAKE2b-256 checksum
How to use checksums
142dac3434cbbeaac7d8b2508ccc1dc00e895a35e3d2ca15b1ffcc51a70104f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for Scweet 3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page