Instaloader Alternative: When 401 Errors Stop Your Scraper
Looking for an Instaloader alternative? Why 401 'Please wait a few minutes' errors happen, fixes to try first, and a no-login Instagram API with Python.
By Scrape Everything team · · 10 min read
Last updated: November 30, 2026
TL;DR: If Instaloader keeps failing with 401 Unauthorized and "Please wait a few minutes before you try again", Instagram is throttling your IP or session. For saving media, gallery-dl or yt-dlp hit the same wall. For public profiles, posts, reels and comments as JSON from a server, the practical Instaloader alternative is a hosted no-login API.
Instaloader is the best free option for archiving your own account or pulling a few profiles from a laptop. It starts failing when the same script moves to a VPS or CI runner and runs hourly. Below: why, what to try first, and what the port to an API looks like.
Why does Instaloader return 401 or "Please wait a few minutes"?
The error looks like this:
JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query/...That's Instagram's response, passed through by Instaloader: it has stopped answering your client because it asked too often or looks automated. The Instaloader issue tracker has a long list of reports with this exact text, so the bug probably isn't in your code.
Two related messages mean something different:
- 429 Too Many Requests. The Instaloader troubleshooting docs say Instaloader tracks its own requests and, after a 429, "retries the request as soon as the temporary ban is assumed to be expired."
- "Too many queries in the last time." Per the same page, that's not an error. It's Instaloader's own rate accounting saying it's near the limit and will sleep.
The 401 is the nasty one: nothing tells you when Instagram will let you back in.
There's a trap in the rate controller, too. The docs say it assumes Instaloader is the only application consuming requests and that none had been consumed when it starts. Restart the script five times while debugging, or run a second tool on the same connection, and Instagram sees traffic the controller never counted.
Then there's the IP. The same docs say addresses from cloud, VPN and public proxy services "might be subject to significantly stricter limits for anonymous access", while logged-in access doesn't seem to be affected. Our reading: that's why a command that works at home dies fast on a data center box, and why rotating across a few cloud IPs doesn't help much. They're all still cloud IPs.
If what you need is the profile metadata Instaloader saves next to the media, the Instagram profile API returns it without an Instagram session on your side: bio and follower, following and post counts for 1 credit, with private accounts limited to their public fields.
Should you log in to Instaloader?
Logging in (instaloader --login your_account) is the documented way around the anonymous limits. The cost is that every request is now tied to that Instagram account.
Instaloader can handle the checkpoint challenge that's "issued when Instagram suspects authentication activity on your account", and that challenge is the problem in a nutshell. Two things follow:
- Your account can be challenged or restricted mid-job. A scraper that hits a checkpoint at 3 a.m. just stops until someone opens a browser.
- Automated access with an account falls under Instagram's Terms of Use, and that's between you and Meta. This isn't legal advice; read the terms and our post on whether scraping public social media data is legal.
Our position: log in for your own account and your own data. Don't put a real account behind a job that collects other people's public profiles.
What fixes should you try before switching?
If you want to keep Instaloader, go through these in order. Each comes from the Instaloader docs or follows from how its rate controller works.
- Update. The troubleshooting page says to run the current version, especially if you see many 429s:
pip install --upgrade instaloader. - Stop restarting. The controller starts from zero every run, so a cron job that relaunches every few minutes undercounts. Run one long process.
- Get off cloud IPs for anonymous jobs. A job that fails on a VPS may run fine from a home or office connection.
- Consider a residential proxy, with eyes open. Instaloader has no proxy flag. It uses Python's
requests, so people usually set theHTTPS_PROXYenvironment variable. It can work, but you're now paying for proxy bandwidth and still handling every block yourself. - Keep the session file. If you log in, the docs say that with a session file present,
--loginskips "the failure-prone login procedure", and session files "usually do not expire". Logging in fresh on every run invites checkpoints. - Ask for less, slower.
--fast-updatestops each target at the first already-downloaded post,--no-videosand--no-video-thumbnailsskip video downloads, and--max-connection-attempts(default 3) caps retries. You can also subclassinstaloader.RateControllerto sleep longer between queries.
If that gives you a stable job, keep Instaloader. If you're still fighting 401s on a server, read on.
Which Instaloader alternative fits your job?
Start with what you're actually trying to do.
You want media files. The tools that rank for "Instaloader alternative" are mostly downloaders: gallery-dl and yt-dlp (open-source command-line tools), Cobalt for one-off links, and older projects like InstaLooter. They're fine for saving a reel, but they request Instagram from your IP too, so they hit the same limits on the same server.
You want the official route. The Instagram Platform APIs from Meta work for Business and Creator accounts you manage, and Business Discovery returns basic data about other business accounts. They need a Meta app and a token, and they won't return arbitrary personal profiles. We cover the split in Instagram Graph API vs a scraper API.
You want the private mobile API. People looking for an instagrapi alternative have usually hit the same wall from the other side. instagrapi talks to Instagram's private mobile API through logged-in sessions, and its own README on GitHub warns that "Private API automation is fragile in production".
You want public data as JSON from a server. That's where a hosted API fits. A public social data API is a hosted service that returns public data as structured JSON, so your code never holds an Instagram session or meets Instagram's rate limits directly. Scrape Everything is a REST API for public social media data across 9 platforms, Instagram included. Apify's Instagram actors are the other common hosted pick; we compare them in our Apify alternative post.
| Instaloader | instagrapi | Scrape Everything API | |
|---|---|---|---|
| What it is | Open-source Python CLI and library | Open-source Python wrapper for web and private mobile APIs | Hosted REST API, JSON over HTTPS |
| Login needed | No for public data; yes to avoid stricter anonymous limits | Authenticated sessions | No. Public data only, no Instagram account |
| Whose IP and account take the block | Yours | Yours | Not yours. You send a username or link; blocks and timeouts are refunded |
| Throttling you handle | 429, 401 "Please wait", checkpoints | Challenges, rate limits, device state | Your plan's limit: 60 req/min and 5 concurrent on Free, 300 req/min and 20 concurrent once purchases reach $19.99 |
| Cost | Free, plus servers and proxies | Free, plus servers, proxies and accounts | 1 credit per profile, post or comments call; 2 per posts or reels list. From $19.99 for 25,000 credits, credits never expire |
| Private accounts, stories, full comment threads | Possible when logged in with access | Possible when logged in with access | No. Private accounts return profile fields only; comments capped at the 15 newest top-level |
| Bulk media downloads | Yes, its main job | Yes | Returns media URLs; video_url from instagram.reel is a signed link that expires, so download it promptly |
The last two rows decide it. Archiving every story and reply from accounts you follow needs a login, so a public-data API won't do it. Pulling public stats, posts, reels and top comments for 2,000 accounts a week from a server is where Instaloader struggles and an API doesn't. For more hosted options, see our best Instagram scraper APIs roundup.
What does that 2,000-account weekly job cost?
Here it is priced with our published pack rates: Builder ($19.99 for 25,000 credits, $0.80 per 1k) and Growth ($299 for 500,000, $0.60 per 1k). A month is 4.33 weeks.
| Weekly job, 2,000 public accounts | Credits per account | Credits per month | At Builder rate | At Growth rate |
|---|---|---|---|---|
Profile stats only (instagram.profile) | 1 | about 8,660 | about $6.90 | about $5.20 |
Profile + recent posts (instagram.photos) | 2 | about 17,320 | about $13.80 | about $10.40 |
| The full script below (photos, reels, 3 comment calls) | 7 | about 60,620 | about $48.50 | about $36.30 |
The full script makes 5 calls per account, so 10,000 calls a week. At 60 req/min that's at least 2 h 47 min of wall time; at 300 req/min, about 33 minutes. Re-runs inside your cache_days window are free, so a crashed job doesn't double the bill. The credit calculator runs the same math for your own mix. On the Instaloader side the software is free; you pay in servers, proxies and account risk.
How do Instaloader fields map to the API's JSON?
Porting is mostly renaming. Left: attributes from Instaloader's structures docs. Right: fields the Instagram scraper API returns.
| Instaloader | Scrape Everything field | Endpoint |
|---|---|---|
Profile.userid | id (string) | instagram.profile |
Profile.username / full_name / biography / external_url | same names | instagram.profile |
Profile.followers / followees / mediacount | follower_count / following_count / post_count | instagram.profile |
Profile.is_private / is_verified / is_business_account | same names | instagram.profile |
Profile.business_category_name | category_name | instagram.profile |
Profile.get_posts() | posts[] (up to 60, newest first) | instagram.photos |
Profile.get_reels() | reels[] (up to 50) | instagram.reels |
Post.shortcode / owner_username | same names | instagram.post |
Post.likes / comments / video_view_count | like_count / comment_count / view_count | instagram.post |
Post.date_utc | taken_at (Unix seconds) | instagram.post |
Post.get_comments() | comments[] (max 15 newest top-level) | instagram.comments |
PostComment.text / created_at_utc / likes_count | text / created_at / like_count | instagram.comments |
Two gotchas. Dates are Unix seconds, so wrap them with datetime.fromtimestamp(x, timezone.utc). And captions in the instagram.photos list are trimmed to 300 characters; call instagram.post with the shortcode for the full text.
How do you call it from cURL and Python?
Check your key with one call to the Instagram profile endpoint (1 credit):
curl -X POST https://api.scrapeeverything.com/v1/instagram/profile \
-H "Authorization: Bearer $SCRAPEEVERYTHING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "example_user"}'Response shape, trimmed, with values replaced by placeholders:
{
"success": true,
"data": {
"id": "1234567890",
"username": "example_user",
"full_name": "Example User",
"is_private": false,
"is_verified": false,
"category_name": "Photographer",
"follower_count": 18240,
"following_count": 412,
"post_count": 386
},
"meta": { "request_id": "req_...", "cached": false, "credits_charged": 1, "credits_remaining": 99 }
}Now the Instaloader-style loop. instagram.photos returns every profile field plus recent posts, so you skip the separate profile call. Then it reads the Reels tab and pulls comments for the three newest posts.
import os
import requests
from datetime import datetime, timezone
API = "https://api.scrapeeverything.com/v1/instagram/"
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPEEVERYTHING_API_KEY']}"}
def call(action, body):
r = requests.post(API + action, json=body, headers=HEADERS, timeout=60)
if "application/json" not in r.headers.get("content-type", ""):
raise RuntimeError(f"{action}: HTTP {r.status_code}, non-JSON response")
payload = r.json()
if not payload.get("success"):
# NOT_FOUND / PRIVATE_ACCOUNT are billed (the lookup completed);
# blocks, timeouts and server errors are refunded automatically
raise RuntimeError(f"{action}: {r.status_code} {payload.get('code')}")
return payload["data"]
username = "example_user"
# Profile fields + 24 recent posts (max 60), 2 credits
profile = call("photos", {"username": username, "limit": 24, "cache_days": 1})
print(profile["username"], profile["follower_count"], "followers")
# Reels tab with view counts, 2 credits
reels = call("reels", {"username": username, "limit": 12})
top_reels = sorted(reels["reels"], key=lambda x: x["view_count"] or 0, reverse=True)[:3]
for reel in top_reels:
print("reel", reel["link"], reel["view_count"], "views")
# Comments on the three newest posts, 1 credit each
# (like_count is usually null in this list; instagram.post has it)
posts = profile["posts"][:3]
for post in posts:
data = call("comments", {"shortcode": post["shortcode"], "limit": 15})
for c in data["comments"]:
when = datetime.fromtimestamp(c["created_at"], timezone.utc) if c["created_at"] else None
text = c["text"] or c["gif_url"] or "" # GIF-only comments have empty text
print(post["shortcode"], c["author"]["username"], when, text[:80])That's 2 + 2 + 3 = 7 credits per account, so the 100 free credits cover about 14 accounts, more without the reels call.
Each comment carries id, text, created_at, like_count, reply_count, gif_url and an author object. Expect reply_count to be null: it was null on every comment we sampled. Commenters' display names aren't returned at all. If your code read PostComment.owner.full_name, there's no equivalent.
Rather not write the loop? The same endpoints work through the MCP server for Claude and other agents and the CLI (npx scrapeeverything). For bulk profile lookups, see scraping Instagram profiles with an API.
Get 100 free credits. No payment details needed; sign in with Google or GitHub.
FAQ
Is "Please wait a few minutes before you try again" an Instaloader bug?
No. It's Instagram refusing a client it's throttling, reported by Instaloader. Updating, slowing down, reusing a session file and running anonymous jobs from a non-cloud IP all follow the docs' advice, but no setting removes it for good.
How long does the Instaloader block last?
Instagram doesn't publish block durations or request limits, and forum numbers are guesses. Stop the job, wait, and don't restart in a loop: each restart resets Instaloader's count while Instagram keeps its own.
Does logging in fix Instaloader rate limits?
The docs say logged-in access doesn't seem to face the stricter limits on anonymous cloud, VPN and proxy traffic. It also ties every request to your account, which can be challenged or restricted. Use it for your own account, not for collecting other people's data.
Is an API a good instagrapi alternative for public data?
For public profiles, posts, reels and comments, yes: a no-login API skips the sessions, device state and challenges instagrapi's README warns about. For DMs or posting there's no public-data substitute; those need an account by design.
Can the API get private accounts, stories or follower lists?
Mostly no. Private accounts return public profile fields with is_private: true and no posts, and stories aren't returned. Follower lists are available through instagram.followers (3 credits per page of up to 50), but private accounts return 404 PRIVATE_ACCOUNT and large verified accounts show only about the first 50. Comments stop at the 15 newest top-level ones per post.
Can I keep Instaloader and use the API only when it fails?
Yes. Catch the exception and fall back to the matching endpoint:
import instaloader
from instaloader.exceptions import ConnectionException
L = instaloader.Instaloader()
def get_profile(username):
try:
p = instaloader.Profile.from_username(L.context, username)
return {"username": p.username, "follower_count": p.followers, "post_count": p.mediacount}
except ConnectionException:
return call("profile", {"username": username}) # call() from the script abovePricing for larger packs is on the pricing page.