How to get page fan count from last week - facebook

I want to get the number of new facebook fans for a given page from last week.
e.g.: monday to sunday of previous week.
I have searched for this but can't find any info.
I can get the total fan count easily from the social graph but not sure how to get new fan count from last week so that I can get a report like:
New fans last week: 152
Total fans: 2341

You have to be admin of that page, and you need the "read_insights" permission. Without user authorization you don´t have access to the Insights, and that´s the only way to get detailed statistics.
https://developers.facebook.com/docs/reference/fql/insights/
Using FQL, it is explained here:
How to get `page_fan_adds` for multiple days using FQL
A bit complicated, because you have to add the daily values. But on the same page, the much easier solution is presented:
bladauhu/insights/page_fan_adds/?since=1340175600&until=1342767600

Related

Facebook fan count on a given date

I am not a programmer and I have literally no idea about the Facebook API. However, I need to collect some data from six different Facebook pages for my thesis, and I'm not the admin of them.
I've managed to get all the statuses, likes, comments of the 6 Facebook pages from a year using:
https://api.facebook.com/method/fql.query?query=select permalink,like_info,comment_info,share_info,created_time from stream where source_id={fan-page-ID} and created_time < {time-in-Unix-timestamp} and actor_id={fan-page-ID} ORDER BY created_time DESC LIMIT 20000&access_token ={your-access-token}
Now I need to get the number of fans the six pages had during the year (the variation). I would like to know how many fans the page had on a certain date. I've found this:
http://api.facebook.com/method/fql.query?format=xml&query=select fan_count,name from page where page_id={fan-page-ID}
And it works but it gives me the number of fans for today, not a certain date that I want. Any idea how can I achieve that? It would be amazing if I could get an XML so I can open it in excel for further analysis.

How to get total number of likes on page posts

Is there a simple way to get the number of likes on posts on a page from the facebook graph API. My current Aproach is to get the feeds of the page, and then for each individual post get the ammount of likes.
So First I itterate all the posts on
--This make this a ton of times as I can only retrive 100 at a time
/{page-id}/feed
And then using each post ID
--Make this request even more times
/{object-id}/likes?summary=true
But this is horribly inneficient and takes a lot for each page.
So basically the question is, can I get the info making less requests?
This works for me:
/{page-id}/posts?fields=message,likes.limit(1).summary(true)

Get a page's average number of posts / day using Facebook API?

I'm trying to figure out a way to calculate a Facebook page's average number of posts per day using the API. The problem is that the API does not show when the page was created. Instead, I'm downloading all the posts and using the oldest post as some sort of creation date (which is not 100 percent correct...).
The problem is when a page adds backdated posts. For instance, someone might post a picture in 2012 that's dated 2008. Then that post will be oldest, even if the page hasn't existed that long.
One solution is to go by the updated_time field instead of created_time, but it's not a great solution that still may not be correct.
Is there someway to get around this?
Sorry if this question has come up before, but I couldn't find anything on it.
Unfortunately what you're looking for isn't possible using the API.
For a given post two dates are returned - created_time and updated_time.
As you rightly pointed out the created_time can be updated to add a post in the past.
updated_time also will not work for you as this gets updated whenever someone comments on a post.
https://developers.facebook.com/docs/graph-api/reference/v2.3/post

Calculate total number of likes on specific date in facebook

I am using Graph API for getting insights of the page. For that i am using link like
https://graph.facebook.com/v2.0/PageID/insights/page_fans/lifetime?access_token=MY_ACCESS_TOKEN&since=2014-07-01&until=2014-07-15
I am getting total no. of like until date.
I want to show the total no. of users liked page in specific date like 2014-07-01,2014-07-02,2014-07-03....
Thanks for help..
You can use the page_fan_adds metric:
GET /{page_id}/insights/page_fan_adds?since=2014-07-01&until=2014-07-15
Have a look at https://developers.facebook.com/docs/graph-api/reference/v2.0/insights#page_users

Is there a limit on how many wall posts(from the past) can I get of a Facebook page using the Graph API?

I would think there would be a cut-off on the number of posts, or a cut-off in time period after which I won't be able to get the posts. From a few test runs, I am unable to form any idea as for some pages it returns all the posts till the beginning whereas for some it stops midway. Also neither is the number of posts hinting towards a constant limit, nor is the first post time hinting at any time cut-off.
The documentation(http://developers.facebook.com/d...) doesn't talk about any limit, so I am out of ideas. Can anyone throw some light on this and provide some credible information? Thanks already for your time.
The documentation https://developers.facebook.com/docs/reference/api/user/ was updated to show you get up to 25 posts.