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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instagram_collector-0.0.4.tar.gz.
File metadata
- Download URL: instagram_collector-0.0.4.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4528baf0f20466165bfe9ed8871478a95d036de908e7da0e12ec5a0c716846d
|
|
| MD5 |
2c9075f0c6019e8087dfa0d82d4ec946
|
|
| BLAKE2b-256 |
9a332edcbd1c42083c858e6a2d5b39504154556d8f489817074ab4e60602c1a5
|
File details
Details for the file instagram_collector-0.0.4-py3-none-any.whl.
File metadata
- Download URL: instagram_collector-0.0.4-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acb98de104da57afec0aed966941e3b2df5cff2f68af362082d604218748beb6
|
|
| MD5 |
75b0d86d04215ff22c208bd35a743345
|
|
| BLAKE2b-256 |
3a503d70fce531fd93714d61d9dc7d76513dce14923db5772bedb6aff338e172
|