python - 从 Instagram API 获取带有标签的公共(public)图片

标签 python instagram instagram-api

我正在尝试从 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 将不会在沙盒模式之外批准该应用程序。

enter image description here

关于python - 从 Instagram API 获取带有标签的公共(public)图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35935044/

相关文章:

OAuth Instagram API 在未登录浏览器的情况下连接 Instagram 时删除重定向 URL 中的参数

instagram - API 标签端点错误 - min_id 不是此标签的有效游标

python - Python 模块和 Python 包有什么区别?

python - 如何替换或编辑 django rest 框架路由器中的查找参数?

python - 如何使用 Pandas Rolling 显示随时间推移而降级的列值?

ios - 如何在 ios 中的 instagram 上分享?

python - 如何使用 Selenium 在 Instagram 弹出框架中向下滚动

javascript - 如何将 Instagram API 用于静态单页应用程序?

python - 使用 gnp_random_graph 创建多个图

javascript - Instagram iphone Hook