Skip to main content

A powerful Instagram scraping and OSINT utility

Project description

Instagram OSINT Tool

Python Version License Version

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

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 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

๐Ÿ™ Acknowledgments

  • Original script by sc1341
  • Open source contributors

Support

Changelog

Version 1.1.2 (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


Download files

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

Source Distribution

instagram_osint-1.1.2.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

instagram_osint-1.1.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file instagram_osint-1.1.2.tar.gz.

File metadata

  • Download URL: instagram_osint-1.1.2.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for instagram_osint-1.1.2.tar.gz
Algorithm Hash digest
SHA256 bcd766af109465e0cd26ad8014361ff6f40b6463412e0204de5fb1de7e9aa662
MD5 6815435b4d26855ef7e40bcd679b7466
BLAKE2b-256 52ba27cbec1a6327ea58872d0baddbb56fc83398bec8b80841af13c73c6d0a5a

See more details on using hashes here.

File details

Details for the file instagram_osint-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for instagram_osint-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3eb7e617d2af570ccf21a6e703774072058164c29327f101bf03bf36ad6e4c5
MD5 b913c6babeba194d7ee95c3626f3249f
BLAKE2b-256 efdeef53ed31157f35d923378c50fb932c67f8b8adaab05b28d37cdec50e8000

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