oEmbed APIs
Added by IBM contributorIBM | Edited by Claudia R Elbourn on June 16, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

The purpose of the oEmbed API is to return meta-data associated with a given url passed in input. The API response is shaped on the oEmbed standard model.

Example of returned meta-data for a URL pointing to an HTML page includes the site name and description.

End-point location: {opengraphCtxRoot}/opengraph/{basic|form|oauth}/{anonymous}/api/embed

Example: {hostName}/connections/opengraph/form/anonymous/api/oembed


The end-point only accepts GET HTTP requests.

 

Request parameters

Name
Description
Default value
url
Specify the URL to a remote resource to extract meta-data from.
Support url pointing to HTML and image resources only.
None
maxHeight
The maximum height of embedded resources to be allowed (used by proxy image service). This value sets the maxHeight request parameter on the thumbnails elements of the response.
None
maxWidth
The maximum width of embedded resources to be allowed (used by proxy image service). This value sets the maxWidth request parameter on the thumbnails elements of the response.
None
format
Format of the response: 'json' or 'xml'
json
extended
If set to 'true' the end-point returns additional meta-data not part of the oEmbed specs: thumbnails and raw field (full meta-data tags from the site)
false

Response
  • A 200 response in the JSON or XML format based on the oEmbed model.
  • If the url is invalid or pointing to a non-existing resource, an HTTP response 404 is returned
Examples
https://example.org/connections/opengraph/form/anonymous/api/oembed?url=http%3A%2F%2Fwww.ibm.com&maxHeight=180&maxWidth=180&extended=true

Response returned by the server
{
  "provider_url":"www.ibm.com",
  "thumbnails": [
    "https:\/\/example.org\/connections\/thumbnail\/api\/imageProxy?url=http%3a%2f%2fwww.ibm.com%2fimages%2fportal%2fH878951C10974G18%2ftri_logo_black_angle_1.jpg&maxHeight=180&maxWidth=180",
    "https:\/\/example.org\/connections\/thumbnail\/api\/imageProxy?url=http%3a%2f%2fwww.ibm.com%2fimages%2fportal%2fW194010Z28959V45%2fibm_homepage_linkedin_180x110.png&height=110&width=180&maxHeight=180&maxWidth=180"
  ],
  "raw": {
    "security":"public",
    "site_name":"IBM - United States",
    "robots":"index,follow",
    "dc.type":"CT002",
    "dc.publisher":"IBM Corporation",
    "twitter:title":"IBM",
    "updated_time":"1392144595",
    "twitter:image":"http:\/\/www.ibm.com\/images\/portal\/H878951C10974G18\/tri_logo_black_angle_1.jpg",
    "ibm.industry":"",
    "title":"IBM - United States",
    "source":"v17 delivery:ECM\/Filegen authoring:ECM\/IConS Adopter ibm.com - S734638V15397V06 - 04\/24\/2014 09:41:07 AM",
    "image": [
      "http:\/\/www.ibm.com\/images\/portal\/H878951C10974G18\/tri_logo_black_angle_1.jpg",
      "http:\/\/www.ibm.com\/images\/portal\/W194010Z28959V45\/ibm_homepage_linkedin_180x110.png"
    ],
    "ibm.country":"US",
    "abstract":"For more than a century IBM has been dedicated to every client's success and to creating innovations that matter for the world",
    "twitter:creator":"@IBM",
    "image:height":"110",
    "dc.rights":"\u00A9 Copyright IBM Corp. 2014, 2012",
    "image:width":"180",
    "dc.language":"en-US",
    "keywords":"The IBM corporate home page, entry point to information about IBM products and services",
    "ibm.effective":"2012-05-29",
    "twitter:site":"@IBM",
    "url":"http:\/\/www.ibm.com\/us\/en\/",
    "owner":"Joan Renner\/Armonk\/IBM",
    "twitter:description":"For more than a century IBM has been dedicated to every client's success and to creating innovations that matter for the world",
    "twitter:card":"summary",
    "ibm.expires":"--",
    "type":"website",
    "website:tag": [
      "technology",
      "cloud computing",
      "b2b",
      "science"
    ],
    "description":"For more than a century IBM has been dedicated to every client's success and to creating innovations that matter for the world",
    "dc.date":"2014-04-24",
    "dc.subject":"IBM101"
  },
  "title":"IBM - United States",
  "version":"1.0",
  "type":"link",
  "description":"For more than a century IBM has been dedicated to every client's success and to creating innovations that matter for the world",
  "originalUrl":"http:\/\/www.ibm.com",
  "url":"http:\/\/www.ibm.com\/us\/en\/"
}