I am working on a script that gets the amount of likes (or comments, shares) a public facebook photo has.
The photo is posted on a page, for example: https://www.facebook.com/photo.php?fbid=10151848827816729. These are viewable to the public and so it should be possible to get the amount of likes it has via Javascript.
Note that the Facebook Graph API does not return the amount of likes it has: https://graph.facebook.com/10151848827816729
Part of the Oct. 2, 2013 Breaking Changes is:
That works for your photo as well, https://developers.facebook.com/tools/explorer?method=GET&path=10151848827816729%3Ffields%3Dlikes.limit(1).summary(1) gives you
as part of the
likes
structure in the return data. (limit(1)
because you are only interested in the overall likes count, so requesting more individual likes would just waste bandwidth –1
is the minimal amount of actual like data to fetch, using0
would be the same as no limit and deliver the default first 25 likes.)Be aware that you have to have the corresponding migration enabled in your app settings for that to work.
Wrong "Like count" in Facebook Album Stream