0

I am getting the feed of Instagram using the Facebook Graph API in PHP. But I am can not get the thumbnail of the image. But I have received the full image of the feed.

I am using the below API to get the feed.

https://graph.facebook.com/5.0/INSTA_ACCOUNT_ID?fields=biography,followers_count,name,profile_picture_url,username,tags,ig_id,id,media_count,website,follows_count,media{comments_count,caption,id,ig_id,is_comment_enabled,like_count,media_type,media_url,permalink,owner,shortcode,thumbnail_url,timestamp,username,children{caption,comments_count,ig_id,id,is_comment_enabled,like_count,media_type,media_url,owner,shortcode,thumbnail_url,timestamp,children{ig_id,is_comment_enabled,comments_count,caption,id,like_count,media_type,media_url,owner,permalink,shortcode,thumbnail_url,timestamp,username}},comments{hidden,id,like_count,media,text,timestamp,user,username}}&access_token=ACCESS_TOKEN

I have also noticed one thing that I have fetched "thumbnail_url" only for the video type of post.

I have also checked the media related API.

https://graph.facebook.com/POST_ID?fields=caption,id,media_url,media_type,permalink,thumbnail_url,timestamp,username,children{media_url}&access_token=ACCESS_TOKEN

But I have not received the thumbnail URL of the image from above API.

Thank You.

Bhavin Thummar
  • 1,255
  • 1
  • 12
  • 29
  • _“I have also noticed one thing that I have fetched "thumbnail_url" only for the video type of post.”_ - you mean to say, for those types of posts it _is_ working? Well that would be in line with the documentation, which says that `thumbnail_url` is only _available_ for that particular type to begin with. – 04FS Sep 21 '20 at 11:14
  • @04FS Yes. My means that thumbnail_url is only coming for the video type of post. – Bhavin Thummar Sep 22 '20 at 05:57
  • Do you have idea about it how can I get for all other post like Phots? – Bhavin Thummar Sep 22 '20 at 05:58
  • There is no thumbnail for other types of post. You can only use the original image then, if you get one. – 04FS Sep 22 '20 at 06:23
  • @04FS Thank you for the confirmation. Do you have any idea where is thing or confirmation is mentioned in the documentation of facebook or any other places? – Bhavin Thummar Sep 22 '20 at 07:06
  • 1
    https://developers.facebook.com/docs/instagram-basic-display-api/reference/media#fields – 04FS Sep 22 '20 at 07:08
  • Yes Thank you very much. I have got the line where mention one thing "The Media's thumbnail image URL. Only available on VIDEO Media." for "thumbnail_url". – Bhavin Thummar Sep 22 '20 at 07:12
  • How to get image and video thumbnail using graph api: https://stackoverflow.com/a/65178187/2866272 – Tiam Dec 07 '20 at 08:27

0 Answers0