A powerful Instagram scraping and OSINT utility
Project description
Instagram OSINT Tool
A powerful, modern Instagram OSINT (Open Source Intelligence) tool for profile analysis and data collection. Built with Python 3 and designed for security researchers, investigators, and data analysts.
โจ Features
- Profile Analysis - Extract comprehensive profile information
- Post Scraping - Download posts with metadata and pagination support
- Engagement Statistics - Calculate engagement rates and analytics
- Batch Processing - Process multiple accounts simultaneously
- Data Export - Save data in structured JSON format
- Media Downloads - Download profile pictures and post images
- Modern APIs - Uses Instagram's internal REST and GraphQL APIs
- Rate Limiting - Built-in protection against API throttling
- Beautiful CLI - Colorful, intuitive command-line interface
Table of Contents
- Installation
- Quick Start
- Documentation
- CLI Usage
- Python API Usage
- Examples
- Features Overview
- Legal & Ethics
- Contributing
- License
Installation
Prerequisites
- Python 3.7 or higher
- pip (Python package manager)
Method 1: Install from Source (Recommended)
# Clone the repository
git clone https://github.com/sudo-junaiddev/fork-InstagramOSINT/instagram-osint.git
cd instagram-osint
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Method 2: Direct Installation
pip install instagram-osint
Verify Installation
igosint --help
โก Quick Start
Basic Profile Analysis
# View profile information
igosint instagram
# Download everything (profile + posts + images)
igosint instagram -a
# Scrape specific number of posts
igosint instagram -P -m 50
Python API
from instagram_osint import InstagramOSINT
# Initialize scraper
scraper = InstagramOSINT("instagram")
# Access profile data
print(f"Followers: {scraper['follower_count']}")
print(f"Following: {scraper['following_count']}")
# Scrape posts
posts = scraper.scrape_posts(max_posts=50)
Documentation
Comprehensive documentation is available in the docs/ directory:
- CLI Documentation - Complete command-line interface guide
- API Documentation - Python API reference and examples
- Main Documentation - Detailed usage guide and tutorials
CLI Usage
Basic Commands
# Display profile information
igosint username
# Save profile data to JSON
igosint username -s
# Download profile picture
igosint username -d
# Scrape posts
igosint username -P
# Download post images
igosint username -P -D
Advanced Commands
# Complete data collection
igosint username -a
# Scrape with statistics
igosint username -P --stats
# Batch processing from file
igosint dummy --batch usernames.txt -a
# Custom output directory
igosint username -o /path/to/output -a
# JSON output only
igosint username --json-only > profile.json
See CLI Documentation for complete reference.
๐ Python API Usage
Basic Example
from instagram_osint import InstagramOSINT
# Create scraper instance
scraper = InstagramOSINT("username")
# Check if profile was found
if scraper.profile_data:
# Display profile information
scraper.print_profile_data()
# Save data
scraper.save_data()
# Download profile picture
scraper.download_profile_picture()
Advanced Example
from instagram_osint import InstagramOSINT
# Initialize scraper
scraper = InstagramOSINT("username")
# Scrape posts with pagination
posts = scraper.scrape_posts(max_posts=100)
# Save posts data
scraper.save_posts(posts)
# Download post images
scraper.download_posts(posts, "output/posts")
# Access individual post data
for post in posts:
print(f"Post URL: {post['url']}")
print(f"Likes: {post['likes']}")
print(f"Comments: {post['comments']}")
See API Documentation for complete reference.
Examples
Example 1: Profile Intelligence Gathering
from instagram_osint import InstagramOSINT
# Target profile
scraper = InstagramOSINT("target_username")
# Collect all data
scraper.save_data()
scraper.download_profile_picture()
# Get engagement metrics
if not scraper.profile_data.get("is_private"):
posts = scraper.scrape_posts(max_posts=50)
# Calculate statistics
avg_likes = sum(p['likes'] for p in posts) / len(posts)
print(f"Average engagement: {avg_likes:.0f} likes")
Example 2: Competitor Analysis
from instagram_osint import InstagramOSINT
competitors = ["competitor1", "competitor2", "competitor3"]
for username in competitors:
scraper = InstagramOSINT(username)
if scraper.profile_data:
print(f"\n{username}:")
print(f" Followers: {scraper['follower_count']:,}")
print(f" Posts: {scraper['post_count']:,}")
# Save for later analysis
scraper.save_data(f"analysis/{username}")
Example 3: Batch Processing
# Create usernames.txt
echo -e "instagram\nnatgeo\nnasa" > usernames.txt
# Process all accounts
igosint dummy --batch usernames.txt -a --stats
Features Overview
Profile Data Extraction
- Username and full name
- Biography and external URL
- Follower/following counts
- Post count
- Profile picture (HD quality)
- Verification status
- Business account information
- Private/public status
Post Analysis
- Post URLs and IDs
- Captions and hashtags
- Like and comment counts
- Timestamps
- Location data
- Media URLs (images/videos)
- Accessibility captions
Statistics & Analytics
- Average engagement rates
- Top performing posts
- Like/comment ratios
- Follower engagement percentage
- Post frequency analysis
Export Formats
- JSON (structured data)
- Images (JPG format)
- Batch reports
Legal & Ethics
Important Notice
This tool is designed for legitimate OSINT and research purposes only. Users must:
- โ Comply with Instagram's Terms of Service
- โ Respect user privacy and data protection laws
- โ Only collect publicly available information
- โ Use data ethically and responsibly
- โ Not use for harassment, stalking, or malicious purposes
- โ Not violate any applicable laws or regulations
Disclaimer
The authors and contributors are not responsible for any misuse of this tool. By using this software, you agree to use it responsibly and in accordance with all applicable laws and regulations.
Rate Limiting
This tool implements rate limiting to:
- Follow Instagram's API guidelines
- Prevent account blocking
- Ensure sustainable usage
๐ ๏ธ Development
Project Structure
instagram-osint/
โโโ instagram_osint/
โ โโโ __init__.py -> Package initialization
โ โโโ instagram_osint.py -> Core scraper
โ โโโ cli.py -> CLI interface
โโโ docs/
โ โโโ README.md -> Main documentation
โ โโโ cli.md -> CLI reference
โ โโโ api.md -> API reference
โโโ examples/
โ โโโ basic_usage.py
โ โโโ batch_processing.py
โโโ tests/
โ โโโ test_scraper.py
โโโ setup.py
โโโ requirements.txt
โโโ README.md
Running Tests
# Install test dependencies
pip install pytest
# Run tests
pytest tests/
๐ค Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation
- Use type hints where applicable
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐จโ๐ป Author
Junaid
- Website: abujuni.dev
- GitHub: @sudo-junaiddev
- Email: contact@abujuni.dev
๐ Acknowledgments
- Original script by sc1341
- Open source contributors
Support
- ๐ง Email: contact@abujuni.dev
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
Changelog
Version 1.1.3 (Current)
- โจ Complete rewrite with modern Instagram APIs
- ๐ CLI interface with argparse
- ๐ Engagement statistics
- ๐ Batch processing support
- ๐พ Structured JSON exports
- ๐ก๏ธ Advanced rate limiting
- ๐ Comprehensive documentation
Version 1.0
- Initial release
- Basic HTML parsing
- Profile scraping
โญ Star History
If you find this tool useful, please consider giving it a star on GitHub!
Made with โค๏ธ by Junaid
For educational and research purposes only
Project details
Release history Release notifications | RSS feed
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_osint-1.1.3.tar.gz.
File metadata
- Download URL: instagram_osint-1.1.3.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2603ee5d932a9d11be2b4d4f2ccffeb753da5a08ecfc3716162c0bab3531b277
|
|
| MD5 |
aa19d6504038fb69dbdc1ce0e98b3edc
|
|
| BLAKE2b-256 |
763fd66b26a8afcb075a815d1542c96cfdc898b0e3967a24f95f0bd1f276663e
|
File details
Details for the file instagram_osint-1.1.3-py3-none-any.whl.
File metadata
- Download URL: instagram_osint-1.1.3-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0bfff98a5ce46b5fa3a7168968b4a5bad0ab62e3f56a3d79b24c97a1b4f1ba
|
|
| MD5 |
417ebc50c0dc8b417845e56593d24bb0
|
|
| BLAKE2b-256 |
3d826b7b3d5fd0d922ba6a83cbffc4a1a1d145e8249e2e09dce0cd9f3a9d6db7
|