LinuxCommandLibrary

instaloader

Download Instagram content, profiles, and hashtags

TLDR

Download a profile

$ instaloader [profile_name]
copy

Download highlights
$ instaloader --highlights [profile_name]
copy

Download posts with geotags (if available), suppressing any user interaction
$ instaloader [[-q|--quiet]] [[-G|--geotags]] [profile_name]
copy

Specify a user agent for HTTP requests
$ instaloader --user-agent [user_agent] [profile_name]
copy

Specify login info and download posts (useful for private profiles)
$ instaloader [[-l|--login]] [username] [[-p|--password]] [password] [profile_name]
copy

Skip a target if the first downloaded file has been found (useful for updating Instagram archives)
$ instaloader [[-F|--fast-update]] [profile_name]
copy

Download stories and IGTV videos (login required)
$ instaloader [[-l|--login]] [username] [[-p|--password]] [password] [[-s|--stories]] --igtv [profile_name]
copy

Download all types of posts (login required)
$ instaloader [[-l|--login]] [username] [[-p|--password]] [password] [[-s|--stories]] --igtv --highlights [profile_name]
copy

SYNOPSIS

instaloader [options] target1 [target2 ...]
where target is username, #hashtag, :feed, @userstories, etc.

PARAMETERS

-h, --help
    Show help message and exit

--version
    Show program's version number and exit

--login=USERNAME
    Login with USERNAME; saves session to ~/.config/instaloader/session-USERNAME

--password=PASSWORD
    Password for login (prompts if omitted; insecure on command line)

--password-from-stdin
    Read password from stdin

--sessionfile=PATH
    Load/save session from/to PATH

--no-sessioncheck
    Skip session validity check at startup

--fast-update
    Skip already-downloaded files based on shortcode

--no-video
    Do not download videos

--no-pictures
    Do not download pictures

--no-videos
    Do not download videos

--no-metadata-json
    Do not dump metadata as JSON

--dirname-pattern=STR
    Custom target directory pattern (default: {profile})

--filename-pattern=STR
    Custom filename pattern (default: {date_utc}_UTC_{time_utc}_{shortcode})

-j JOBS, --jobs=JOBS
    Parallel download jobs (default: 3)

--rate-limit=RL
    Manual rate limit (requests/second)

--max-connection-attempts-per-session=N
    Retry connections N times

--stories
    Download stories (target prefixed with colon, e.g. :stories)

--highlights
    Download highlights

--tagged-posts
    Download posts where target is tagged

--geotags=GEOTAGS
    Download geotagged posts (true/false/default)

--no-compress-json
    Do not compress JSON metadata

--user-agent=UA
    Custom User-Agent header

--post-metadata-txt=STR
    Pattern for post metadata .txt file

--comments
    Download all comments on posts

DESCRIPTION

Instaloader is a free, open-source Python tool for downloading photos, videos, stories, IGTV, Reels, and metadata from Instagram profiles, hashtags, locations, and feeds. It supports public and private content via login, with features like deduplication (--fast-update), custom directory/file naming patterns, parallel downloads, JSON metadata export, and rate limiting to avoid blocks. Ideal for archiving personal data, research, or backups. It bypasses some Instagram restrictions without official API access, but users must respect terms of service. Cross-platform, actively maintained on GitHub with regular updates for API changes. Install via pip install instaloader. Handles high-volume downloads efficiently, resuming interrupted sessions via saved cookies.

CAVEATS

Instagram may temporarily block IPs on heavy use; use --rate-limit. Login required for private content/stories. Not affiliated with Instagram; respect ToS and robots.txt. Python 3.6+ required. Sessions expire; relogin as needed. No official support for 2FA (use app passwords).

INSTALLATION

pip3 install instaloader
Or from source: git clone https://github.com/instaloader/instaloader
cd instaloader && pip3 install .

COMMON EXAMPLES

instaloader username – Download profile
instaloader --login=user #hashtag – Hashtag with login
instaloader :feed – Logged-in feed
instaloader --stories user – Stories

TARGETS

Profiles: username
Hashtags: #hashtag
Feed: :feed
Stories: username or :stories
Own stories: :ownstories

HISTORY

Initial release in 2017 by developer mkhl. Actively maintained on GitHub (instaloader/instaloader) with 10k+ stars. Frequent updates track Instagram's private API changes. Version 4.10+ (2024) adds Reels/Live support, improved login handling.

SEE ALSO

wget(1), curl(1), youtube-dl(1)

Copied to clipboard