8

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

4 Answers 4

8

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Please make sure you have the appropriate Access Token for the respective endpoints as described here: developers.facebook.com/docs/reference/api/search/… To search for Pages and Groups, you need an App Token, for all other a valid User Token.
note that in v2.0 of the Graph API, support for searching public posts was removed. See developers.facebook.com/docs/apps/…
it's deprecated
developers.facebook.com/docs/graph-api/using-graph-api/… refers to a blank page or not related content
3

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

Comments

0

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.

Comments

-2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.