How to get insights on a Facebook fan page without user login - facebook

I'm trying to figure out how to get the total number of comments, posts, likes and fans for any given Facebook fan page and date range using the Facebook API's. I need to be able to do this without the user having to log into Facebook to give the app permissions. This does seem to be possible, as this site is able to do it https://app.conversocial.com/profiler/ .But I don't know how they are doing it.
I've looked into the 'insights' fql table, but this always seems to return empty results. And I've also looked into the 'link_stats' fql table but this doesn't allow a date range to be set.
Does anyone have any idea on how to do this?

You are right. What they are doing is not possible by using the normal Graph API or/and the FQL.
However, Facebook also provides support for two other APIs:
Public Feed API
Keyword Insights API
Access to these APIs is restricted to a limited set of media publishers and usage requires prior approval by Facebook.
I think that they are using the Public Feed API. The documentation of the Public Feed API lists some of the publishers that have been using this API and the site you've mentioned in the question is not in the list. The documentation also doesn't mention anything about getting the Page Insights, but I think it might support this feature (as I see no other way of doing it).
Or, they might be using any other such restricted API which is not yet available to the public and not even documented on the developers website, but is currently in beta/testing phase.

To get the number of fans and the talkabout count, just query the appropriate Open graph ID for the relevant page. For example, for Coca Cola (https://www.facebook.com/cocacola) this is done via
https://graph.facebook.com/40796308305
To get all public infos (Posts etc) use the following request
https://graph.facebook.com/40796308305/feed?access_token={ACCESS_TOKEN}
where {ACCESS_TOKEN} can either be an App Access Token or a personal one. Consider that you can only see public entries.
The ability to query the date ranges is not provided via Facebook ad far as I know. I guess the https://app.conversocial.com/profiler/ application queries each page that is in its index once a day, and saves the results. That's how they're able to provide historical data.

You can try with the following FQL queries or graph API requests for facebook pages,
Graph API
http://graph.facebook.com/nb4cinema
FQL
SELECT name,about,description, fan_count,talking_about_count FROM page WHERE username= 'stackoverflowpage'
In case of FQL tables:
To read the page table you need
no access_token to get public information, or information about public pages that are not demographically restricted.
any valid access_token to get all information about a page that the current session user is able to see.

We have a test fan page. This has poor figures (<10 fans). Statistics are not available due to the lack of fans and likes on that page.
Allthough, conversocial spits out some statistics. They mixed fans and likes to some extent and so my impression is, that they simply parse the page code in order to get what you see.

Related

Get Facebook Page Offers that haven't Expired via Graph API

I have a Facebook Page. I am trying to get the Non Expired 'Offers' that exist from the Pages that my Page Likes.
This is what I use to get all the offers (Including Expired):
GRAPH GET (2.5): /210111832375724/likes?fields=offers
(210111832375724 is my page ID)
I have used 'since(now)', but it failed. It seems to work for events, but not offers.
I could just get all offers and then use my software to select ones that haven't expired, but thought I would see if there is a better solution.
Following the Facebook docs, I don't see another possibility then to filter the "valid" ones from the Graph API call's response. There is currently no general way to filter results in the Graph API.
See
https://developers.facebook.com/docs/graph-api/reference/page/offers/#Reading
https://developers.facebook.com/docs/graph-api/reference/v2.5/offer

How to get FB Graph API Business Rating

I have recently started using Facebook's Graph API. I was wondering is there a way I can get just the overall rating of a business that I am not the owner of the page of. I am aware that there is a ratings edge that allows you to pull all reviews if you have a page-access token but I do not have this and do not need that detailed information. I do not see any fields in the "page" documentation and do not want to resort to scraping. This will be used in an app to compare businesses.
It is not possible to get ratings/reviews of a Page you don´t own. As you found out yourself, you do need a Page Token, and you don´t get one if your user does not belong to any Page role. There is no way to get the ratings/review in that case, and scraping is not allowed: https://www.facebook.com/apps/site_scraping_tos_terms.php

How can I get the details of all fans of a Facebook page?

Suppose that I am the administrator of a Facebook page, I want to get all of the profile details of a the people who "liked" my page. Is this possible? How?
So far, I have only been able to get aggregated data through the Graph API. For example, "number of like in the past week".
There are posts that claim that I can do this with the FQL API, but the documentation for the FQL seems to have been hidden on FB developer site.
FQL reference is not "hidden", it's here: https://developers.facebook.com/docs/reference/fql But there's no current official way to get the profile details of your Page's liker, because you'd need the permission to query the user data from the users.
There are some "hacks" as denoted at Facebook API: Get fans of / people who like a page for example, but it's strongly advised that you don't use these. Facebook forbids scraping for example, and once Facebook changes its website, those methods are likely to stop working.

How to get news feed exactly how it appears in facebook homepage newsfeed using api

I am using /me/feed and /me/home to get my feed and my homepage feed respectively.
But the /me/home only shows updates from my friends. I am following many people but not friends with them. My facebook homepage shows all the updates including my friends and the people I am following.
How to get the news feed exactly like the one appears in the fb website?
As #Fabio said, the Graph API does not support it as of now (and I don't think it'll do that in the future). You can only obtain yours and your friends' feeds using the Graph API.
In order to obtain the feeds from a specific person who's not in your friend list, you need a valid User Access Token from that user with a read_stream permission.
There is however a way to read the public feeds of user status updates and page status updates as they are posted to Facebook. This can be done by using the Public Feed API. This will include all feeds that have their privacy set to ‘public’ are included in the stream. Also, you cannot apply to use the API at this time as its access is limited. Its page says:
Access to the Public Feed API is restricted to a limited set of media
publishers and usage requires prior approval by Facebook. You cannot
apply to use the API at this time.
But I think it's just a fancy way of saying that this API is not free and you'll be charged few dollars (which you can find out by getting in touch with someone at Facebook) for using this service.

List Facebook Page events on website for a Venue using FQL or Graph API

I am helping out a friend with a site for a venue that lists all events on FB with a location, ticket URI, time, etc.
I have found lots of info on how to get the data, but what I am unclear on is how to get public events without being logged in to FB.
What type of tokens do I need to have a website simply pull events data and display it to visitors?
Basically, what I am attempting to do is show a set number of upcoming events and assume that the visitors to the site are not logged in to FB.
On this page, https://developers.facebook.com/docs/reference/fql/event, it says this:
Permissions
To read the event table you need:
a generic access_token for public events (those whose privacy is set to OPEN)
a user access_token with user_events permission for a user who can see the event for non-public events
an app access_token with user_events permission (for non-public events, must be the app that created the event)
a page access_token with user_events permission (for non-public events, must be the page that created the event)
I am not looking to get help with the code really, I am just having trouble figuring out how the access/auth process works.
It appears FQL may be the best option so I can do queries based on date ranges, but alas, I am stuck on the access/auth/token part.
What do I need to have in place to be able to list a Page's events on a 3rd party site?
If anyone has any advice there, I would appreciate it. Thanks.
Just to explain to others, you cannot get ALL the events in the city by graph search. You need to refine it either by user details or some other metric.
I figured it out.
This question helped, but was not correct and there is a syntax error in an answer:
Get Facebook events from public fan page
From what I found, you need to become an FB developer, create an app, get an ID and secret.
Use the SDK (PHP in my case), and this question had a good example of returning the list I want:
Link from ticket_uri is opening a blank page
I am having the same issue though of getting blank pages on the ticket link if the user is not logged into FB.
But my original issue is solved.