Take the 2-minute tour ×

I'm trying to get demographics for fans of a page on Facebook - mostly country and city, but age and gender as secondary.

The primary way to do it is using FQL and doing a query in the insights table. Like so:

    method: 'fql.query', 
    query: "SELECT metric, value FROM insights WHERE object_id='288162265211' AND metric='page_fans_city' AND end_time=end_time_date('2011-04-16') AND period=period('lifetime')"
}, callback);

The problem with this, however, is that the table returns a maximum of 19 records only, both for the country and the city stats. The response for a page I'm testing is as such:

      "metric": "page_fans_city",
      "value": {
         "dallas": "12345",
         "atlanta": "12340",
         "miami": "12300"

So I'd like to know if there's any alternative to that -- to get demographics of the current fans of a page (no snapshot necessary).

Things I've tried:

  • Using LIMIT and OFFSET on the query do nothing (other than, sometimes, give me an empty list).

  • One alternative that has been discussed in the past is to use the "/members" method from the Graph API (more here) to get a list of all users, and then parse through that list. That simply doesn't work - a method exists, and it may have worked in the past, but it's not valid anymore (disabled?).




        "message":"(#604) Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http:\/\/developers.facebook.com\/docs\/reference\/fql "
  • Other solution was to do a query to the page_fan table and filtering by page_id. This doesn't work, either; it may have worked in the past, but now it says that the page_id column is not indexable therefore it cannot be used (same error as above, which leads me to believe /members uses the same internal API that has been disabled). Page_fan query is only useful to check if individual users are fans of a page.

  • There's also the like table, but that's only useful for Facebook items (like posts, photos, links, etc), and not Facebook Pages.

  • Going to the insights website about the Page, you can see the data in some nice graphs and tables, and download an Excel/CSV spreadsheet with the historic demographics data... however, it also limits the data to 19 entries (sometimes 20 with a few holes in there as cities trade top positions though).

Any other hint on how to get that data? I'd either like the insights query with more results, or at least a way to get all the page fans so I could do the location query myself later (even if the page I want to get it from has almost 5 million fans... gulp).

share|improve this question
Here is [the best answer][1] I found on the subject [1]: stackoverflow.com/a/10906320/244911 –  LE GALL Benoît Aug 19 at 14:44

1 Answer 1

The data pipeline for this metric is currently limited to 20 items. This is a popular feature request and something Facebook hopes to improve soon.

share|improve this answer

Your Answer


