English 中文(简体)
How can I retrieve the number of fans my Facebook page had on a given day?
原标题:

How can I retrieve the number of fans my Facebook page had on a given day? I am trying to find a way to display a plot of date vs number of fans, but I can t find a way to get the number of fans by date.

I have tried this:

select active_users from metrics where end_time = 1263812045 and period = 2592000

in the Facebook developers tools page for my Page ( http://developers.facebook.com/tools.php ), but it retrieves an empty set.

最佳回答

Firstly: you can retrieve statistics such as active users for apps, but it won t tell you how many fans your page has. To retrieve fans you need to query the fan_count column of the page_fan FQL table, but you can t get historical data, only a total count. So you ll need to query it every day and build up your own database.

If, from the original query, you really wanted active users for an app, it s not particularly straightforward as the FQL query barfs at a lot of timestamps. The metrics FQL table documentation claims that you need to enter midnight PST timestamps, but I ve found that it accepts 2am GMT and nothing else. E.g. select active_users from metrics where end_time = 1263715200 and period = 2592000 works for me on both apps and pages, but note as above: this retrieves an active user count and not the number of fans.

问题回答

For people finding this question now: It s possible if you have read_insights permission. Then you can use FQL to query fan count, adds, removes and many other things:

https://developers.facebook.com/docs/reference/fql/insights/#page_users

You can execute FQL queries using https://graph.facebook.com/fql?q=THE%20Query

That s not possible, I m sorry. You have to manually pull the data on a daily basis and write it to a database. That s the only way to create such a graph.

There s already a service called PageData.

SELECT fan_count, page_url FROM page WHERE page_id=1234567890"





相关问题
Facebook Connect login dialog not working

I am using Facebook Connect for iPhone and following the official instructions. I use the following code to display the login dialog: FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:...

Facebook App Profile Tab is Empty ... No Content Displayed?

I can view my application via the http://apps.facebook.com/myapplication/ link and the content shows up correctly. I also added the application as a tab to a facebook page. However, when viewing the ...

Facebook Platform error: "Object cannot be liked"

I m working on a Facebook Application that generates wall posts. In testing these posts, I ve discovered that the Facebook Platform action of "liking" a post is failing. The specific error message ...

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php include_once ./facebook-platform/php/facebook.php ; $facebook = new Facebook(my ...

Facebook connect

If I plug in the facebook connect into my website, How can I prevent double signups? Lets say I have a user that s already signed up to my site but he clicked the connect with facebook, is there a ...

热门标签