Skip to main content

Instagram Collector

A Python library for collecting Instagram data including hashtag posts, tagged posts, brand posts, and comments.

Features

  • Collect posts by hashtag
  • Collect tagged posts for a user
  • Collect posts from brand accounts
  • Collect comments from posts
  • Support for multiple API providers (RocketAPI and SocialAPI4)
  • Rate limiting and error handling
  • Pagination support
  • Time-based filtering

Installation

pip install instagram-collector

Usage

Initialize Collector

from instagram_collector import InstagramCollector

# Initialize with your RapidAPI key
api_key = "YOUR_RAPID_API_KEY"
collector = InstagramCollector(api_key=api_key, api="rocketapi")  # or "social4"

Configuration

The library supports various configuration options:

  • api: Choose between "rocketapi" or "social4" (default: "rocketapi")
  • max_hashtag_post_retry: Maximum retries for hashtag posts (default: 3)
  • max_tagged_post_retry: Maximum retries for tagged posts (default: 3)
  • max_brand_post_retry: Maximum retries for brand posts (default: 3)
  • max_comment_retry: Maximum retries for comments (default: 3)
  • rate_limit_delay: Delay between API calls in seconds (default: 2)

Error Handling

The library includes built-in error handling and retry mechanisms:

  • Automatic retry on API failures
  • Rate limiting to prevent API throttling
  • Time-based filtering to limit data collection
  • Exception handling for malformed responses

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for instagram-collector 0.0.9

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

Source distribution (sdist)

Source distribution for instagram-collector 0.0.9
File Size Uploaded Provenance Actions
instagram_collector-0.0.9.tar.gz 18.9 kB Without provenance Details for instagram_collector-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for instagram-collector 0.0.9
File Interpreter ABI Platform Actions
instagram_collector-0.0.9-py3-none-any.whl Python 3 none any Details for instagram_collector-0.0.9-py3-none-any.whl

Total release size: 48.1 kB

Release files / instagram_collector-0.0.9.tar.gz

Download URL instagram_collector-0.0.9.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
03d2f97538f82ddd544e34c12d3c1f7ec6273d90451560732df828ccb9ac7954
BLAKE2b-256 checksum
How to use checksums
f549b592dd4934f509eebdd172d138b20b1c7ff0fd718b79b292bed258731813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / instagram_collector-0.0.9-py3-none-any.whl

Download URL instagram_collector-0.0.9-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de40b228eacdb9ca4ea62459a4fa669c4a147036f6e70ad1cb7d6e9b7bb42f8a
BLAKE2b-256 checksum
How to use checksums
785fb4f0e2ad6b925cbd8c06325976456ea1bdaf21a31905bd548d35cd1b28c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Security for instagram-collector 0.0.9

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