Get the facebook post likes on a given date - facebook

i'm working with facebook graph API and i need to get the number of likes a given post had on a given date. As in, how many likes the post had on Jan 20, but i can't find a way to do that. I already tried with /POST_ID/likes and i get the people who liked the post, but not a single date, also tried using ?since=DATE&until=DATE but no luck.

This isn't possible using the Graph API, you can only get the "current" total number of likes for a post.
You could set up some cron jobs and a service within your application to get the current amount of likes everyday for the lifetime of the post, and store them locally. And then do some math on your local data to figure out how many likes were actually done between a date range. Probably not ideal, or even practical, and in your case you probably would be missing a lot of data since you don't already have this set up.

Related

How to scrape Facebook posts from certain location?

We have spent several days looking into FB Graph API and third party tools for scraping FB data but cant figure out if it is even possible to scrape what we are looking for and if it falls into FB policies (really not looking forward to start a lawsuit with FB).
We need to obtain statistic of how often is specific question (read - problem that we will try to solve) posted on Facebook. We need to get all FB posts filtered by three criterium:
Location - country or city of user that posted the post
Time - Some reasonable period of time, for example a full month, week or day
Keyword - keyword that can be associated with questions that we are looking for
We would then takes this data set and manually go over it in order to distinguish whats relevant to us and what is not. Maybe use some language processing engine like wit.ai or api.ai to use data set to teach app to regonize which posts are relevant and which not. But thats on us, later.
So the question: Is it possible (technically and also from FB policies point of view) and what would be the steps to get FB posts filtered by three criterium stated above?

Facebook API Insight Metrics Daily graph API

Hi Guys I am hoping someone could help me.
I have been toying around with the Facebook API for our company's facebook analytics page. I am looking to get information on the likes, shares, impressions etc and store directly to a database
I have been able to pull this information back using the Graph API Explorer. Now I want to be able to pull the information back for say today. When I add today's date in it only relates to the actual posts that were posted today, not today's activity. if that makes sense.
An example of this is if I had liked a post today that was created 2 days ago, it doesnt show in in today's activity, but the activity from 2 days ago.
The code I have been using is:
feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)&since=2016-10-28
Just wondering if I am missing something as surely should be an easy way of getting todays actual activity from users?
Your example isn't fetching Insights, you're fetching the posts visible on the page's Timeline, then asking for a count of the comments and likes
There's a totally different API for fetching Insights data: https://developers.facebook.com/docs/platforminsights/page
This is the same API used by the Insights UI, so for the same set of metrics/dates, it should give identical results to the UI

Get register date with Graph API

Is it possible to get the date when user first joined Facebook with Graph (or any other) API. In an older post (sorry, can't find the link now) I have read that it is not possible and it is even removed from profiles; however recently with timeline it is added to the profile, so the data is somehow available.
Nope, not possible. It's been asked many times here on SO. The closest you can get is a guess by paginating thru the user's wall/stream until you get to the last item.

Getting all likes on my domain (facebook)

I'm trying to get statistics for likes on my domain. I would like to get all likes (if possible with user ids) for all pages on my domain (which has tens of thousands of pages)
What does domain_like_adds actually return?
SELECT metric, value FROM insights
WHERE object_id=[domain-id] AND
metric='domain_like_adds' AND
end_time=end_time_date('2011-01-03')
AND period=period('month')
Returns blank, does anyone know what data domain_like_adds returns?
Regards,
Niklas
I don't think there's any way you're going to get user IDs as that is a major privacy invasion, but I believe domain_like_adds indicates how many NEW likes your domain got in the given time period, as opposed to the cumulative likes your domain has earned until that point. It doesn't appear there's a viable way to determine the # of likes of all objects in your domain for all time without tracking it from the beginning and/or going back and summing up historical data.
You can make a sitemap.xml of your site and crawl the urls against the Facebook Graph API. I actually made a Ruby script to do this: http://bobbelderbos.com/2012/01/ruby-script-facebook-like-stats-blog/. I don't think you can get the users that 'liked' your pages, but this script might be useful to find out what URLs are most popular.

Getting all facebook page wall posts and comments?

I am developing a social media monitoring application. Currently, we are entering Facebook page ids into the application to collect data from possible customers' Facebook walls (so we have a realistic sample for the customer for direct promotion).
These page ids are used to collect wall postings and comments and to compute statistics (e.g. to show most used words), and are presented to the user in a special view. Requirements are to collect all postings and comments without exception in near-live time. We currently have about 130 page ids in the system, with more to come.
Right now, I am using the Graph API for this, with several disadvantages:
FB API access is restricted to 600 request/10 minutes. To get a near-live view, I need to access the API at least each two hours. As we are using API requests in other parts of the program, too, it is obvious that the limit is hit sooner or later (actually, this already happens)
The responses are mostly redundant: to receive current comments, I have to request the wall postings (comments are enclosed in postings) with the URL http://graph.facebook.com/NAME/feed...
The probability for hitting the limits is dependent on the number of postings on the several walls
I cannot get all comments with this method (e.g. comments on postings some time ago)
I am currently trying out how to switch to (or to complement Graph API usage) using FQL by querying the stream and the comment tables but this also has limitations:
I cannot restrict my query to a specific timespan, leading to redundancy again
The max number of posts I am getting for each one of my 130 page ids is 61 - (why 61?)
I need an unpredictable number of additional requests because I need to get special objects like videos and links in separate requests.
My question now is - if anyone is doing similar things: How did you solve these problems? How do you get a pseudo-live-stream of a larger number (up to, say 1,000) of walls?
Letting the customer grant extra permissions to us is currently not an option.
you will probably have to meet with FaceBook and work out a contractual deal for greater access to their data. I would bet that the answer will be no, no and no, seeing as it appears you are trying to monetize their data, and furthermore, do so without the explicit permission of the users, but hey give it a shot.
I have a similar task - By default FB return only last ~50 posts or all in last 30 days(whichever is smaller) in FQL you should use created_time filter to receive more results. my current problem is that via FQL I receive no more than ~500 posts from any FB page wall even when LIMIT increased:
'select post_id from stream where source_id = 40796308305 and created_time <'.time().' LIMIT 1000000 ;'
this FQL request to CocaCola FB Page returns now ~300 posts only (less than 2 day posts).
If you find a better solution pls advise :)