# Instagram Downloader

> Download images and video from a public Instagram post, reel, or carousel link, saving every carousel image separately. Use when given an Instagram URL and asked to download, save, or export its media.

- Skill: `fbeli/instagram-downloader` (Agent Skill)
- Install (CLI): `npx skillmds@latest add fbeli/instagram-downloader`
- Raw SKILL.md: https://api.skillmd.com/api/skills/fbeli/instagram-downloader/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: fbeli (https://skillmd.com/u/fbeli)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/fbeli/instagram-downloader

---


# Instagram Media Downloader

Downloads photos and videos from **public** Instagram posts, reels, and carousels using `gallery-dl`. Carousel posts are split into one file per image/video automatically — no special-casing needed.

## Requirements

- Outbound internet access to instagram.com. This will NOT work in network-restricted sandboxes (e.g. some cloud Cowork/Claude Code environments block instagram.com by org policy) — if a request hangs or returns a connection/proxy error, tell the user this environment can't reach Instagram rather than retrying repeatedly.
- `gallery-dl` (Python). Check first, install if missing:
  ```
  gallery-dl --version || pip install --upgrade gallery-dl --break-system-packages
  ```
  (drop `--break-system-packages` on systems where pip doesn't require/support it)

## Steps

1. Confirm the URL is a public Instagram post/reel/carousel, e.g. `https://www.instagram.com/p/XXXXXXXXX/` or `https://www.instagram.com/reel/XXXXXXXXX/`. Private accounts/posts are out of scope for this skill (no login support).

2. Pick an output directory. Default to `./instagram-downloads/<shortcode>` (the shortcode is the id segment after `/p/` or `/reel/` in the URL) unless the user specifies a destination.

3. Run gallery-dl:
   ```
   gallery-dl --directory "<output_dir>" "<instagram_url>"
   ```
   - Single photo/video post → downloads one file.
   - Carousel → gallery-dl walks every sidecar item and writes each as a separate numbered file (e.g. `..._1.jpg`, `..._2.jpg`, `..._3.mp4`) in the same folder automatically.
   - Reels and video posts save as `.mp4`.

4. If the command fails:
   - `401` / login wall → the post is private or Instagram is demanding auth; this skill only handles public content — tell the user and stop.
   - `429` / rate limited → wait and retry, or add `--sleep 5-15` between requests for multiple URLs.
   - "Unsupported URL" / empty output with no clear error → Instagram changes its markup often and breaks scrapers; try `pip install -U gallery-dl --break-system-packages` first, since this is almost always an outdated extractor, not a bad URL.

5. Verify and report: list the output directory (`ls -la <output_dir>`) and tell the user what was downloaded (file count, e.g. "3 images + 1 video from the carousel"). In Cowork, deliver the files with SendUserFile; on a local/CLI environment, just confirm the saved path.

## Notes

- Only download content the user has the right to reuse (their own posts, or with explicit permission) — respect Instagram's Terms of Service and the original poster's rights, especially before reusing downloaded media elsewhere (e.g. in GuideMapper content).
- Out of scope: Stories and Highlights (expire, need login) and private accounts. If the user needs those, that's a separate, login-based extension of this skill.

