Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Location info and media, Status 201: JSONDecodeError in public request #2141

Open
aldensiol opened this issue Mar 7, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@aldensiol
Copy link

When trying to obtain location pks via the lat and lng, I am encountering a Status 201 JSONDecodeError. It seems like the Location object is being processed incorrectly somewhere. Running the code in the documentation here leads to the same errors: https://subzeroid.github.io/instagrapi/usage-guide/location.html.

My instagrapi version I am using is the latest afaik.

To Reproduce

# working
location = cl.location_search(59.96, 30.29)[0] 

# erroneous code(s)
location = cl.location_complete(location)
location = cl.location_info(107617247320879)
medias = cl.location_medias_top(107617247320879, amount=2)

Traceback
Error message:

Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/explore/locations/107617247320879/?__a=1&__d=dis) >>> 
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/explore/locations/107617247320879/?__a=1&__d=dis) >>> 
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/explore/locations/107617247320879/?__a=1&__d=dis) >>>

Desktop

  • OS: [e.g. Ubuntu 21.04]
  • Python version [e.g. 3.11.5]
  • instagrapi==2.1.3
@aldensiol aldensiol added the bug Something isn't working label Mar 7, 2025
@paboum
Copy link

paboum commented Mar 16, 2025

Same here for user_id_from_username:

Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/zuck/?__a=1&__d=dis)

@pidgeon777
Copy link

What could be the reason for that? Any fix? @subzeroid

@paboum
Copy link

paboum commented Mar 26, 2025

I noticed similar issue with user_info which simply retried 3 times and then switched to user_info_v1 which uses private API. The fix was to use user_info_v1 in the first place.
In case of user_id_from_username I don't see the _v1 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants