Take the 2-minute tour ×

As the title says i want to search with Facebook Api (Graph Api or FQL, that doesnt matter, or even REST) for users. For example: I want to search for "Britney Spears" and i want to get all users with that name (like %search%). The result should be like http://www.facebook.com/search/results.php?q=britney%20spears&init=quick&tas=0.8058435615324403&type=users

share|improve this question

1 Answer 1

up vote 1 down vote accepted

you can use the search API from the Graph API for a particular user like this:

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

If you want to search for a list of users, you can you this:

SELECT uid, username, name, pic_square FROM user WHERE contains("Joe Biden")

Refer official user table docs to see all the fields you can query

But the CONTAINS() function is known to be mysterious and no one from facebook has clarified it yet. It might work in some cases and others it might not.

see thread: Documentation for CONTAINS() in FQL?

I guess the final answer would be that you cannot replicate the facebook search functionality like the site does (searching all users of a given name). You can only search users related to the current logged in user who is using your app since these are the type of social apps that facebook wants developers to build. They want you building apps that provide value to their users by utilizing their social graph of their friends and relatives. Developers don't need site wise search for this I suppose, hence there is no API to do this (yet).

share|improve this answer
i know that, but this does no like search, it gives me only one result! I want to get minium 20 results. –  MOST2K2 Oct 7 '12 at 17:56
i get no results with that query! i used the graph explorer with ALL permissions to test it... :-( –  MOST2K2 Oct 8 '12 at 6:32
answer updated to reflect your question. –  Anup Cowkur Oct 8 '12 at 12:32

Your Answer


