How To Find Facebook ID

By | December 5, 2011

What is facebook ID? it’s a unique number identifying a facebook profile, facebook groups or fan pages. As you can see from other facebook profile, here’s an example for Facebook Bold Text profile URL :

See the url above, 139701732734451 is the facebook id. we will discuss about how to get the id. Below are some javascript address bar tricks you can use to find facebook id. You can get your own facebook id, your friends facebook id, or facebook groups/fan pages id programmatically.

The simplest method I found is using the graph api… just get the username of the profile and you can get everything

For Example : my username on facebook is shubham0987, paste the following code into the address bar


and you are done. 🙂

Other methods are as below:

To find your own facebook id, simply put this code on the address bar then press enter :

javascript:alert(‘Your Facebook ID : ‘+Env[‘user’])

For friends facebook id, or facebook groups/fan pages id, simply go to the destination profile, then paste the code on the address bar. you can use one of these codes ;

  • If your profile or your friends/facebook page profile has profile picture, not the default silhouette one, use this : javascript:x=$(‘profile_pic’).src;y=x.substr(x.indexOf(‘_’)+1);alert(‘Facebook ID : ‘+y.substr(0,y.indexOf(‘_’)))
  • This one is using facebook share link, we will get its link then get the profile id programmatically. You can use this if you can see share link on its profile page. here’s the code :javascript:x=$(‘content’).getElementsByTagName(‘a’);for(i=0;i1){y=x[i].href;alert(‘Facebook ID : ‘+y.substr(y.indexOf(‘[]‘)+3));break};void(0)
  • And this is using xhpc_targetid, one of the form elements for sending message to destination wall. You can use this if you can post to the destination profile :javascript:x=document.forms;for(i=0;i<x  .length;i++){if(document.forms[i].xhpc_targetid){alert(‘Facebook ID :  ‘+document.forms[i].xhpc_targetid.value);break}};void(0)

There are lots more tricks to see facebook id, but we cant discuss them all here. Some of the examples above will be enough for you to get the id.

2 thoughts on “How To Find Facebook ID

  1. Pingback: Custom Tag on Facebook » Shubham Saxena's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.