skip to Main Content

I have website page where I put Facebook Like plugin – so that people can see and press this button on my website’s page

enter image description here

I also want to get list of people who liked/recommended my website’s page (not facebook page) using Facebook API.

For example: on my website page i see this button and text that 3 of my friends and other 20 people liked this. So if I open this URL

https://graph.facebook.com/v2.8/?id=MY_WEBSITE_PAGE_URL

I will get JSON file like

og_object: {
id: "11******038",
description: "some text",
title: "some title",
type: "article",
updated_time: "2017-03-23T06:29:16+0000"
},
share: {
 comment_count: 0,
 share_count: 23
},
id: "MY_WEBSITE_PAGE_URL"

So there are 23 people who liked this page on my website. And it seems to be fine but I don’t understand what happens when I try to get list of this 23 people.

As now I have og_object->id I can get list of likers for this object from URL

https://graph.facebook.com/v2.8/og_object->id/likes?access_token=MY_ACCESS_TOKEN&summary=true

And I see JSON where is list of 13 users with names and their ID’s and also block

summary: {
total_count: 13,
can_like: false,
has_liked: false
}

So as you can see – there is only 13 people but there was 23. This numbers are changing from page to page – so it can be 40 shares count but only 15 people in likers list.

Why is it happening? Maybe there are some limitations that facebook users enables so that their likes can’t be seen?

2

Answers


  1. According to Jonathan Dean this is not possible due to privacy reasons
    See the full answer here: https://stackoverflow.com/a/6737579/695046

    Login or Signup to reply.
  2. The short answer is that you are already correctly requesting and receiving the names of all 13 people who have clicked your “recommend” button (liking the web page), but the share count of 23 you are seeing is an aggregate of shares, likes, and comments, not just the likes.

    Here’s a more detailed explanation.

    As moonvader commented, Jonathan Dean’s answer to this previous question (How to list facebook users who like a page or interest) is incorrect or outdated. You can, in fact, retrieve a list of names and user IDs of people who like a specific Open Graph object.

    However, to start addressing moonvader’s question, the share count and the like count are measuring different things.

    The Facebook Graph API page on URLs has this to say about share count,

    This number is an aggregation of shares, likes, and comments for the URL. This number is approximate.

    And Facebook’s Graph API page on sharedposts says that in order to access user information about people who have shared an Open Graph object in a post you’ll need:

    A user access token with user_posts permission, for someone who is able to view the post after privacy settings are taken into account.

    That means to view the user id for shared posts, you would need permission access to the posts of everyone who shared it, which isn’t feasible in the real world.

    Although the 10 shares and comments are inaccessible, clicking a “recommend” button on a web page triggers a like on the object. This means moonvader is already correctly accessing all 13 users who clicked the “recommend” button.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search