I would like to search facebook user by thier name. For example, If I type ‘James’,
I would like to return facebook users whose name is ‘James’.
I know it is possible to access user’s info with user’s id value. But is it possible to access
user’s id with only user’s first name or last name?
I would like to search facebook user by thier name. For example, If I
Share
Sergey is right about the fact that searching for all people named James would be useless. Sergey is referring to FQL, which is a different way of querying data, but as DMCS pointed out, there is a search function in the Graph API that can enable you to do what you’re trying to do.
https://developers.facebook.com/docs/reference/api/
I quote:
Searching
You can search over all public objects in the social graph with https://graph.facebook.com/search. The format is:
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE
If you go to the page, there will be some examples of URL queries you can use to search for different types of objects, including users.
In my view, a useful application will typically be operating in the context of a FB user, accessing the objects that user has given the application permission to access. If you’re searching a name among a user’s friends, it’s probably easiest to get all of his friends (you don’t need any IDs to do this, other than the logged in user), and parse through that list for the user’s name and ID, and then use the ID to get whatever information you’re going to get.