Reputation: 187
I am new to Facebook APIs. I am using Graph Search API and want to get public post such as comments, status updates who are having conversation about an object (could be a thing, location, personality etc).
I have valid access token with me.
Is it possible? How?
Any solution is welcome.
Thanks in Advance
Upvotes: 8
Views: 29515
Reputation: 3674
UPDATE:
Public post search is no longer available from API version >=2.0.
Please refer to https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0#search
Original Answer:
Yes, of course it's possible.
You can search over all public objects (posts, users, pages, groups) using:
https://graph.facebook.com/search?access_token=<token>q=QUERY&type=OBJECT_TYPE
Facebook search API is pretty easy to use. I would suggest you to read the documentation for the Search API. I will also recommend using Graph API Explorer for trying out your queries.
Upvotes: 8
Reputation: 1
Post search is not directly supported, instead you should use this call:
https://graph.facebook.com/v2.3/12345678912345?fields=posts.limit(5)
You can use that call with access token from the graph explorer, where the long number represents a page ID
Upvotes: -2
Reputation: 7482
As an update, I would mention that public post search are no longer available from API version >=2.0.
See docs: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0#search
Upvotes: 3
Reputation: 1
I can get this to work but I have NEWT level question;
If I search for q=101class&type=post
then it gives me a response of data[]
.
However if I put in text ONLY such as q=apples&type=post
it works fine.
Upvotes: 0