Is there no way available for retrieving posts using a search query/keyword from facebook?

守給你的承諾、 提交于 2019-12-11 08:48:57

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/45828963/is-there-no-way-available-for-retrieving-posts-using-a-search-query-keyword-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!