instagrapi is a Python library that wraps Instagram's private mobile API and public web endpoints to enable automation and data access.
The library addresses the challenge of programmatically interacting with Instagram by combining both public web and private mobile API flows. It handles session persistence, manages authentication challenges, and provides automation primitives for core Instagram features including user profiles, media, stories, direct messages, notes, locations, comments, insights, and uploads. The tool supports optional TLS impersonation for public endpoints and HTTP/2 transport for private requests, with configurable certificate verification for debugging scenarios.
The project is explicitly positioned for testing, research, and controlled internal automation rather than production deployments. The README acknowledges that private API automation is inherently fragile due to account trust, proxy requirements, device state, challenges, and rate limits that can shift independently of library updates. For business workflows, the documentation recommends preferring official Instagram APIs where available, and for production infrastructure at scale, suggests hosted providers as a more maintainable alternative to self-managing accounts, proxies, and challenge handling. The tool requires Python 3.10 or later and supports optional dependencies for video processing through MoviePy and ffmpeg, with special guidance provided for Android environments.
Development activity shows consistent attention to dependency security and compatibility. The project maintains strict version pins on security-critical packages like Pillow, dropping support for older Python versions when upstream security patches are no longer backported. Documentation includes detailed guides for transport configuration, session setup, and platform-specific installation on Android. The codebase provides runnable examples covering login flows, media downloads, uploads, story handling, direct messaging, and proxy configuration, indicating active maintenance of practical use cases.