I am unable to access posts from public accounts on Instagram

I am encountering an issue during the execution of the following code.:

import instaloader  
L = instaloader.Instaloader()

username = input("Username: ")

L.download_profile(username, profile_pic_only=False)

Initially, when I implemented the code to retrieve all posts simultaneously, it functioned as anticipated.

However, during the testing phase to achieve my desired objective, the following error has consistently occurred.

JSON Query to graphql/query: Expecting value: line 1 column 1 (char 0) [retrying; skip with ^C]
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?variables=%7B%22data%22%3A%7B%22count%22%3A12%2C%22include_relationship_info%22%3Atrue%2C%22latest_besties_reel_media%22%3Atrue%2C%22latest_reel_media%22%3Atrue%7D%2C%22username%22%3A%22yashinrush9%22%2C%22__relay_internal__pv__PolarisFeedShareMenurelayprovider%22%3Afalse%7D&doc_id=7898261790222653&server_timestamps=true [retrying; skip with ^C]

I would greatly appreciate your assistance with the situation at your earliest convenience.

read the error message

you are not allowed to make requests that often

alternatively, 401 means “Unauthorized”, but if you did not change anything in the credentials, you are making requests too fast

what’s the problem if I make requests too fast.

Despite using the appropriate authentication and required credentials to retrieve the posts, I am still receiving an error. Could you please clarify what might be causing this problem?

if the API has a rate limit, you need to stay in that rate limit to be allowed to use the API

but are you sure you are using the rigth credentials? that would be a reason to get a 401 error

If there is a rate limit in place, it appears that my device is now permanently restricted from retrieving posts.

I can confirm that the credentials being used are correct!

you can try a different device, or contacting Instagram support if you are actually banned

I would also double check that you are sending a request with all the required parts