Search code examples
instagram-api

How to get user's media through Instagram Api?


I can see my media using

https://api.instagram.com/v1/users/self/media/recent/?access_token=**MY_ACCESS-TOKEN**

I want to get user's media, so I use this

https://api.instagram.com/v1/users/**ID_USER**/media/recent/?access_token=**MY_ACCESS_TOKEN**

I get an error, because his account is private

{"meta":{"error_type":"APINotAllowedError","code":400,"error_message":"you cannot view this resource"}}

But I follow him, so I should see his media. What should I do ?


Solution

  • the following link works for me without any authentication

    https://www.instagram.com/{username}/media/