InstaHarvest v2¶
Powerful Instagram Private API Library¶
curl_cffi engine · Configurable strategy anonymous scraping · True async · Anti-detection · AI Agent
Key Features¶
-
Anonymous Scraping
Configurable strategy fallback chain — Web API, GraphQL, HTML, Embed, Mobile. No login needed for public data.
-
Speed Modes
SAFE → FAST → TURBO → UNLIMITED. From ban-proof to 1000 concurrent requests.
-
Full Async Parity
31 sync + 31 async modules — complete feature match.
asyncio.gatherfor bulk ops. -
Anti-Detection
TLS fingerprint rotation, browser impersonation, header randomization via
curl_cffi. -
Proxy Management
Built-in
ProxyManagerwith health checking, auto-rotation, and BrightData integration. -
Plugin System
Extensible architecture with event hooks, plugins, and middleware.
-
AI Agent
Control Instagram with natural language. 13+ AI providers, 161 tools, memory, scheduling, webhooks.
-
Advanced Tools
Analytics, Export, Growth, Automation, Monitor, Scheduler, Pipeline, AI Suggest, Audience, Comment Manager, A/B Test, Bulk Download, Diagnostics.
-
Testing & CI/CD
6242 tests, pytest-cov, GitHub Actions pipeline — lint, test, security, build.
Installation¶
With extras:
pip install instaharvest-v2[dev] # pytest, pytest-cov, pytest-asyncio
pip install instaharvest-v2[agent] # AI providers (Gemini, OpenAI, Claude)
pip install instaharvest-v2[web] # FastAPI web playground
pip install instaharvest-v2[all] # everything
Quick Example¶
from instaharvest_v2 import Instagram
ig = Instagram() # no login needed!
# Get any reel/post by shortcode or URL — no cookies required
post = ig.public.get_post_by_shortcode("ABC123")
print(post["video_url"]) # full video download URL
print(post["likes"]) # 69603
print(post["audio"]) # music info for reels
from instaharvest_v2 import Instagram
from instaharvest_v2.agent import InstaAgent, Permission
ig = Instagram.from_env(".env")
agent = InstaAgent(
ig=ig,
provider="gemini",
permission=Permission.FULL_ACCESS,
memory=True,
)
agent.ask("Get @cristiano's last 10 posts and save to CSV")
agent.ask("Compare @nike and @adidas engagement rates")
agent.ask("Find the best posting time for my account")
from instaharvest_v2 import Instagram
ig = Instagram.from_env()
# Analytics
report = ig.analytics.engagement_rate("cristiano")
# Export to CSV
ig.export.followers_to_csv("nike", "followers.csv")
# Growth engine
ig.growth.follow_users_of("competitor", count=20)
# Hashtag research
analysis = ig.hashtag_research.analyze("python")
# A/B testing
test = ig.ab_test.create("Test", variants={"A": {}, "B": {}})