0

Is there a way to retrieve the content value of a url's og:image property using a https://graph.facebook.com query programmatically?

My og-enabled page (a "url", http://mysite.net/my/page/1234/ in this case) will contain meta tags like these:-

<meta property="fb:admins" content="3132223"/>
<meta property="fb:app_id" content="60376622227"/>    
<meta property="og:locale" content="en_US"/>    
<meta property="og:title" content="My og title abcdefg "/>
<meta property="og:description" content="This rocks!" />
<meta property="og:site_name" content="mysite.com"/>
<meta property="og:image" content="http://media2.mysite.com/files/albums/displayfb/abc.jpg"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://mysite.net/my/page/1234/"/>

I am aware that I can use facebook debugger like this for example https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.rottentomatoes.com%2Fm%2Fmatrix%2F

to query a given url and facebook debugger will provide the results. But I need a programmatic way to retrieve the results, not point-and-click on facebook debugger tool.

Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167

1 Answers1

1

I did not find any graph api to query an og-enabled web url to easily retrieve other og attributes.

So the alternative, which is widely used, is to scrape the page. Reference answer here - How to get Open Graph Protocol of a webpage by php?

Community
  • 1
  • 1
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167