通过主题标签检索 Instagram 媒体

Retrieve Instagram media by hashtag

我正在尝试获取带有一些具体#hashtag 标记的 Instagram 帖子,以在我的应用程序中构建自定义提要。

这可以使用旧版 API: https://www.instagram.com/developer/endpoints/tags/. However, according to developer documentation, Instagram deprecates its own API in favour of new Graph API. I don't see any direct replacement for this. The closest thing is the "Mentions API" (https://developers.facebook.com/docs/instagram-api/mentions),您可以从中获取提及贵公司的媒体(通过 comment/caption 中的@company 或提及公司名称在照片本身上)。

那么,除了传统 API 之外,还有其他可行的替代方法来获取带有 #hastag 标签的用户媒体吗?

提前致谢。

据我所知,没有可靠的方法来重现通过标签获取图片。请记住,新图表 API 仅适用于 Instagram 企业帐户。它不适用于常规 Instagram 帐户。

另一件事是旧 Instagram API 中的 /tag 端点需要 public_content 权限。不幸的是,禁止提交具有此功能的新应用程序 - https://www.instagram.com/developer/changelog/。现在对于旧版 Instagram API,您只能使用基本权限。

恕我直言,唯一的方法是通过脚本 运行 在您的服务器上抓取标签页的内容。然而,这不是理想的解决方案,应该避免。过多的请求可能会导致阻止您的服务器 IP。

2019 年 4 月 24 日更新

Instagram 图表 API 现在包含标签搜索 API,因此您可以按标签获取图片。可在此处找到此功能的文档:https://developers.facebook.com/docs/instagram-api/hashtag-search