skip to Main Content

I want to fetch metadata of any web-page using Facebook Open Graph Object Debugger.

We can get it from this URL: Open Graph Object Debugger

Example: Open Graph Object Debugger for Google

It will provide all the information related to that URL. Is there any way to get this information using API(in JSON format)?

2

Answers


  1. Yes, via the API URL Object described here and in even more detail here. Note that you can issue a POST request to this URL to force a refresh. You can even get additional data such as how many times that link was shared on Facebook!

    https://graph.facebook.com/v2.10/?fields=og_object&id=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt2015381%2F&access_token={YOUR_TOKEN}
    

    I did experience inconsistencies, namely if the obejct does not exist the API will return nothing but if you query it a few seconds later it will be there. For this reason we could not rely on Facebook and simply fetched the page ourselves and parsed out the og:* tags.

    It may be perfect if you don’t care about misses and having to re-fetch or if you just want to programmatically clear the Facebook OG cache.

    It’s wise to post to it every time you create a new page to force the cache or sometimes the first person to paste the URL into Facebook won’t get the link preview!

    Login or Signup to reply.
  2. Yes you can use this https://urlmeta.org

    Its usage is pretty simple. Just make a GET call and pass the URL to API endpoint: https://api.urlmeta.org and you are done.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search