Facebook Graph API Search Results

I use the PHP SDK to get results for a specific keyword in public messages

$q = "something"; $results = $facebook->api('/search/','get',array('q'=>$q,'type'=>'post','limit'=>10)); 

this query returns a similar result:

 Array ( [id] => id [from] => Array ( [name] => Some Random Name [id] => id ) [message] => Hello hello hello. something [privacy] => Array ( [value] => ) [type] => status [created_time] => 2013-10-31T10:20:58+0000 [updated_time] => 2013-10-31T10:20:58+0000 ) 

as you see the section [type] => status , it can be a status, photo, link, etc. I would like to receive only photos from public messages that contain the search keyword (in other words, search in public messages that contain $ q and filter / get / limit 10 results that have only [type] => photo value)

How can i achieve this? I assume that FQL cannot help with this, as I am looking in public posts.

+6
source share
1 answer

No, this is not possible at this time, perhaps in the future it may be realized.

Finding an api chart requires an endpoint API like

https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE

Here Possible types of objects: post, event, user, group, etc.

https://developers.facebook.com/docs/reference/api/search/

The return value that you saw is the fields and the status "type", photo, link, etc. - these are fields in the returned data, however you can narrow the returned fields by specifying

&fields=id,name,picture,type , etc.

Here you can see the "Available Search Types" documents in the following URL

https://developers.facebook.com/docs/graph-api/using-graph-api

You need to scroll through the result and display the desired one as you need.

+4
source

All Articles