0
votes

I am trying to fetch posts from a particular facebook page using the Facebook Graph API v2.1. Below is the URL which I tried:

https://graph.facebook.com/v2.1/search?access_token=xxxxxxxx&q=hello&type=post&fields=from,message,name,caption,description,created_time&limit=2

But I am getting below error:

{
   "error": {
      "message": "(#11) Post search has been deprecated",
      "type": "OAuthException",
      "code": 11
   }
}

I tried with older versions as well but I am getting the same error message.

I am using app access token to fetch the same.

Is there no way to fetch public posts / comments from a facebook page using Facebook Graph Rest API.

Any guidance is appreciated.

1

1 Answers

3
votes

The public Post search was deprecated with Graph API v2.0, see https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api

Public Post search is no longer available. (/search?type=post&q=foobar)

If your app isn't a v1.0 app (created before April 30th 2014), then you have no chance to use the public Post search. Even if it is, it will stop working on April 30th 2015. You'd have to prefix your request with /v1.0 like the following:

/v1.0/search?type=post&q=foobar