Get username field in Facebook Graph API 2.0

Facebook got rid of the username because the username is one way of sending emails via Facebook.

For example, given the url http://www.facebook.com/sebastian.trug

the corresponding Facebook email would be [email protected]

which, if emailed, would be received to messages directly (if the message setting is set to public), otherwise to the other inbox.


The username field of the User object has been removed, and does not exist in Graph API v2.0. In v2.0 of the API is there is no way to get the FB username of a user.

Source: https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api

"/me/username is no longer available."


@Simon Cross - It being deprecated is documented, yes. That is not the question, the question is how to get it and -furthermore- I wonder why Facebook has made such a terrible choice and removed the username. Hundreds of applications that rely on the username to create accounts on their service will be broken.

@user3596238 - You can stick with the V.1 API which will be around until the end of April 2015, by far not the best solution but Facebook might be irrelevant by then anyway. https://developers.facebook.com/docs/apps/changelog

Solution: ask the user for a username besides the actual Facebook login? - In my opinion, that makes the Facebook login completely pointless anyway.


While the 2.0 SDK will not provide the username field any longer, it is quite easily scraped if you have the user id number (which you will likely be using to access the graph anyway).

The url facebook.com/<user id> will redirect to facebook.com/<username>, which can then be extracted however you like.