Skip to main content

A convenient way to harvest Reels data without breaking a sweat—or Instagram's TOS

Project description

PyPI version Build Code Tests Coverage

Reel Scraper

Scrape Instagram Reels data with ease—single or multiple accounts at once—using Python, threading, and a dash of digital sorcery.

InstallationUsageClassesContributingLicenseAcknowledgmentsDisclaimer


💻 Installation

Reel Scraper requires Python 3.9+. Install it from PyPI:

pip install reelscraper

Or clone from GitHub:

git clone https://github.com/andreaaazo/reelscraper.git
cd reelscraper
python -m pip install .

🚀 Usage

Below are two common ways to run the scraper—interactively in Python or via a CLI entry point (if provided).

1. Single Account or Single-Session Scraping

Use the ReelScraper class for scraping a single Instagram account’s Reels.

from reelscraper import ReelScraper

# Initialize with desired settings
scraper = ReelScraper(timeout=30, proxy=None)

# Fetch up to 10 reels for username "someaccount"
reels_data = scraper.get_user_reels("someaccount", max_posts=10)
for reel in reels_data:
    print(reel)

2. Multiple Accounts with Concurrency

Use the ReelMultiScraper class to scrape Reels from multiple Instagram accounts in parallel.

from reelscraper import ReelScraper
from reelscraper import ReelMultiScraper

# Initialize a single scraper instance
single_scraper = ReelScraper(timeout=30, proxy=None)

# Initialize the multi-scraper with a text file of usernames, one per line
multi_scraper = ReelMultiScraper(
    accounts_file="accounts.txt",
    scraper=single_scraper,
    max_workers=5  # concurrency level
)

# This returns a dict mapping each username to its list of reels
all_reels = multi_scraper.scrape_accounts()
print(all_reels)

File-based approach: Provide a file named accounts.txt with one username per line:

user1
user2
user3

The code will automatically read these usernames and scrape their Reels in parallel.


🏗 Classes

ReelScraper

  • Wraps around InstagramAPI and Extractor to fetch Reels data.
  • Methods:
    • get_user_reels(username, max_posts, max_retries): Gathers Reels for a given username, with optional pagination and retries.

ReelMultiScraper

  • Manages scraping multiple accounts in parallel using ReelScraper (or a subclass) under the hood.
  • Methods:
    • scrape_accounts(): Dispatches concurrent requests to scrape each account listed in accounts.txt (or your chosen file).

🤝 Contributing

We welcome all contributions to make this scraper faster, smarter, or less prone to cosmic errors. To contribute:

  1. Fork the project.
  2. Create a new branch.
  3. Commit your improvements.
  4. Submit a pull request.

Adding tests, code comments, and a bit of humor in your commit messages is always appreciated!


📄 License

This project is licensed under the MIT License. Feel free to adapt, enhance, or break it—just be kind to fellow developers (and caffeinated beverages).


🙏 Acknowledgments

  • Python community for making concurrency and packaging (somewhat) sane.
  • Instagram for hosting so many reels and giving us interesting content to scrape—please don’t smite us.
  • Coffee (and tea!) for fueling late-night debugging sessions.

⚠ Disclaimer

This project is for educational and personal use. Use it responsibly and within Instagram’s Terms of Service. We do not endorse scraping for malicious or large-scale commercial purposes. When in doubt, show social media platforms the same respect you’d show your grandmother’s cookie jar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reelscraper-1.3.8.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reelscraper-1.3.8-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file reelscraper-1.3.8.tar.gz.

File metadata

  • Download URL: reelscraper-1.3.8.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for reelscraper-1.3.8.tar.gz
Algorithm Hash digest
SHA256 435cf161e70a3c8ec9ca4f2e5786f2ae9eca66eab850da0b3fb93db01e627d60
MD5 13d7599240c88c0d321d699cf6469c95
BLAKE2b-256 33c78d8664ec0db813cc2883461cc22a49d89788e3029bd4dd6708d20f77f6ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for reelscraper-1.3.8.tar.gz:

Publisher: pypi-publish.yml on andreaaazo/reelscraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reelscraper-1.3.8-py3-none-any.whl.

File metadata

  • Download URL: reelscraper-1.3.8-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for reelscraper-1.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 06f618690814d36b1bf8561350d5b48a8c54218abe773acda619d03cf8d83c10
MD5 a44a9dddf228c95737aea9a7d4a3756c
BLAKE2b-256 75496e9cd0ed29c8427572b6cf9db6c77822d98da2d9f79a7a10b9ab16241145

See more details on using hashes here.

Provenance

The following attestation bundles were made for reelscraper-1.3.8-py3-none-any.whl:

Publisher: pypi-publish.yml on andreaaazo/reelscraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page