'Is there an easy way to find a Facebook user's ID?

I need users to fill-in their Facebook IDs (a.k.a. "Admin IDs") in order to set the "fb:admins" property. There is no easy way to get the ID on Facebook but the value exists in their cookies (c_name).

I know it's not possible to read the cookies. Is there a way to get the ID or even just to show it to viewers so they can copy/paste it? Maybe by using OAuth? If getting the "fb:app_id" is possible - that works for me as well.



Solution 1:[1]

Ok, if picking the FBUID from an image filename is too complex for your users, you have two vaguely simple options:

  1. Your best bet may be to write a simple application that reads the signed_request and outputs their ID to the screen so they can copy/paste it. That shouldn't be too difficult.
  2. Alternatively, get them to go to the Graph API Explorer, which should preload with their user ID. This screenshot shows my UID as 100000248904869:

Screenshot of the Facebook Graph API eplorer

Hope that helps!

Solution 2:[2]

The way I tell my colleagues to find their Facebook ID is to right click on their profile image and copy the URL. Their Facebook UID is the second part of the filename.

So my profile URL is (currently) https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/370748_100000248904869_1041431159_n.jpg, where 100000248904869 is my Facebook UID.

I guess, three months later, it's probably too late for you now, but I hope this helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alan W. Smith
Solution 2 Owen Blacker