Instaloader 401 Unauthorized, 429 and "Login required": what to do
Checked on 2026-11-19.
These messages are Instagram refusing a request, not a mistake in your script. A 401 with "Please wait a few minutes before you try again." and a 429 mean Instagram will not serve this session or this address right now. "Login required" means the data is shown to logged-in users only. Below: what Instaloader's own documentation recommends, and what is left when that is not enough.
What each message means
| What you see | What it is |
|---|---|
401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." | Instagram's answer, passed on. Instaloader prints the HTTP status with the status and message of Instagram's reply, retries, and then raises a ConnectionException. |
429 Too Many Requests | Instagram's rate limit. Instaloader waits and retries by itself, with the advice "Please do not run multiple instances of Instaloader in parallel or within short sequence." |
Login required. or Redirected to login page. Use --login or --load-cookies. | A LoginRequiredException: you asked for something Instagram does not serve to logged-out visitors. The documentation marks what needs a login: hashtags, locations, stories, highlights, comments, geotags, your feed and saved posts, follower and followee lists, and private profiles. |
400 Bad Request - "fail" status, message "feedback_required", also checkpoint_required and challenge_required | Instagram is restricting the session or asking the account for a check. Instaloader ends the whole run on these, in the words of its source "to stop producing more requests". |
Too many queries in the last time | Not an error. The documentation calls it "a notice that the rate limit has almost been reached, according to Instaloader's own rate accounting mechanism". |
The troubleshooting page has no entry for the 401. The issue tracker has: the report titled with this exact message, #2511, has been open since February 2025 and is labelled a bug, and people in it get the error with and without a login. A comment in the code of version 4.16 describes one of Instagram's addresses for profiles the same way: it "is refused with HTTP 400 for some professional profiles, and with HTTP 401 or 429 for some sessions, both anonymously and when logged in". How long the wait is, neither the message nor the documentation says.
What Instaloader's documentation recommends
1. Upgrade first. The page tells you to "make sure to use the current version of Instaloader, especially when encountering many 429 errors". On the day this guide was checked that was 4.16, released on 26 October 2026, whose release notes list fixes for reading a profile's posts with and without a login.
pip3 install --upgrade instaloader2. One instance, and nothing else beside it. The rate controller assumes that nothing else is making requests at the same time, neither Instagram in a browser or an app nor a second Instaloader, and that no requests had been made when it starts. Hence the warning that "restarting or reinstantiating Instaloader often within short time is prone to cause a 429". A loop that starts a new process for every profile does exactly that.
3. Let it wait, or make it stop. After a 429, Instaloader "retries the request as soon as the temporary ban is assumed to be expired". --max-connection-attempts sets how often (3 by default, 0 means without end). For a scheduled job, --abort-on=302,400,429 ends the run on those answers instead of retrying.
4. Mind where it runs. "There have been observations that services, that in their nature offer promiscuous IP addresses, such as cloud, VPN and public proxy services, might be subject to significantly stricter limits for anonymous access. However, logged-in accesses do not seem to be affected." That is the script that works on your laptop and fails on a server.
5. For login errors, keep the session file. "We recommend to always keep the session file which Instaloader creates when using --login. If a session file is present, --login does not make use of the failure-prone login procedure." The other documented way in is --load-cookies, which takes the session of a browser in which you are already logged in.
In a Python script, catch the refusals instead of letting them end the program:
import instaloader
L = instaloader.Instaloader(max_connection_attempts=1) # one try, no waiting
try:
profile = instaloader.Profile.from_username(L.context, "nasa")
print(profile.followers)
except instaloader.ProfileNotExistsException:
print("No such profile")
except instaloader.LoginRequiredException:
print("Instagram shows this to logged-in users only")
except instaloader.ConnectionException as err:
print("Instagram refused the request:", err) # 401 and 429 arrive hereThe state of things in November 2026
Two open reports are worth knowing before you spend an evening on your own setup.
- #2726, opened in August 2026:
Profile.from_username()answers 429 on the very first request, on several networks, with version 4.15.3. Version 4.16 changed how profiles are loaded, and in another thread two users wrote in early November that logged-out downloads worked again after updating to it. - #2792, "login and load-cookies are broken", opened on 30 October 2026 against version 4.16. On 19 November it was still open, with a fix proposed in a pull request that had not been merged.
So if you are on 4.16 and logging in fails, it may not be anything you did.
When that is not enough
- Wait, then try once, from your own computer rather than a server. Retrying in a tight loop is what the rate controller warns against.
- Log in with your own account. For everything that requires a login it is the only route, and the risk is yours: Instaloader is "an independent and unofficial project. Use at your own risk", Instagram can answer a logged-in session with a checkpoint or
feedback_required, and the tracker has reports from people whose accounts were suspended. Read Instagram's Terms of Use before you automate anything with your account, do not use an account you cannot afford to lose, and never one that is not yours. - Use the official API when the account is your own or a business or creator account. The guide on follower counts shows the request, and the one on the Basic Display API's successors what Meta offers and for whom.
- Use an HTTP API when public profile data is all you need, as shown below.
This guide leaves out ways to disguise a script or to hide where it runs. That is getting around Instagram's protection, not fixing an error.
Reading a public profile without Instaloader
If your script only reads profile numbers and the newest posts, an HTTP API can replace it. With Pipefetch one request returns a public profile, from any server, with no Instagram login:
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/instagram/profile",
params={"username": "nasa"},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print("No such account") # not charged
else:
res.raise_for_status()
profile = res.json()["data"]
print(profile["followerCount"], profile["postCount"], profile["isPrivate"])
for post in profile["latestPosts"]:
print(post["publishedAt"], post["url"], post["likeCount"], post["commentCount"])A profile costs 2 credits. An account that does not exist answers 404 and costs nothing, and when Instagram does not answer you get a 502 that is not charged and can be retried. A new account has 100 free credits and needs no card. The reference lists every field.
Where it stops: it does not do what Instaloader is made for. There is no download of an account's whole history: latestPosts is about the 12 latest Reels and the newest grid posts. There are no stories, comments or follower lists, a private account returns its counts, name and bio only, and the media addresses stop working after some hours. It is not an official API, and Pipefetch is not affiliated with Instagram or Meta.
Which one should you use?
| Situation | Use |
|---|---|
| Archiving posts on your own computer | Instaloader, current version, one instance, with patience |
| Stories, saved posts, private profiles you follow | Instaloader with your own login, at your own risk |
| Your own account, or business and creator accounts, officially | The official API |
| Profile numbers and the latest posts of public accounts, from a server | An HTTP API such as Pipefetch |
Try it with 100 free credits. No card needed. No login, cookies or proxies. Get an API key or read the docs.
APIs used in this guide
More Instagram guides
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python