Ad

Unable To Access Media Object Returned From Instagram Hashtag Search Api

I am trying to get the media from instagram hashtag search api, i am getting the response correctly but i am unable to access the media object. it says

   "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",

this is how i am query 18001051678085904?fields=id,media_type,media_url where 18001051678085904 is the media object i get from response of instagram hashtag search api, also i have the permission of public content access and instagram basics

Ad

Answer

you will need 2 id's to get it working.

  1. hashtag id
  2. page id(facebook graph: instagram business account id)

graph query explorer:

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

URL to hit: 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;

Please note that you can either search for recent_media or top_media

Let me know if it solves the problem.

Ad
source: stackoverflow.com
Ad