无法访问从 instagram 主题标签搜索返回的媒体对象 api

unable to access media object returned from instagram hashtag search api

我正在尝试从 instagram 主题标签搜索中获取媒体 api,我得到的响应是正确的,但我无法访问媒体对象。它说

   "Unsupported get request. Object with ID '18001051678085904' does not 
     exist, cannot be loaded due to missing permissions, or does not support 
     this operation. Please read the Graph API documentation at 
    https://developers.facebook.com/docs/graph-api",
    "type": "GraphMethodException",

这就是我查询的方式 18001051678085904?fields=id,media_type,media_url 其中 18001051678085904 是我从 instagram 标签搜索 api 的响应中获得的媒体对象,我也获得了 public 的许可] 内容访问和 Instagram 基础知识

您需要 2 个 ID 才能正常工作。

  1. 话题标签 ID
  2. 页面 id(facebook 图:instagram 企业帐户 id)

图形查询资源管理器:

v3.1/hashtag_id/recent_media?fields=id,caption,like_count,media_type,media_url,固定链接,comments_count&user_id=page_id;

URL 命中:https://graph.facebook.com/v3.1/hashtag_id/recent_media?access_token=access_token&fields=id,caption,like_count,media_type,media_url,permalink,comments_count&user_id=page_id;

请注意,您可以搜索 recent_media 或 top_media

如果问题解决了请告诉我。

要添加到 Nitin Tokas 答案,您可以使用主题标签搜索请求的字段是

/top_media?user_id=#####&fields=id,caption,comments_count,like_count,media_type,media_url,permalink

(参见 https://developers.facebook.com/docs/instagram-api/reference/hashtag/top-media

尝试访问其他字段(如用户名或时间戳)会使请求失败并显示

"message": "(#100) Please read documentation for supported fields"

事实上,尝试单独访问每个生成的媒体都失败了

"message": "Unsupported get request. Object with ID ### does not exist, cannot be loaded due to missing permissions, or does not support this operation"