Get facebook posts and total likes for each post

I am trying to get posts on Facebook with the number of comments and likes for each post.

For likes, there are parameters that I can pass, these are summary = true and total_count . I tried this

page_id?fields=posts.limit(1).summary(1) 

but nothing comes back.

I can not write FQL, as it will become obsolete soon. I am writing a PHP API.

+6
source share
2 answers

You can get the total by passing arguments like

 ?fields=likes.summary(1),comments.summary(1), $fbtimeposts = (new FacebookRequest($session, 'GET', "/me/feed?fields=likes.summary(1),comments.summary(1),story,link,comments,likes,source,picture,type,status_type,application,message,message_tags,name,caption,actions,from,feed_targeting,full_picture,description,updated_time,created_time,id,object_id,parent_id,place,story_tags,targeting,with_tags&limit=10&date_format=U&limit=10&date_format=U"))->execute()->getGraphObject()->asArray(); 

I hope the example above helps you in something !!!!

+3
source

You can try this

 ?fields=likes.limit(0).summary(1),comments.limit(0).summary(1) ?fields=likes.limit(0).summary(true),comments.limit(0).summary(true) 
0
source

Source: https://habr.com/ru/post/983205/


All Articles