我正在尝试从 Instagram
上的任何用户那里获取带有特定主题标签的任何照片,但是当我转到:
https://api.instagram.com/v1/tags/{hashtag}/media/recent?access_token=ACCESS_TOKEN
我只得到我的照片。
最佳答案
如果您的应用程序处于沙盒模式
,那就说明了这一点。
请求的行为/tags/{tag-name}/media/recent
更改为仅返回来自沙盒用户的标记帖子。
这对于所有其他 API 请求也是正确的;当应用处于沙盒模式
时,API 的行为就好像沙盒用户是 Instagram 上的唯一用户一样。
来自documentation
:
As another example, let's consider an endpoint that returns a list of media:
/tags/{tag-name}/media/recent
.
The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.
您可以使用 Instagram API console (APIGEE)
查看此请求返回具有不同身份验证类型的公共(public)数据。
另外,请注意,如果您的应用程序所做的只是显示来自 Instagram 的公共(public)内容,那么 Instagram
将不会在沙盒模式之外批准该应用程序。
关于python - 从 Instagram API 获取带有标签的公共(public)图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35935044/