Finding Your Facebook ID
Few months back someone sent me email asking me to write tutorial to get Facebook ID of any user using their profile URL. I don’t know why he wanted the script so bad, but he will surely be amazed how dead simple this is.
Find You Facebook ID & More
I have been playing with Facebook graph urls and I came up with a decent example below, Just enter Facebook profile URL of any user to get fetch their ID and more.
There are few Facebook user information (id, name, gender,picture etc.) that do not require any permission or SDKs, we can simply point URL to graph.facebook.com and fetch these data.
Here’s a simple Facebook Graph URL that shows my ID and Name :
This URL will reveals more about me :
So, simply use PHP cURL to fetch these datas and use them in our scripts :
If you need complete PHP example, you can download it from URL below. The sample file doesn’t contain jQuery ajax part as shown in the demo above, which I had added later in this page.
Saran Chamling. (He loves the web technology, and enjoys designing, exploring and writing about it @saaraan.com).