Skip to main content

Nitter Scraper

Nitter Scraper is for anyone who enjoys the twitter-scraper library. Nitter Scraper leverages running a local docker container instance of nitter to scrape a users tweets and profile information without the twitter api ratelimit. This api works similar to the twitter-scraper project with a few differences.

Docker Engine

For the best experience use this library with Docker Engine properly installed. The NitterScraper manager will start, stop and remove a docker instance of nitter. If you can't run docker you can import the get_tweets and get_profile functions to scrape from nitter.net.

Getting Started

Prereqs

  • Docker Engine
  • Python ^3.7

Install

pip install nitter-scraper

How to Scrape a twitter users profile information.

from pprint import pprint

from nitter_scraper import NitterScraper

with NitterScraper(host="0.0.0.0", port=8008) as nitter:
    profile = nitter.get_profile("dgnsrekt")
    print("serialize to json\n")
    print(profile.json(indent=4))
    print("serialize to a dictionary\n")
    pprint(profile.dict())

Output

$ python3 examples/basic_usage.py
2020-09-21 18:11:23.429 | INFO     | nitter_scraper.nitter:_get_client:31 - Docker connection successful.
2020-09-21 18:11:25.102 | INFO     | nitter_scraper.nitter:start:135 - Running container infallible_noyce 91122c9b7b.
serialize to json

{
    "username": "DGNSREKT",
    "name": "DGNSREKT",
    "profile_photo": "/pic/profile_images%2F1307990704384245760%2FSBVd3XT6.png",
    "tweets_count": 2897,
    "following_count": 904,
    "followers_count": 117,
    "likes_count": 4992,
    "is_verified": false,
    "banner_photo": "/pic/profile_banners%2F2474416796%2F1600684261%2F1500x500",
    "biography": "BITCOIN IS DEAD AGAIN. :(",
    "user_id": 2474416796,
    "location": "Moon",
    "website": "https://github.com/dgnsrekt"
}
serialize to a dictionary

{'banner_photo': '/pic/profile_banners%2F2474416796%2F1600684261%2F1500x500',
 'biography': 'BITCOIN IS DEAD AGAIN. :(',
 'followers_count': 117,
 'following_count': 904,
 'is_verified': False,
 'likes_count': 4992,
 'location': 'Moon',
 'name': 'DGNSREKT',
 'profile_photo': '/pic/profile_images%2F1307990704384245760%2FSBVd3XT6.png',
 'tweets_count': 2897,
 'user_id': 2474416796,
 'username': 'DGNSREKT',
 'website': 'https://github.com/dgnsrekt'}
2020-09-21 18:11:25.905 | INFO     | nitter_scraper.nitter:stop:139 - Stopping container infallible_noyce 91122c9b7b.
2020-09-21 18:11:31.284 | INFO     | nitter_scraper.nitter:stop:142 - Container infallible_noyce 91122c9b7b Destroyed.

Next step run the examples

NitterScraper Limitation

  • About max 800 tweets per user.
  • Unable to scrape trends from nitter.
  • To scrape the user_id the user must have a banner photo. If the banner photo url isn't present the user_id will be none.
  • The user_id cannot be scraped from the tweets.
  • birthday and is_private are not implemented in the profile.

Contact Information

Telegram = Twitter = Tradingview = Discord = @dgnsrekt

Email = dgnsrekt@pm.me

Metadata

Release files for nitter-scraper 0.5.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 nitter-scraper 0.5.0
File Size Uploaded Provenance Actions
nitter_scraper-0.5.0.tar.gz 11.8 kB Without provenance Details for nitter_scraper-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nitter-scraper 0.5.0
File Interpreter ABI Platform Actions
nitter_scraper-0.5.0-py3-none-any.whl Python 3 none any Details for nitter_scraper-0.5.0-py3-none-any.whl

Total release size: 24.2 kB

Release files / nitter_scraper-0.5.0.tar.gz

Download URL nitter_scraper-0.5.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7846edcab5f94586c972c62c845374a91806d5e96003b9eadc70fb152b75464e
BLAKE2b-256 checksum
How to use checksums
a36f8996a89b4732aafd976f1bcf371a25168be4b9e88c3e2d3c3c436ba616dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.2 Linux/5.4.0-7634-generic

Release files / nitter_scraper-0.5.0-py3-none-any.whl

Download URL nitter_scraper-0.5.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4760e0de65036e2645f194f51d27a814cc663da486a694ab17a4c8a974bc0262
BLAKE2b-256 checksum
How to use checksums
d0cafe9a17485122445e7758124e6bd2ecffd210a38c09188abe734de187ebcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.2 Linux/5.4.0-7634-generic

Security for nitter-scraper 0.5.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