oEmbed API

oEmbed is a format for allowing an embedded representation of a URL on third party sites.

This API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly. The MetaCDN oEmbed API can be used to allow third party web sites to read meta-data about your content or media.

Get oEmbed meta-data

HTTP Operation:GET
URL: GET http://www.metacdn.com/api/oembed?url={metaCdnUrl}&format={format}&maxwidth={maxwidth}&maxheight={maxheight}
URL Scheme (media): http://www.metacdn.com/r/m/*
URL Scheme (content): http://www.metacdn.com/r/c/*
Auth: None
"Accept" header: application/json+oembed or text/xml+oembed
Expected HTTP response: HTTP/1.1 200 OK
Expected Format (mandatory, optional):
GET /api/oembed?url={metaCdnUrl}&format={json|xml|jsonp}&callback={callback} HTTP/1.1
Notes:
Example Call #1:
GET http://www.metacdn.com/api/oembed?url=http://www.metacdn.com/r/m/5RJhVGiSZO/56IX9R&format=json HTTP/1.1
Accept: application/json+oembed
Expected Response #1:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Accept-Ranges: bytes
Date: Sun, 07 Nov 2010 10:31:20 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Connection: close {
    "version": "1.0",
    "type": "video",
    "provider_name": "MetaCDN",
    "provider_url": "http://www.metacdn.com",
    "width": 426,
    "height": 240,
    "html": "<iframe> ... ... </iframe>",
    "thumbnail_url": "http://lh4.ggpht.com/F8h40vwBtEJ9N1QAyqkSF_ZpapAr1iaum9U7CTvi2TeIRyl-6NgdmmeXATgw8a_KiS-8v5fxL71Fvifwvm8Pcw4qDEVusuw=s426",
    "thumbnail_width": 426,
    "thumbnail_height": 240,
    "title": "My Video",
    "description": "A longer description of my video.",
    "author_name": "joebloggs",
    "author_url": "http://www.metacdn.com/api/users/joebloggs"
}
Example Call #2:
GET http://www.metacdn.com/api/oembed?url=http://www.metacdn.com/r/m/5RJhVGiSZO/56IX9R&format=xml HTTP/1.1
Accept: text/xml+oembed
Expected Response #2:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Accept-Ranges: bytes
Date: Sun, 07 Nov 2010 12:00:03 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Connection: close

http://www.metacdn.com
My Video
A longer description of my video
joebloggs
426
240
<html><iframe> ... ... </iframe></html>
http://lh4.ggpht.com/F8h40vwBtEJ9N1QAyqkSF_ZpapAr1iaum9U7CTvi2TeIRyl-6NgdmmeXATgw8a_KiS-8v5fxL71Fvifwvm8Pcw4qDEVusuw=s426
426
240
1.0
http://www.metacdn.com/api/users/joebloggs
MetaCDN
video

Example Call #3:
GET http://www.metacdn.com/api/oembed?url=http://www.metacdn.com/r/m/5RJhVGiSZO/56IX9R&format=jsonp HTTP/1.1
Accept: application/json+oembed
Expected Response #3:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Accept-Ranges: bytes
Date: Mon, 08 Nov 2010 06:45:08 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Connection: close
callback ({
    "version": "1.0",
    "type": "video",
    "provider_name": "MetaCDN",
    "provider_url": "http://www.metacdn.com",
    "width": 426,"height": 240, 
    "html": "<iframe> ... ... </iframe>",
    "title": "My Video",
    "description": "A longer description of my video",
    "author_name": "joebloggs",
    "author_url": "http://www.metacdn.com/api/users/joebloggs"
});