skip to Main Content

I want to run the following search query using Facebook Graph API

“pages liked by people who like microsoft”

I can run this query from within facebook. Is it possible to retrieve the same information using the Graph API?

Thank You.

2

Answers


  1. No, there is no way. You can only search for people by name with the Graph API.

    Docs: https://developers.facebook.com/docs/graph-api/using-graph-api#search

    Login or Signup to reply.
  2. I agree with everybody that there is no direct way of checking whether a particular user has liked a certain page or not using FB Graph API.

    But i believe there is a workaround for this and you can try to hit the below URL in your browser

    https://www.facebook.com/search/<page_id>/likers?ref=about
    

    It will return all the people information who have liked the page provided. I am not sure would this return all the results or just some of them. But i believe you can try this.

    You can then do some web scraping which will help you indentify whether ‘person A’ has liked a page say ‘abc’.

    Now you can hit the below endpoint to retreive all the likes this ‘person a’ has liked

    FB.api('/person_id_obtained_from_above/likes')
    

    But please note that you need user_likes permission to retrieve someone else’s likes

    Let me know if this worked for you.

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