I am trying to retrieve the number of likes for posts in a Facebook page. For instance, I am calling the following endpoint from Graph API explorer
nba?fields=posts{message, likes}
to retrieve posts from NBA page. But I only managed to retrieve message
and id
but not the likes. Is it because of new privacy policy?
`
{
“posts”: {
“data”: [
{
“message”: “๐๐๐ฎ Does ANYBODY get better bench reactions than Klay Thompson??
๐: Golden State Warriors x Cleveland Cavaliers Game 3
๐บ: 9 pm/et Wednesday, #NBAonABC”,
“id”: “8245623462_10156593269718463”
},
{
“message”: “๐ธ x #NBAFinals Game 2”,
“id”: “8245623462_10156593260853463”
},
{
“message”: “Game 2 in #PhantomCam! ๐ the BEST of Stephen Curry, LeBron James, & more slowed all the way down.
NBAFinals presented by YouTube TV”,
"id": "8245623462_10156592692223463"
},
{
"message": "George Hill added 15 PTS, 3 AST for the Cleveland Cavaliers in game 2 at Oracle Arena. #NBAFinals presented by YouTube TV",
"id": "8245623462_10156590505838463"
},
{
"message": "๐ฃ Stephen Curry somehow beat the shot clock with this WILD 3-pointer! Hear how it sounded around the world #GlobalGame ๐๐
`
3
Answers
Yes it is, more information than public available (by example the likes, now just called reactions) options will be closed soon.
Yes. You will need admin access (page access token) now to get individual likes.
If you only want the number of likes though, you can ask for the
summary
field:nba?fields=posts{message,likes.summary(1)}
And be aware, you will still need to get your app reviewed for Page Public Content Access, otherwise you wonโt be able to get any info about pages you do not have admin access to. It works using above example link when using the Graph API Explorer app id – but as soon as you switch to one of your own, you will get an error saying you need PPCA, if the app in question isnโt already approved for that.
https://developers.facebook.com/docs/graph-api/reference/v2.12/object/reactions
Likes are call “reactions” now ,(
thumb and , emoji reactions)