ChrisNY
ChrisNY

Reputation: 4227

Multiple Parameters in Graph User query/search?

The FB Graph API shows how I can search for all users named "Mark" anywhere in the world:

https://graph.facebook.com/search?q=mark&type=user

but I would like to be able to search, for example, by location and interest, like all users in Los Angeles who like Soccer.

I looked through the API documentation, and forums, but although I imagine this would be a common question (whether it's possible or not), I couldn't find anything.

Thanks for any help.

Upvotes: 0

Views: 1829

Answers (1)

Martey
Martey

Reputation: 1631

The current implementation of the Graph API makes these types of searches impossible.

First, the search query structure is dependent on the type of resource being searched. It is not coincidence that the majority of search queries in the documentation only include one search term and do not allow you to restrict the fields being searched. Outside of a limited subset of types (like Places), it is not possible to use multiple terms and it may not be possible to get results for the fields you want to search (e.g. you can't search for Pages by location).

Second, all methods of the Graph API follow Facebook's permissions. If you look at the documentation on User objects, you will note that both the location field and the likes connection require extended permissions (user_location and user_likes respectively) in order to access them. Since both of these fields are private by default, there is no way to find users with a location in Los Angeles, or who like soccer.

I suspect that this is because the Graph API's purpose is not to allow programmers to do granular searches over Facebook's userbase, but to "promote rich social applications".

Upvotes: 1

Related Questions