Need help on employing Graph Search parameters for hashtag query on facebook - facebook

The problem:
I want to find public posts that contain two hashtags (like #games & #movies). The graph search does not work with hashtags apparently. Do you know a way to use the Graph API to set up a query that can help me find those particular postings.
Thanks in advance

You can use the standard Search API for Posts as described in the answer here:
Facebook API - Using javascript sdk and searching public posts for hashtags
For example,
https://graph.facebook.com/search?q=%23selfie&type=post&access_token={user_access_token}
works for me.

Related

Facebook Graph API - Getting Comments

I'm trying to use Facebook graph API to get all the comments (mine and others) on my Facebook posts.
Currently I'm testing the api using Graph API Explorer & so far I'm getting only my comments.
I want to know did they change their policy or is there a way to get all the comments?
P.S: I didn't write any code so far.
But I followed the link:
https://developers.facebook.com/docs/graph-api/get-started
to use the graph API explorer and this is what I'm getting:
the image
In the "Tools" you will find the tool. And as you can see you will get the list of the comments. I'm just showing one of my comments (testingggg) as an example.
Unfortunately, the API doesn't give me the others' comments.
Am I missing something?
Thank you.
according to the document this is the way to get all the comment docs

Search content in specific pages on Graph API

I'm trying to figure if its possible to search for strings in specific pages on Facebook's Graph API (version 2.5) or all searches abilities has been blocked?
There is any other wat to do so?
Here is the only search methods that i found
You found everything that is possible to search for. You can´t search for strings on Pages, you can only get the feed and and search for the string with your programming language of choice.
https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed

Facebook Group Search post without comments

Hi,
As title, in my facebook group, I need to retrieve only post without comments.
I see the search box and notice that searching something will give an url with
`?query=Word%20Search`
and maybe there is a way to search post without comments by url.
Thanks for help!
You must use the Graph API to retrieve data from Facebook. There is example code how to get the group feed in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed#read
You can´t filter by posts without comments, you need to do the filtering on your own after getting the posts.

Get public post from Facebook's Graph Search API

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
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.
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
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.
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

Search posts in a Fan Page with Facebook API

It's simple how can I search a post in Facebook with the API Facebook:
https://graph.facebook.com/search?q=logo&type=post
This query retrieve all public posts which contain the word "logo". But, how could I search a post in a specific Fan page? Is it possible?
Thanks in advance.
Alternative Solution:
I have thought of a hybrid solution: I can get all the posts with that query:
https://graph.facebook.com/search?fields=object_id&limit=25&type=post&q=logo
and through php to restrict only those belonging to specific Fan Page. Although I have a question, over what period of time the search is done?
What do you think?
To search in posts in page, use this:
https://graph.facebook.com/page_id_here/search?q=keyword_here&type=post
Alternative Solution:
I have thought of a solution hybrid: I can get all the posts with that query:
https://graph.facebook.com/search?fields=object_id&limit=25&type=post&q=logo
and through php to restrict only those belonging to specific Fan Page. Although I have a question, over what period of time the search is done?
What do you think?