Async Instagram downloader CLI — profiles, posts, reels, stories, highlights, hashtags, comments. Pluggable backends (HikerAPI / aiograpi).
Project description
insta-dl
Async command-line downloader for Instagram. Profiles, posts, reels, stories, highlights, hashtags, and comments — saved to disk with the original timestamps preserved.
pip install instagram-dl # pip
pipx install instagram-dl # or as an isolated CLI app
export HIKERAPI_TOKEN=your_token
insta-dl instagram
Or run it without installing Python at all:
docker run --rm -v "$PWD/out:/data" -e HIKERAPI_TOKEN \
ghcr.io/subzeroid/insta-dl:latest instagram
Grab a free HikerAPI token at hikerapi.com — first 100 requests are free, no credit card. One request ≈ one post or one page of a feed.
insta-dl
- downloads profiles, hashtags, single posts, reels, stories, highlights, and comments,
- preserves the original
taken_attimestamp as file mtime so Photos/Finder sort correctly, - writes a JSON metadata sidecar next to every post (caption, like count, location, owner),
- supports incremental updates with
--fast-updateand--latest-stamps, - accepts profile names,
#hashtag, post shortcodes, and fullinstagram.comURLs, - ships two pluggable backends: a paid commercial API (HikerAPI, no Instagram session, no ban risk) out of the box, and an opt-in private-API library via
pip install 'instagram-dl[aiograpi]'(your own login).
insta-dl [--backend hiker|aiograpi]
[--dest DIR] [--fast-update] [--latest-stamps FILE]
[--stories] [--highlights] [--comments]
profile | "#hashtag" | post:SHORTCODE | https://instagram.com/...
📖 Full documentation — installation, CLI reference, backends comparison, Python API, troubleshooting.
How to download an Instagram profile
export HIKERAPI_TOKEN=$(cat ~/.config/hikerapi-token)
insta-dl --dest ./out instagram
This grabs every post, names files 2026-04-21_16-04-15_DXZlTiKEpxw.mp4, and writes a metadata sidecar next to each.
How to keep a local archive in sync
insta-dl --fast-update --latest-stamps ./stamps.ini --dest ./out instagram
--fast-update stops at the first post that's already on disk; --latest-stamps records the newest taken_at per profile so even a deleted local copy can be resumed.
How to download a single post or reel
insta-dl post:DXZlTiKEpxw
insta-dl https://www.instagram.com/p/DXZlTiKEpxw/
insta-dl https://www.instagram.com/reel/DXZlTiKEpxw/
How to download a hashtag
insta-dl '#sunset' --dest ./out
Pulls the recent feed for the tag into ./out/#sunset/.
How to grab stories and highlights
insta-dl --stories --highlights --dest ./out instagram
Stories and highlights land under <dest>/<username>/stories/ and <dest>/<username>/highlights/<id>_<title>/.
How to save comments alongside posts
insta-dl --comments --dest ./out instagram
Each post gets a ..._comments.json sidecar streamed to disk.
Backends
Pick the one that matches how you want to authenticate.
| hiker (default) | aiograpi (in development) | |
|---|---|---|
| Auth | API token | Instagram login + 2FA |
| Cost | Paid per request, 100 free requests to start | Free |
| Account ban risk | None — no Instagram session involved | Real, mitigated by session reuse |
| Stability vs. Instagram changes | High (managed proxy) | Brittle |
| Private profiles | What HikerAPI exposes | Anything your account can see |
Switch with --backend:
insta-dl --backend hiker --hiker-token TOKEN instagram
pip install 'instagram-dl[aiograpi]' # aiograpi's deps are opt-in
insta-dl --backend aiograpi --login USER --password PASS --session ./session.json instagram
Detailed comparison and auth setup: see the backends documentation. For how insta-dl stacks up against instaloader, yt-dlp, and gallery-dl, see compared to alternatives.
Output layout
<dest>/<username>/
2026-04-21_16-04-15_DXZlTiKEpxw.mp4
2026-04-21_16-04-15_DXZlTiKEpxw.json # metadata sidecar
2026-04-21_16-04-15_DXZlTiKEpxw_comments.json # with --comments
stories/
2026-04-21_18-30-00_178290.jpg # with --stories
highlights/
17991_Travel/ # with --highlights
2025-10-12_19-20-30_4011.jpg
Hashtag downloads land under <dest>/#<tag>/; single-post downloads use the post owner's username (or owner_pk fallback).
Status
This is alpha. The hiker backend is functional end-to-end (224 tests, 95% coverage). The aiograpi backend is stubbed pending an upstream sync (and ships behind the [aiograpi] extra so its Rust deps don't bloat default installs). CLI flags and output layout are stable; Python API may still shift.
What's not yet implemented:
- private profiles requiring login (waiting on aiograpi)
:feedand:saved(account-bound, blocked on aiograpi)
See the changelog for what landed when, and contributing for how to help.
Contributing
Bug reports, fixes, and backend implementations welcome. Start with CONTRIBUTING.md. Tests: pip install -e .[dev] && pytest.
Disclaimer
insta-dl is not affiliated with, authorized, maintained, or endorsed by Instagram or Meta. Use at your own risk and respect the rights of content creators. Licensed under MIT.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instagram_dl-0.1.3.tar.gz.
File metadata
- Download URL: instagram_dl-0.1.3.tar.gz
- Upload date:
- Size: 338.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0301238a39da4ce695a92e124fa4375b177c7ee409aaa29c8497f98101d046b
|
|
| MD5 |
c1fb2d783d2408c8335e4516bf4ca0ff
|
|
| BLAKE2b-256 |
1bec34afe85114e732bb188d8b8371dbe38fd34d8be70617b9a706f7b2941ee6
|
Provenance
The following attestation bundles were made for instagram_dl-0.1.3.tar.gz:
Publisher:
release.yml on subzeroid/insta-dl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instagram_dl-0.1.3.tar.gz -
Subject digest:
c0301238a39da4ce695a92e124fa4375b177c7ee409aaa29c8497f98101d046b - Sigstore transparency entry: 1376410114
- Sigstore integration time:
-
Permalink:
subzeroid/insta-dl@c5b30782827c861ee501540bb440433bdf4198bb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/subzeroid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c5b30782827c861ee501540bb440433bdf4198bb -
Trigger Event:
push
-
Statement type:
File details
Details for the file instagram_dl-0.1.3-py3-none-any.whl.
File metadata
- Download URL: instagram_dl-0.1.3-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42e684e0d7a7f3f487accd39e615812441174963ec6d9c5b46a55804bc9b9647
|
|
| MD5 |
9bfe8aab9b2400a7e3d6108c9697b134
|
|
| BLAKE2b-256 |
8619ae5b93637579d47736469ba2532ad097d904ca4926983865581844eee75f
|
Provenance
The following attestation bundles were made for instagram_dl-0.1.3-py3-none-any.whl:
Publisher:
release.yml on subzeroid/insta-dl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instagram_dl-0.1.3-py3-none-any.whl -
Subject digest:
42e684e0d7a7f3f487accd39e615812441174963ec6d9c5b46a55804bc9b9647 - Sigstore transparency entry: 1376410132
- Sigstore integration time:
-
Permalink:
subzeroid/insta-dl@c5b30782827c861ee501540bb440433bdf4198bb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/subzeroid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c5b30782827c861ee501540bb440433bdf4198bb -
Trigger Event:
push
-
Statement type: