Facebook Search – How to Use Facebook’s New Search Graph to Find Posts with Specific Words

facebooksearch

I want to query the new search graph to find all of my friends’ posts which contain some word, say Vacation in Italy.

How can I do it?

Best Answer

We cannot do this using the Facebook website itself

But Facebook API does let you do that How to do it is explained here:

https://developers.facebook.com/docs/reference/api/search/

One of the websites that has implemented this is: www.openstatussearch.com

[edit]

There are 3 ways of doing this:

Quoting from the link above

We support search for the following types of objects:

All public posts: https://graph.facebook.com/search?q=watermelon&type=post This search type does not support limit/offset paging.

  1. Now develop your own parser for this data. That's one way of doing this.

  2. Using JavaScript SDK https://developers.facebook.com/docs/javascript/gettingstarted/ With the fb.dataquery method. What you want to do is use the stream table to get the status posts for users.

  3. Using PHP SDK (I personally prefer this) https:/developers.facebook.com/docs/php/gettingstarted/ Decode (using json_decode) the json object recevied by this url: https://graph.facebook.com/search?q=Vacation+in+italy&type=post

Update: Version 2.0 of the GraphAPI does not let you search for posts anymore. See the updated documentation.

You can continue to search for posts by changing your API call to:

https://graph.facebook.com/v1.0/search?q=search_query&type=post&access_token={access_token}