oEmbed API endpoint

One of the two Iframely endpoints implements simple oEmbed protocol:

  • You send your URL via a GET request and receive HTML embed code as html field of JSON response.
  • The HTML embed codes will be responsive whenever possible.
  • Depending on your API settings and/or request parameters, the HTML codes may point to providers domain or be routed via Iframely iFrames.

API Request

>> http://iframe.ly/api/oembed?url=… &api_key= ….

  • url and api_key parameters are required.
  • url needs to be URL-encoded.
  • for enhanced security, api_key can be substituted with key parameter, which should be the md5 hash value of your actual API key.

If you make API calls via JavaScript, and your site uses SSL, change endpoint's protocol to https://.

API Response

>> Here’s sample oEmbed response for Coub

{
    "url": "http://coub.com/view/2pc24rpb",
    "type": "rich",
    "version": "1.0",
    "title": "PARADISE BEACH",
    "author": "Ilya Trushin",
    "author_url": "http://coub.com/trucoubs",
    "provider_name": "Coub",
    "thumbnail_url": "http://cdn1 ... /med_1381670134_00040.jpg",
    "thumbnail_width": 640,
    "thumbnail_height": 360,
    "html": "<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.243%;\"><iframe src=\"//coub.com/embed/2pc24rpb\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"></iframe></div>",
}

photo, video and rich types are supported as oEmbed output. If Iframely doesn't have any embed codes for a given URL, oEmbed will return link type object.

Heads up: photo type of oEmbed gives image resource as url field rather than as html value.