How to get instagram username from username ID without API in Python?

Viewed 8093

I'm trying to find a way to get instagram username from the username ID in Python. What I found so far is this:

https://api.instagram.com/v1/users/[USER-ID]?access_token=[YOUR-ACCESS-TOKEN]

I have a token number, but it only works for users added to sandbox. For other users I receive the following error:

{"meta": {"code": 400, "error_type": "APINotFoundError", "error_message": "this user does not exist"}}

I'm searching a solution for hours with no luck so far. Is there a way to arrive to the same result without using a token?

Thanks a lot!

3 Answers

In my case I am getting data from tagFeed so I have picture code. If you have picture code of any of user's post then you can get username like this

https://www.instagram.com/p/picCODE/?__a=1

example: https://www.instagram.com/p/BaGce-NlMg7/?__a=1

it will return a JSON with the owner - username

Related