Given a facebook url such as http://facebook.com/cnn, is there any way to get the ID of that page short of scraping it?
Find your facebook ID in two easy steps Your Facebook personal profile URL is the the URL you get to when you click on your name in the upper right of the facebook home page. It should look something like this: https://facebook.com/zuck. https://www.facebook.com/profile.php?id=100001533612613.
It is better (and legal) to do this with graph API. Just perform API request to https://graph.facebook.com/cnn
and get id from the response.
Here is the response for cnn
:
{
"id": "5550296508",
"name": "CNN",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs178.ash2/41813_5550296508_728_s.jpg",
"link": "http://www.facebook.com/cnn",
"category": "Company",
"website": "www.cnn.com\nwww.ireport.com\n",
"username": "cnn",
"company_overview": "TRIVIA FROM THE CNN TOUR...",
"products": "CNN US...",
"likes": 1689936
}
Facebook's own Graph API supports it. From the documentation:
The "ids" query parameter also accepts URLs. This is useful for finding IDs of URLs in the Open Graph. For example: https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With