0

I am trying to write a quick script that would help me pick up random people who liked a post on my page for an award (your typical giveaway).

So far I have been trying to get used to the FB API, so I am using Facebook Graph Explorer. I have managed to generate a Page token (I am the admin of the group) and tried to get some information about the posts on the Page

{page-id}/posts?fields=id,message,created_time,shares,likes{name}&limit=2

The response, however, misses the likes key, and on the left hand side where you can add the fields (graph explorer new UI), likes becomes greyed out. All other keys are returned as requested.

I haven't found any mention of the depreciation of this field for the page owners. Do I need any additional credentials?

Julia
  • 317
  • 1
  • 12
  • Why do you have `{name}` in there? According to FB API docs: `Only aggregated counts using 'total_count' with the 'summary' parameter are available for Post likes.` https://developers.facebook.com/docs/graph-api/reference/v3.3/object/likes – Ashley May 17 '19 at 21:55
  • @Ashley, `name` was a suggested "sub-field" by the explorer. I have tried removing the `name` field but it didn't change the output – Julia May 17 '19 at 21:58
  • Hmm, I'm thinking that it's because you have targeted "posts" instead of your page or a single post - the list of posts belonging to your page probably don't have any likes linked to them. EDIT - nevermind, I'm stumped, sorry! Maybe this can help you out: https://stackoverflow.com/questions/17755753/how-to-get-likes-count-when-searching-facebook-graph-api-with-search-xxx – Ashley May 17 '19 at 22:05
  • @Ashley thank you for your suggestions! that post is from 2013... the API has changed 100500 times since then – Julia May 17 '19 at 22:22

0 Answers0