facebookfacebook-graph-api

fetch "liked by this page" of a page using facebook graph API


I've searching for info about that but I cannot find any relevant API function to do this.

I would like to fetch the list of pages that liked by a particular page using API. For example, when I query about the Coca-Cola page, it should return all the "liked by this page" such as will.i.am, spotify...

Thank you so much!


Solution

  • You can only do this with FQL as far as I know, the Graph API has no edge for the liked pages of a page.

    select page_id, name from page where page_id in (select page_id from page_fan where uid="40796308305")
    

    returns

    {
      "data": [
        {
          "page_id": "106593592062", 
          "name": "Coca-Cola Freestyle"
        }, 
        {
          "page_id": "542678889114683", 
          "name": "The Coca-Cola Company"
        }, 
        {
          "page_id": "195768932763", 
          "name": "Live Music Festival"
        }, 
        {
          "page_id": "5120148605", 
          "name": "will.i.am"
        }, 
        {
          "page_id": "8605796091", 
          "name": "Diet Coke"
        }, 
        {
          "page_id": "66681829158", 
          "name": "Sprite"
        }, 
        {
          "page_id": "23550666633", 
          "name": "Fanta"
        }, 
        {
          "page_id": "61124008229", 
          "name": "Coca-Cola Zero"
        }, 
        {
          "page_id": "287552055150", 
          "name": "Coca-Cola light"
        }, 
        {
          "page_id": "6243987495", 
          "name": "Spotify"
        }, 
        {
          "page_id": "42125257610", 
          "name": "Essence Festival"
        }, 
        {
          "page_id": "32237381874", 
          "name": "Kings Dominion"
        }, 
        {
          "page_id": "69421318512", 
          "name": "Six Flags Great Adventure"
        }, 
        {
          "page_id": "123355014367126", 
          "name": "Atlanta Food & Wine Festival"
        }
      ]
    }