6

I want the ID, not the username. But given the username...what do I have to do?

1
  • how are you getting the user name? Which language do you wish to achieve this in?
    – Sparkup
    Jun 7, 2011 at 1:54

2 Answers 2

13

https://graph.facebook.com/username

e.g.

https://graph.facebook.com/boxoft

{ "id": "1264933131", "name": "Box He", "first_name": "Box", "last_name": "He", "link": "http://www.facebook.com/boxoft", "username": "boxoft", "gender": "male", "locale": "en_US" }

4
  • Amazing. No need to use the complex OAuth.
    – Jack
    Mar 25, 2015 at 18:42
  • 5
    I'm currently getting a "(#803) Cannot query users by their username (usernamehere)" error message when trying this method. Jun 16, 2015 at 10:17
  • 4
    This api is deprecated
    – senz
    Jun 18, 2015 at 20:56
  • 3
    This no longer works without a proper Oauth token (public calls depreciated) Jun 19, 2015 at 17:54
2

You wont be able to get an exact match but will get some results. Via Graph Api docs

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.