9

I needed to pull the fan count for particular fan pages on Facebook. After digging through the API, I couldn't find a way to do this with the API "proper." Instead I fell back to a FQL query, and it worked quite well.

select fan_count from page where page_id = <FAN_PAGE_ID>

What did I miss about the Facebook API. Is this the only way to capture a fan count for a page? In general, how often do you use FQL for your requests as opposed to the exposed API methods?

Ryan McGeary
  • 235,892
  • 13
  • 95
  • 104

1 Answers1

12

https://graph.facebook.com/cocacola

"fan_count" property. replace cocacola with your fan page's ID.

Please note that this property is being changed to "likes" in the November 2010 Roundup migration:

Graph API: The fan_count attribute on the Page object will be renamed to likes.

You can opt in to the November Roundup in your application's advanced settings page.

typeoneerror
  • 55,990
  • 32
  • 132
  • 223
  • 1
    Thanks. It required Facebook to build a whole new API to support answering this question ;-) – Ryan McGeary Jun 18 '10 at 21:47
  • 1
    At the time I'm posting this comment, I believe that this answer is out of date as there is no fan_count property on the linked page. – mgilson Feb 24 '14 at 19:02
  • @mgilson cleary states that "fan_count" was changed to "likes" in November 2010, so it's not incorrect. – typeoneerror Feb 25 '14 at 22:13