I'm trying to use GraphAPI for retrieving various posts using a search query/keyword from Facebook.
This is what I tried:
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/search?q=solareclipse&type=post",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
but I got this error:
{
"error": {
"message": "(#11) This method is deprecated",
"type": "OAuthException",
"code": 11,
"fbtrace_id": "AZD1YH0em2M"
}
}
Has Facebook completely taken back the privilege of searching through it's public posts or is there some other way available?
Since Graph API v2.0 it is no longer possible to search through public posts.
There is a public feed API (https://developers.facebook.com/docs/public_feed), however the access is limited to certain media companies only.