Take the 2-minute tour ×

I'm wondering how to retrieve the information that the Open Graph Debugger shows when you enter a URL.

Here's an example: I have a page that has all the right og meta tags, the top looks like this:

<!DOCTYPE html>
<meta property="og:url" content="http://www.freefunder.com/campaign/Short-Film-Revenge-Inc/" />
<meta property="og:type" content="Website" />
<meta property="og:title" content="Short Film: &quot;Revenge, Inc.&quot;" />
<meta property="og:description" content="&quot;Revenge, Inc.&quot; is the first short film for the Karmalicity Movie Project. A feel-good story with a positive message." />
<meta property="og:image" content="http://www.freefunder.com/images/campaigns/2094_main.jpg" />
<meta property="fb:app_id" content="346433602097524" />

When I look it up in the Open Graph Debugger, it gives me Code 206 and no errors, and at the bottom it will give me the URL to look this up with the Graph API, which is: https://graph.facebook.com/103335396527655

The problem I'm having is I need to be able to determine the Facebook ID (103335396527655) within my code, and not need to go to the debugger every time. If I go to:


It doesn't return the same information (and doesn't include the ID) as if I go to the Graph API URL provided by the debugger.

Is there any way, given a specific URL, to look up the right Facebook ID for it? This could be with the Graph API, FQL, the PHP SDK, whatever! I just need to be able to enter a URL and get the Facebook ID for it..


share|improve this question
What are you using the ID for? you should be able to use the URL in place of the ID in all of the APIs.? –  Igy May 30 '13 at 17:11
Basically I need to be able to verify that a given URL has an Open Graph ID. I need to be able to make sure the page has a Like button and all the necessary og tags just by looking up that URL. –  John Soren May 30 '13 at 17:19
Why do you need to use Facebook's API to check your own code? Can't you write a script checker for that? Or something? Maybe I undersood this wrong, though... –  dudewad May 30 '13 at 17:23
I'm not using Facebook's API to check my own code. Users on my site add web pages, and I need to be able to confirm that their web page has a Like button with the proper tags on it. They are not pages that I create. –  John Soren May 30 '13 at 17:43

1 Answer 1

First off, just because the page has a Like button and OG tags doesn't mean that the page has ever been scraped by the FB Crawler. If the page has never been 'Liked', 'Shared', or been part of an Open Graph action, Facebook has no idea it exists and therefore there is no information about it at graph.facebook.com

Second, there is no guarantee that same URL will always be given the same Graph ID. I've tried to do a sort of URL -> ID mapping thing (in order to check if a certain user has liked a certain page) in the past and the same exact URL can be related to any number of different IDs. The only reliable result would be with Facebook Pages and User profiles.

So, what you need to is use something like phpQuery and just go look for whatever tags you want to make sure exist on the user's page.

share|improve this answer

Your Answer


