mausberger
mausberger

Reputation: 55

How to find a specific facebook groups in api

For an app we are developing, I want to be able to search within a users groups. Only way to do this via facebook API I found out so far is to load all groups and then do some comparison inside the app. https://developers.facebook.com/docs/graph-api/reference/v2.2/user/groups?locale=de_DE

The search API returns all matches, but I can´t only see the ones that I "liked" already. https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2?locale=de_DE#search Is there different way, maybe with FQL?

Upvotes: 0

Views: 99

Answers (1)

Tobi
Tobi

Reputation: 31479

With the "normal" Graph API, you cannot specify a search criteria. The /search endpoint is no match for you, because it doesn't perform a search on one user, but for all.

With FQL, you could theoretically use the strpos() function on a query on the group and group_member tables:

select gid, name from group where gid in (select gid from group_member where uid=me()) and strpos(name, 'Facebook') >= 0

Will give you all your groups containing "Facebook" in their name. Keep in mind that you need a v2.0 app to be able to use FQL.

Upvotes: 1

Related Questions