Facebook Graph API Search "Unofficial Results" - facebook

I'm using the Facebook Graph API to search for a business's Page. I've included type=page in the search query, however the results contain several Place results that are listed as "Unofficial Pages".
Is there an easy way to filter the Unofficial Pages out of the results? I can't seem to find any documentation on how to do this.
For example, a local search is returning the following results for the same business....
Official Page: https://www.facebook.com/Turtle-Creek-Vineyard-1652393331683838/
Unofficial Place: https://www.facebook.com/pages/Turtle-Creek-Vineyard/130640440336061
I would like to figure out how to have the first, official result returned only. Or, if there is parameter that I can use to filter out the unofficial, place results.

There is no filter option according to the docs about the Search API: https://developers.facebook.com/docs/graph-api/using-graph-api#search
You will have to filter on your own after getting the results.

Use the Field "is_unclaimed". If it is true, that's mean that the page is "Unofficial Page".

Related

Query for pages of a specific type on Facebook

I need to have something like http://fanpagelist.com/category/musicians/ in my web app.
Basically I need to allow users to search through Facebook pages of musician/band category and sort by number of fans.
The closest I got was with this FB Graph API call:
search?q=musician&type=page&limit=25&after=MjQZD&fields=name,fan_count,category
But that is searching for pages that have 'musician' in the name, not in the category field.
Any idea? It must be possible since fanpagelist can do it...
There is no way to filter the results from that search endpoint directly.
You are limited to the options described under https://developers.facebook.com/docs/graph-api/using-graph-api/#search, and that basically means you can search by name, but nothing else.
So you will need to filter the results on your end.

Get the comment of a specific User- Facebook API

I want to get the list of comments made by given user through Facebook Graph API.
I haven't found any direct way to get lists of comments. So, I tried to find them through my feed, but it's returning all feed posts. Can we filter other posts where I have not commented?
I tried various queries as below, but could not get exactly what I need.
/me/feed?fields=comments?fields=from?name="my_name",message
/me/feed?fields=comments.fields(from.name("my_name"),message)
I need either (1) list of all comments by me or else (2) lists of posts which I have commented on, filtering out all other posts.
How can we do this?
There's no way to filter via the Graph API. Basically what you want to achieve is IMHO not really possible.
What you could theoretically do is use the comment FQL table, but the field you'd need (fromid) is not indexable: https://developers.facebook.com/docs/reference/fql/comment/ So this could be tough.

How to limit search results with several conditions

I am using search function in Graph API to look for my results. However, these are usually too general. I would like to narrow results but I can't find a way to do it - Graph API offer me only narrowing results by time. On the other hand, FQL does not offer me possibility to obtain results without having IDs of objects.
I figured that the only way is to get results by Graph API and then make FQL query for each result. Do you have any other ideas?
You can search various objects in Facebook using GRAPH API.
You can search over all public objects in the social graph with
https://graph.facebook.com/search.
The format is:
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE
Reference
https://developers.facebook.com/docs/reference/api/

Graph API - Get latest news feed entries instead of "top news"

I'm working on a module to my web application which is supposed to display latest news feed entries for a specific user.
I was wondering if it's possible to add a certain "orderby" parameter to the graph api url in order to fetch the "latest news" instead of facebook's default "top news" which arranges the order using popularity and other elements.
I'm currently using the following url:
https://graph.facebook.com/me/home?access_token=...&limit=10
but again, this does not return the latest entries.
Does anyone know how to solve this?
You can use FQL rather then Graph to query the "stream" table. FQL supports order by statements similar to SQL. http://developers.facebook.com/docs/reference/fql/
For your specific example it would be
SELECT post_id FROM stream WHERE source_id=me() ORDER BY updated_time DESC
Obviously you will want to query more then just the post_id, you can find the full list of fields here http://developers.facebook.com/docs/reference/fql/stream/
Mikey, I've been trying to do the same thing. During my tests I found that the Facebook API didn't return all the entries it was supposed to.
Meaby in some way it's prevent you from seeing all updates correctly.
Try this :
In your browser open : https://graph.facebook.com/me/home?access_token=
then
Go to the Facebook Graph API Doc : https://developers.facebook.com/docs/reference/api/
and click the News feed: https://graph.facebook.com/me/home?access_token=... link in the page.
Check if the two page show the same output.

Is there a "Facebook Search API" similar to the "Twitter Search API"?

I need to search Facebook for certain keywords and count them if possible?
Thanks!
It might not cover everything you want, but the new Graph API does, indeed, include search.