// comparison

instagrapi vs instaloader: Which Python Library Should You Use?

If you're picking a Python library to read Instagram data, you're almost certainly choosing between instagrapi (the private-API client we maintain) and instaloader (the public-web download tool). They look similar at a glance, but they solve different problems. Here's the honest comparison.

TL;DR

Use instagrapi if you can log in with an Instagram account and want full programmatic access (DMs, likes, follows, full follower lists). Use instaloader if you only need to download public profile media and don't want to log in. They're not really the same kind of tool.

Two libraries, two goals

The single most important difference: instagrapi speaks Instagram's mobile-app API; instaloader scrapes Instagram's public website.

  • instagrapi: pretends to be the Instagram iPhone/Android app. Requires you to log in with an Instagram account. Sees everything that account sees — DMs, likes, follows, story views, full follower lists.
  • instaloader: pretends to be a browser. Optionally logs in. Downloads public profile content (posts, stories if logged in, highlights). Doesn't do DMs, likes API, or full follower lists.

If you don't have an Instagram account you're willing to use, instagrapi isn't an option. If you need anything beyond public-profile downloads, instaloader isn't either.

Comparison summary

Dimensioninstagrapiinstaloader
API surfaceprivate (mobile-app endpoints)public web
Login requiredyesoptional (required for stories)
Direct messagesyesno
Likes / followsyesno
Full follower listyes (with rate limits)limited / login-gated
Story downloadyesyes (with login)
Reels / IGTVyesyes
CLIvia examples / communityfirst-class
Async supportvia aiograpi forkno
LicenseMITMIT
Stars (2026-04)~6.1K~9K
Use case fitfull automation, OSINTdownloading public media

Feature coverage

What only instagrapi does

  • Send/read direct messages.
  • Like, comment, follow, unfollow programmatically.
  • View story like a logged-in user (counts as a view from your account).
  • Full followers/following pagination on accounts you have permission to view.
  • Detailed profile metadata (account type, business category, contact methods).
  • Search across users, hashtags, places.

What only instaloader does well

  • Mature command-line interface (instaloader profilename just works).
  • Built-in download orchestration (already organizes files by date, type).
  • Anonymous access for public profiles (no Instagram account needed for the basics).

Authentication and ban risk

instagrapi: you log in with username/password (or a saved session). Instagram tracks the account; aggressive scraping triggers challenges and, eventually, bans. Mitigations: realistic device profiles via instagrapi-extra, sessions persisted to disk, rotating accounts, browser-cookie auth.

instaloader: anonymous use is rate-limited harder by Instagram (the public web is the path Meta most aggressively throttles). At any real volume, you'll need to log in, at which point you're in the same risk profile as instagrapi but with fewer features.

The "no ban" path: use a managed cloud API like HikerAPI that runs many accounts on its own infrastructure. You don't log in, you don't get banned. We maintain instagrapi and HikerAPI; if you're scaling, the cloud API is the right call.

Performance

For sequential single-profile fetches, both are fine. For concurrent workflows:

  • instagrapi is sync. For real concurrency, use aiograpi (the asyncio fork).
  • instaloader is sync, single-process by design. Parallelism via subprocess is awkward.

Code examples

instagrapi: get a user's last 12 posts

from instagrapi import Client
cl = Client()
cl.login("USER", "PASS")
user_id = cl.user_id_from_username("nasa")
medias = cl.user_medias(user_id, amount=12)
for m in medias:
    print(m.pk, m.media_type, m.like_count)

instaloader: download a user's public profile

import instaloader
L = instaloader.Instaloader()
L.download_profile("nasa", profile_pic_only=False)

instagrapi: send a DM

cl.direct_send("Hello!", user_ids=[user_id])
# instaloader can't do this — public web has no DM API.

How to choose

  1. Just want to download public media? → instaloader has the better CLI for that.
  2. Need DMs, likes, full follower data, or any account action? → instagrapi (or aiograpi for async).
  3. Worried about getting banned? → use a cloud API (HikerAPI). Both libraries put your Instagram account at risk if you scale.
  4. Building a download tool with no Instagram login? → consider insta-dl — uses HikerAPI as backend, no ban risk.

For the broader landscape, see Best Instagram Python Library in 2026.

Try the subzeroid stack.

HikerAPI, Lamatok, and Datalikers each include 100 free requests. No credit card required.