How does one retrieve the fan_count for a Facebook application page using the Graph API?

前端 未结 2 404
迷失自我
迷失自我 2021-01-26 16:45

I need to retrieve the number of fans for a given Facebook application. Using the GraffitiWall application example in the Facebook Graph API, that page displays a fan total numb

2条回答
  •  天涯浪人
    2021-01-26 16:58

    You can get number of fans by running FQL on page table:

    FB.Data.query("select fan_count from page where page_id = 2439131959");
    

    (fan_count is undocumented field btw, either it is deprecated or they just forgot to mention it in their docs which wouldn't surprise me much)

    Not sure if you were asking about likes as well, but just in case here is an example how to get number of likes by url:

    FB.Data.query('select like_count from link_stat where url="http://www.facebook.com/graffitiwall"');
    

提交回复
热议问题