Skip to main content

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

Project description

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.

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

instagram_collector-0.0.7.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

instagram_collector-0.0.7-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file instagram_collector-0.0.7.tar.gz.

File metadata

  • Download URL: instagram_collector-0.0.7.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for instagram_collector-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f805082d979f16c0d5e3a1c279b8b3beadeec5fe4552413a5e6aebbea87b0cd5
MD5 cf301acd23f103be4a3833a08765e231
BLAKE2b-256 06f5eadf59983d4a63740f0a969aff671c4e59386c39cc48077c29fccb467982

See more details on using hashes here.

File details

Details for the file instagram_collector-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for instagram_collector-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 909f340f2cab6a3fbf76078eb4439d4161a57c75c5eb996240aa80bfe119bdd4
MD5 319e0f246610fc0151796450f0e91119
BLAKE2b-256 bbb5550c8f93fad3d3310e0e746d3d2ef4dd5a3943484cac9108268b5f053baf

See more details on using hashes here.

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