Reputation: 30027
my question is how get facebook page_id starting from a simple fb url. For example:
Actually if the url match the string "facebook.com/pages/" I call:
else I call:
This approach seems to work well, but it is really empirical and looking at documentation I don't see any suggestion.
What do you think about?
Upvotes: 12
Views: 23763
Reputation: 101
Simple Instructions:
TEST:
Search for the desired page using the 'page_id' in place of the page name:
www.facebook.com/[insert 'page_id' here]
Upvotes: 10
Reputation: 29
For my OG meta <meta property="fb:app_id" content="010101010101010" />
I got my page app id by going here:
https://developers.facebook.com/docs/plugins/page-plugin
get code > appId
Line 6: js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9&appId=
010101010101010";
The sharing debugger has now stopped complaining https://developers.facebook.com/tools/debug/
Upvotes: 0
Reputation: 654
I'm not quite sure what you're asking but I think what you're talking about is trying to get the id of a page that you only know by its "vanity url" or "nickname".
Basically you can do a facebook graph api request to the "vanity url" and then grab the id from the provided request.
For example... if you open the Facebook graph API explorer https://developers.facebook.com/tools/explorer?method=GET&path=coca.cola.
or make a request to http://graph.facebook.com/coca.cola
you can see in the response you get "id": "40796308305" which is the page ID you are talking about.
Navigating to http://www.facebook.com/40796308305 should prove that.
Hope that helps.
Upvotes: 7