Search in user's Facebook feed - facebook-graph-api

Is there a way to search specific type of feed of the user by using the Graph API with
https://graph.facebook.com/me/feed
The URL normally returns most recent feeds but it is too much data, I just want to search for a specific feed based on some keywords. I have tried
https://graph.facebook.com/me/feed?q=SEARCH_KEYWORD
but it does not work (returns empty)

You might want to have a look at https://developers.facebook.com/docs/reference/fql/
With FQL you can pass SQL-Like queries to the Facebook API.

Related

Facebook Graph API Search Posts for specific text in message field

Is there a way with graph facebook to search specific text content in the message of a user's posts? The assumption here is that the user id and access token is already available as well as all applicable permissions (ie. the user_posts permissions, etc..).
I read through the search feature on graph:
Facebook Graph Docs-Advanced
The following graph explorer example was provided:
GET graph.facebook.com/search?
q={your-query}&
type={object-type}
The table that lists the available types in the link provided is very limited (place, placetopic, ad_*). Is that the full list of possible types? Can we use POSTS or user posts as a type. I couldn't find the right syntax anywhere.
My goal is to retrieve a user's posts based on a specific message tag or text in their post message. Currently, the only way I know how to do this is highly inefficient. I would have to do the following:
Get user's full list of posts
https://graph/facebook/com/{version}/{userID}/?fields=posts&access_token={token}
Run a coded query to get the posts I need and discard the rest
Thanks in advance.

Facebook Graph API to search user statuses

I am trying to pull some of my facebook statuses that contain a particular keyword and show them on a web page, what is the url query string I should use?
The best I can came up with is graph.facebook.com/me/statuses
But it returns all the statuses, but i want statuses that contain a particular keyword, such in a search, how should I do it? Or is it even possible?
You'll have to manually go through the statuses returned from /me/statuses to find the ones that you care about. Facebook doesn't really let you use their computing power to search stuff like that.

Collect all public posts in facebook using graph api

I am trying to collect all public posts from facebook using Graph api like twitter streaming.But i couldn't find out a way, i checked the graph api search function
https://graph.facebook.com/search?q=anyword
it needs a parameter or keyword for search, but i need all the public posts not specific to any keyword or any user or any page. Please help me to find out this.
It is not possible to perform such a vague search. Any type of search query require at least one parameter / criteria to be search. Even if had been possible, it would be like receivind millions of arrays in a single objects(which is practically impossible)
In your case it should be all the posts from a single user, a group or a page. You can receive real-time updates from the Graph API, but that too needs the object to be subscribed to other objects. Check the following link.
Real Time Updates

How to get general data from facebook graph api

I'm looking into the facebook graph api. I understand that I can retrieve information about a facebook web page by making a get with the current id. It's also clear that after retrieving a access token I can post on the logged in users wall and do other operations.
But what if I want more general data? Can I, for example, get how many swedish user who have used the word "Obama" in their status update the last week?
I don't think that the current search API can be that specific. You can find everything about the search API in this document.

Facebook Graph Api filter feed by category

Does anyone know how to filter a users feed by category using the graph api? For instance.... I would like to pull the users news feed that relates to only Music like
http://graph.facebook.com/me/home?from_category=Music
Any help would be much appreciated.... Thanks!
as much I know, there is no direct way to query graph api for getting filtered feed though if you know the filter_key for a particular filter type of a user stream,then you can query the graph api with identifier filter.
so I think
1) you will need to make FQL query to get filter key, with something like:
SELECT filter_key FROM stream_filter WHERE uid=<uid> you can get all the avalable filters from a user's stream. please refer the doc here
2) now when you have your desired filter_key then you can request graph api to get the filterd feed with GET me/home?filter=filter_key . checkout the corresponding documentation here
Simply use
me?fields=id,name,music.limit(100)