instagrapi
Fast and effective Instagram Private API wrapper
Decision gist · record as of 2026-08-14
Yes, if your use case is internal testing, research, or controlled automation on accounts you own or manage. No, if you need production-grade stability or are building customer-facing features—use official Instagram APIs instead. The library is actively maintained and has no known vulnerabilities, but private API automation is inherently fragile because Instagram's account trust, device state, and rate limits change independently of the library. For production infrastructure, consider a hosted provider.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Private API automation is fragile in production—account trust, proxies, device state, challenges, and rate limits can change independently of the library.
- Low friction install with five runtime dependencies (requests, PySocks, pydantic, Pillow, pycryptodomex).
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for internal automation and testing workflows.
last release 2026-08-12 (2 days) · last repo commit 2026-08-12 · 6,644 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,033,035 downloads/mo, #3,350 on PyPI
Alternatives
Verify before relying
pip install instagrapi
from instagrapi import Client
cl = Client()
cl.login(USERNAME, PASSWORD)
user_id = cl.user_id_from_username(USERNAME)
medias = cl.user_medias(user_id, 20)- Whether optional video dependencies (MoviePy 2.2.1, ffmpeg) are required for your specific use case or only for video/story uploads.
- Whether curl-backed TLS impersonation (instagrapi[curl] extra) is necessary for your target endpoints or if standard requests suffices.
- Stability and rate-limit behavior of the private mobile API flows in your deployment environment.
What it is and what it does
instagrapi is an unofficial Python wrapper around Instagram's private mobile API and public web endpoints. It handles authentication, session persistence, challenge flows, and rate-limit recovery to support automation tasks like downloading user posts, searching locations, sending direct messages, uploading stories and reels, and reading insights. The library combines both API flows to maximize coverage of Instagram's features.
The package is designed for testing, research, and controlled internal automation rather than production account management. It depends on requests for HTTP, PySocks for proxy support, pydantic for data validation, Pillow for image handling, and pycryptodomex for cryptographic operations. Optional extras add TLS fingerprint impersonation (curl) and video composition (MoviePy 2.2.1 + ffmpeg). The maintainers explicitly recommend official Instagram APIs for business workflows and hosted providers like HikerAPI for production private API infrastructure.
Use it for
- Download another user's posts and media in bulk for archival or analysis.
- Automate direct message sending and reading for internal team workflows or testing.
- Search and retrieve location metadata and posts by geographic area.
- Upload stories, reels, and feed posts programmatically for content scheduling.
- Monitor account insights and engagement metrics via the private API.
- Receive real-time direct message notifications over MQTT for reactive automation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if your use case is internal testing, research, or controlled automation on accounts you own or manage.
No, if you need production-grade stability or are building customer-facing features—use official Instagram APIs instead. The library is actively maintained and has no known vulnerabilities, but private API automation is inherently fragile because Instagram's account trust, device state, and rate limits change independently of the library. For production infrastructure, consider a hosted provider.
Install
instagrapi on PyPI
Before you install
Low friction install with five runtime dependencies (requests, PySocks, pydantic, Pillow, pycryptodomex). Active maintenance with release 2 days ago. Requires Python 3.10+; Python 3.9 support was dropped in version 2.5.0 due to upstream security patch constraints.
Requires Python 3.10 or later. Private API automation is fragile in production—account trust, proxies, device state, challenges, and rate limits can change independently of the library.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for internal automation and testing workflows.
Quickstart
pip install instagrapi
from instagrapi import Client
cl = Client()
cl.login(USERNAME, PASSWORD)
user_id = cl.user_id_from_username(USERNAME)
medias = cl.user_medias(user_id, 20)
Verify before relying
- Whether optional video dependencies (MoviePy 2.2.1, ffmpeg) are required for your specific use case or only for video/story uploads.
- Whether curl-backed TLS impersonation (instagrapi[curl] extra) is necessary for your target endpoints or if standard requests suffices.
- Stability and rate-limit behavior of the private mobile API flows in your deployment environment.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesrequestsPySockspydanticPillowpycryptodomex |
| Maintenance | Actively maintained 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,033,035 / month, #3,350 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules |
Evidence: instagrapi-2.18.14-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “instagram api wrapper python”
- instagrapiUnofficial Instagram API wrapper that automates private mobile and…
- facebook-businessProvides Python bindings to Facebook's Business APIs, bundling…
- instaloaderDownloads public and private Instagram profiles, hashtags, stories,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also instaloader · zernio-sdk · TikTokApi · late-sdk · socid-extractor · Kurigram · snscrape · ytmusicapi · shotgun-api3 · pushbullet.py