how can i access exact same metrics for page videos lifetime insights like those on the image?
Facebook Page Frontend
I know that i can check Page Insights, assuming i am accessing Graph API with page access token:
me?fields=fan_count,insights.metric(page_video_views).since(2017-03-10){name,period,values}&metadata=1
API gives me data where each item represents one day.. but i would like to get lifetime OR since some date, for example page was created at 2017-03-10 so i want to get insights since this day
My question is, is there any other way to get this data? or do i have to loop through data array and store incremented value in the end?
Try with "me/accounts?fields=id,name,access_token,country_page_likes,talking_about_count,new_like_count,link,username,about,website,fan_count"
Related
I was reading the fb api doc but I couldn't find a lot about the different type of queries you can build.
Im trying to count all the likes in the posts from certain facebook page of the day.
Does the API supports params like the date or Will I have to take a whole response like the one I get with this request and somehow sum the counts of the likes?
https://graph.facebook.com/PAGE_ID/feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)&access_token=XXXXXXX
Thanks
most graph api queries support a since, until params
you can try this based on your example
https://graph.facebook.com/PAGE_ID/feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)&access_token=XXXXXXX&since=2015-08-25&until=2015-08-26
How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.
I want to get a number of posts from a page in last month. Is is possible with facebook graph API? Also FYI, i just have the access_token to interact with the Facebook API.
Also do anyone knows how to fetch the number of Page mentions in last month?
Thanks for your help in advance.
Try using Facebook's Page Insights using Facebook Graph API's :
https://developers.facebook.com/docs/graph-api/reference/insights/#page_posts
But please note that you need to be a page admin for this page, and you need to acquire a Page Access Token with the permissions 'read_insights'.
If you are not a page admin, then you can also do the same with an User Access Token or an App Access Token.
Steps:
`int postsCount = 0;
Use the following API query https://graph.facebook.com/{page-id}/posts and issue a reuquest.
Count the posts fetched. postsCount = postsCount + {the posts json array size}.
Store the cursor returned by the above API result. Use it to fetch the next page of Posts.
If the {the posts json array size} > 0, then goto step 3.
Notes:
I am sure that you can do it better with FQL, but I am guessing FQL is being deprecated.
I think there is a summary(true) annotation (https://graph.facebook.com/{page-id}?fields=posts.summary(true)) that you can use, but I couldn't get it working.
There is an API rate limit that you need to keep in mind. And do some throttling.
So, the moral of the story is that I am not sure if Facebook really wants you to crawl its Pages if you are not the Admin of the page. :-)
Using the Facebook Graph API, how do I get the list of people who have liked a specific item (say a post)? Doing a call like /ITEM_ID/?fields=likes using the Graph Explorer I'm able to see a list of names in the [data] array, but, when I call it from a website it doesn't display the names, it just shows the count value.
I'm thinking it's one of two things, but I'm not sure:
I'm using the wrong access token. I'm using the extended one for the fan page the post is on.
Facebook just doesn't give out that info to someone (or a fan page) that isn't the owner of the original post. (I'm the one who made the post.)
Is there a way to get the list of user names and user id's that have liked a post, and if so, what's required to do so?
There could be 2 reasons-
You access token is not correct. You need the read_stream permission for getting the posts.
You are not parsing the resulted JSON correctly.
/ITEM_ID?fields=likes.fields(id,name)
i have done this like this ( me/feed?fields=likes.fields(id,name) ) and it works
I'm totally stumped here. I'm trying to get access to the data that appears under the reviews tab in the Facebook Page http://facebook.com/freemanfoxx (Page ID=149530265092626).
I've figured out that all data in a Facebook profile can be retrieved as JSON using the Graph API but I'm totally stumped about the data populated on the "Reviews" tab. It appears to be it's own Application separate from the Facebook core and this is probably why I'm lost.
Any leads/tips/experts out there? Here are some of the links I've been searching for Help.
developers.facebook.com/docs/api
developers.facebook.com/docs/reference/api/
developers.facebook.com/docs/reference/api/application/
My overall goal is to take this data into Yahoo! Pipes and then combine it with data from a Google Form to create an RSS feed to be output to a webpage I'm building.
Your thoughts and help would be GREATLY appreciated!
Ryan
Let's say your reviews tab on the facebook page is:
http://www.facebook.com/easyinspection?sk=app_6261817190.
6261817190 is the application id (not page id), and that is what you will be using next.
You can get all reviews by a request to:
http://graph.facebook.com/6261817190/reviews. If you do not want to go page by page, retrieving 25 reviews at a time (take a look at next page url), you can get it all in a single request, like this:
http://graph.facebook.com/6261817190/reviews?limit=100000000&offset=0
There is no API for this data. Your only chance will be a web page crawl ov your reviews and grab the content from there.