Builds
igagent: Instagram Harvesting for AI Agents With No Login and No API Keys (Built for Agent Pipelines)
igagent harvests public Instagram posts for AI agents: one URL in, verified media and one JSON manifest out, with no login, keys, or browser.

Last updated: November 19, 2026 · 6-minute read
One Instagram URL in, verified media files and one JSON manifest out — with no login, no API keys, and no browser anywhere in the loop. igagent is the harvester I built for a simple reason: the agents that need Instagram content run in cloud sandboxes, and cloud sandboxes cannot log into Instagram. Version 1.0.0 is a single Python file of about 1,175 lines, standard library only, MIT licensed.
The design question came from my own pipelines. Video and research workflows kept needing the actual media from a public post — the image, the carousel, the reel file — not a screenshot of a login wall. Every existing route demanded a session, a token, or a headless browser with a prayer. igagent is built on a different observation, stated in its README: public embed pages are a door Instagram serves to any referrer, and for link unfurlers it renders the actual media straight into the HTML. The tool uses only doors that open with no session at all.
The Three Slots That Do the Work
igagent decodes a post through three interchangeable surfaces, in order. Each is a slot: an implementation of one contract, replaceable when Instagram kills it, with every attempt recorded in a provenance trace.
Two surfaces were tested and deliberately rejected as slots: the app API's media-info endpoint, which answers a datacenter IP with a 302 to a login wall, and the GraphQL endpoint, which answers 403. They are documented in the repo's endpoint matrix with their failure signatures and the dates they were checked — the matrix is the maintenance protocol, not decoration. When a surface flips, the row gets updated and the slot gets replaced; the pipeline never restructures.
The shortcode itself is also evidence. It decodes to the numeric media ID by pure base-64 math, and the result is cross-checked against the igcachekey embedded in the media URL. Carousel membership comes only from the payload's sidecar data and is flagged carousel.known — never inferred from how a page happens to look.
Verified Delivery, or It Did Not Happen
A harvester that reports files it never checked is a liability in an automated pipeline, so delivery is gated:
- Downloads come only from HTTPS hosts ending in .cdninstagram.com or .fbcdn.net — lookalike hosts fail the suffix check in the offline tests
- Each file streams to a .part file, passes a Content-Length check, then a magic-byte identity check — a body that does not identify as JPEG, PNG, WebP, MP4, MP3, or GIF is deleted
- Verified files land by atomic replace inside the output directory; nothing is written outside it
- A deleted or dead post is not an exception — it returns status: "empty" with structured errors and exit code 1, so the calling agent can move on without parsing a crash
The Agent Contract
The tool is designed for machines to call, and the contract is three commands:
One JSON summary lands on stdout; the full envelope lands in postmanifest.json — caption, timestamps, author fields with explicit nulls where a slot exposes nothing, per-file download states with reasons, and the slot-by-slot provenance trace. A draft-07 JSON Schema ships in the repo, so a pipeline can validate the envelope mechanically. Exit codes carry meaning: 0 for ok or partial, 1 for an honest empty, 2 for invalid input.
For MCP hosts, mcpserver.py speaks newline-delimited JSON-RPC 2.0 over stdio — standard library only, no mcp package — and exposes four tools: extractpost, lookuppost, readmanifest, and getschema. The whole thing runs on Python 3.9+ with zero pip dependencies and no environment variables. The test suite is 69 tests, all offline, all on synthetic fixtures — never real IDs.
Restraint is a load-bearing part of the design: bounded retries, 0.6-second decode sleeps, response caps, and one post per invocation. The public surfaces this tool depends on are free, and the README's phrasing is the house rule — restraint is the rent.
Where It Falls Short
- The platform terms are a grey area, stated plainly. Instagram's terms restrict automated collection of its content. igagent walks only unauthenticated public surfaces and never touches a login, a paywall, or a private post — and that distinction is a design ethic, not a legal clearance. Anyone running it at volume is making their own call about platform rules, and the repo says the quiet part itself: do not use this tool at volumes that constitute abuse.
- Reels often come back metadata-only. The embed surface frequently does not expose a video URL; the manifest then reports downloadable: false with the reason novideourlexposed. That is the truth of the surface, and the tool reports it instead of failing — but if reels are your main target, expect partial harvests.
- Carousel depth depends on the slot. The commonly served unfurler view shows only the primary item. Full sidecars need the legacy payload, which is exactly the slot that has gone rare.
- Datacenter IPs get partial ground. The working slot held from a cloud VM in testing; other surfaces did not. A harvest that works from a home connection and a harvest that works from a runner are different claims, and the endpoint matrix keeps them separate.
- Everything upstream is borrowed. Instagram changes its surfaces without notice. The slot architecture exists because breakage is expected, not because it is unlikely.
- The scale is honest: zero. As of November 7, 2026, the repo has 0 stars and one release, v1.0.0. It was built for my own agent pipelines, it is tested against fixtures and dated live checks, and it has no user base to hide behind.
The Verdict
igagent is a narrow tool with an opinionated spine: no session is not a limitation to work around but the boundary to design inside, and a manifest that admits what it could not get is worth more than a folder of unverified downloads. For agent pipelines that need public Instagram media as files — research archives, content audits, my own video workflows — it does one job, in one file, with the receipts attached.
It is the Instagram sibling of xthread-agent and ytagent, which follow the same doctrine on their platforms, and it pairs with imgagent — the rights-checked image fetcher from the same toolkit. The rest of the family is on the projects page.
---
igagent is the author's own project. Sources: igagent GitHub repository, its endpoint matrix, its SECURITY.md. Instagram is a trademark of Meta; this project is not affiliated with Meta.