I am using the Facebook graph API with queries like:
https://graph.facebook.com/search?q=term&type=post&access_token=XXXXXXXXXX
but I am getting different results when I execute a query via graph API and via the Facebook web...
I am using the same user (I get a access_token from the same user that I uses to search via web).
I tested this text query with dif. browsers and with a java client and I have the same problem....
I was searching information about this topic, but It was impossible to find something.
Finally, I'd like to ask if someone know how this query customizes its results and if it is possible to parametize it.
Regards.
Update:
I am testing a query as:
https://graph.facebook.com/search?q=mark&type=user&access_token=XXXXXXX
but I don't receive results. I don't understand how it is possible which Facebook doesn't find users named Mark..... I suppose I have to use some parameter (fields, f.e)... But It is not explained in the documentation....
Related
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
I'm developing an app in which the user needs to search and select a person from Facebook. I'm able to search in the Facebook Graph API using "https://graph.facebook.com/search", however this only give very general results and not the 'close' people Facebook would normally suggest when searching in the search field on Facebook.com. In this case it is impossible to find someone with a regular name.
Does anybody know how I can personalize my query or go around this problem?
The Graph API search is not the same nor directly comparable to the search in the Facebook website.
See
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#search
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.
I'm looking for a way to retrieve the equivalent of what's shown on https://www.facebook.com/me/allactivity. Both FQL & Open Graph are fine.
On the graph, /me/feed shows something similar, but it's missing likes, and tags and other things.
Any ideas are appreciated.
This is currently not possible. There is no endpoint to get to this data.
The only available data will be anything that appears as a post (e.g. Youtube, Twitter). For this you can query stream via FQL. You can also try endpoints /music.listens and /video.watches but they will retrive data for the current application not all.