Registry / http-networking / snscrape

snscrape

JSON →
library0.7.0.20230622pypypiunverified

snscrape is a social network service scraper that supports Twitter, Reddit, Telegram, and more. Current version 0.7.0.20230622 targets Python 3.8+. It is actively maintained but has evolving API structures and breaking changes across versions.

pip install snscrape
INSTALL
IMPORT
SIG · SNSCRAPE
S
snscrape
http-networkingpythonv0.7.0.20230622
Install
3.2s avg
Import
1137ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.0.20230622 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.726s · 35.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.2s · import 0.638s · 36MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TwitterSearchScraper
from snscrape.modules.twitter import TwitterSearchScraper
from snscrape.modules.twitter import TwitterSearchScraper

Scrapes recent tweets matching a query.

from snscrape.modules.twitter import TwitterSearchScraper from datetime import datetime scraper = TwitterSearchScraper('from:@elonmusk since:2022-01-01 until:2022-12-31') for i, tweet in enumerate(scraper.get_items()): if i >= 5: break print(tweet.url, tweet.date, tweet.content[:50])
snscrape --version
Debug
Known issues
breakingsnscrape 0.7+ changed the import structure from `snscrape.snscrape` to `snscrape.modules.*`. Old code using `from snscrape import snscrape` will break.
fix
Change imports to `from snscrape.modules.<service> import ...`
affects: >=0.7.0
gotchaTwitter scraping may be blocked or rate-limited; snscrape does not officially support authenticated scraping. Using excessive requests can lead to IP blocks.
fix
Respect robots.txt, use polite delays, and consider official APIs for production.
affects: all
deprecatedThe `snscrape.base.Scraper` base class is subject to internal changes and not meant for direct use.
fix
Use service-specific scrapers like `TwitterSearchScraper` or `RedditScraper`.
affects: all
gotchasnscrape may break if Twitter/X changes its HTML/JSON structure; no guarantees of long-term stability.
fix
Pin version and test scraping behavior regularly.
affects: all
Upgrade
Version history
0.7.0.20230622latest on PyPI · released Jun 22, 2023
Audit
Dependencies
requestsrequiredHTTP requests
lxmlrequiredHTML parsing
beautifulsoup4requiredHTML parsing
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
snscrape — pip install snscrape · libregistry