Skip to main content

🐦 Scweet: A Simple and Unlimited Twitter Scraper in Python

Scweet Actor Status PyPI Downloads PyPI Version License

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                # Tweets with minimum likes count
- minretweets             # Tweets with minimum retweets count
- minreplies              # Tweets with minimum replies count
- save_dir                # Output directory
- custom_csv_name         # Output 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=your_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.


🔧 Installation

pip install Scweet==3.0

Make sure your environment is set up with Python 3.7+, chrome browser and pip is available.

💡 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()

📝 Example Output

When you scrape tweets using the scrape() function, the results will be written to a CSV file, with each row representing a tweet. Here’s an example of what the output might look like:

tweetId UserScreenName UserName Timestamp Text Embedded_text Emojis Comments Likes Retweets Image link Tweet URL
1577716440299442187 @elonmusk Elon Musk 2022-10-05T17:44:46.000Z 10.69.3 will actually be a major upgrade. We’re keeping .69 just because haha. Replying to@WholeMarsBlog 1256 18787 1000 https://pbs.twimg.com/profile_images/1683899100922511378/5lY42eHs_bigger.jpg /elonmusk/status/1577716440299442187
1577737664689848326 @elonmusk Elon Musk 2022-10-05T19:09:06.000Z Twitter is an accelerant to fulfilling the original http://X.com vision Replying to@TEDchris 967 10967 931 https://pbs.twimg.com/profile_images/1683899100922511378/5lY42eHs_bigger.jpg /elonmusk/status/1577737664689848326
1577747565533069312 @elonmusk Elon Musk 2022-10-05T19:48:27.000Z That wouldn’t be hard to do Replying to@ashleevance 1326 31734 1011 https://pbs.twimg.com/profile_images/1683899100922511378/5lY42eHs_bigger.jpg /elonmusk/status/1577747565533069312
1577732106784051214 @elonmusk Elon Musk 2022-10-05T18:47:01.000Z "I do not think it is simple at all, but I have yet to hear any realistic path to peace. – – – – /elonmusk/status/1577732106784051214

Columns description:

  • tweetId: The unique identifier for the tweet.
  • UserScreenName: The Twitter/X handle of the user who posted the tweet.
  • UserName: The display name of the user.
  • Timestamp: The date and time the tweet was posted.
  • Text: The content of the tweet.
  • Embedded_text: If the tweet is a reply, this will show the user being replied to.
  • Emojis: Any emojis used in the tweet.
  • Comments: Number of replies to the tweet.
  • Likes: Number of likes the tweet received.
  • Retweets: Number of retweets the tweet received.
  • Image link: A link to the image(s) attached to the tweet, if any.
  • Tweet URL: Direct URL to the tweet.

☁️ 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.1

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.1
File Size Uploaded Provenance Actions
scweet-3.1.tar.gz 27.4 kB Without provenance Details for scweet-3.1.tar.gz

Built distribution (wheel)

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

Total release size: 52.9 kB

Release files / scweet-3.1.tar.gz

Download URL scweet-3.1.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eef56a063ce74343d974eb82e6b550bb9cb1c4fcec86edc43fd9eed95773f383
BLAKE2b-256 checksum
How to use checksums
2e314e7ae954adf1a511664ae1e0f98b4b343a775092437aed98f1cfabd72b3f
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.1-py3-none-any.whl

Download URL scweet-3.1-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f7e740ff150a3f3f37505f82be3fdb45050581e70644856050720c795a14aad
BLAKE2b-256 checksum
How to use checksums
439f02e74fa6d1c7e0b9091c7d082aa6f993a3cf8c5b9e79cbf7e0e488e4a8df
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.1

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