How to get user's media through Instagram Api?

混江龙づ霸主 提交于 2019-12-08 06:08:58

问题


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 ?


回答1:


the following link works for me without any authentication

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



回答2:


Before getting the access token, did u include the scope in getting the access code like the call of api below?

https://api.instagram.com/oauth/authorize/?client_id=[]&redirect_uri=[]&response_type=code&scope=public_content

You must set the scope of permission to public content in order to access other user's media.



来源:https://stackoverflow.com/questions/34827137/how-to-get-users-media-through-instagram-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!