Yahoo! Developer Network Blog
« Previous | Main | Next »
May 9, 2008
oEmbed - Embedding third party media made easy
Web 2.0 is all about collaboration, distribution and personal configuration and probably one of the biggest traffic drivers of social networks like Facebook or MySpace are videos and photos being sent to and from your contacts.
The problem for developers of networks is that you don't want people to leave your application to see a photo or a video, which means that you need a way to only get the media and embed that. Normally this happens using the media provider's API or - if they don't offer one - screen scraping (loading the whole document and programatically finding and extracting the media).
oEmbed is a great idea to work around that issue:
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple 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.
Flickr, Viddler, Qik, Pownce and Revision3 are the first services to support oEmbed which means you can easily access photos and videos with a simple URL.
Say for example find a nice photo on flickr:
Original URL:
oEmbed URL:
Result:
<oembed>
<version>1.0</version>
<type>photo</type>
<title>? too much myspace error</title>
<author_name>codepo8</author_name>
<author_url>http://www.flickr.com/photos/codepo8/</author_url>
<cache_age>3600</cache_age>
<provider_name>Flickr</provider_name>
<provider_url>http://www.flickr.com/</provider_url>
<width>500</width>
<height>375</height>
<url>
http://farm4.static.flickr.com/3128/2475016321_982666ec95.jpg
</url>
</oembed>
You can define the output format and the maximum width and height with URL parameters:
oEmbed URL:
Result:
{
version: '1.0',
type: 'photo',
title: '? too much myspace error',
author_name: 'codepo8',
author_url: 'http://www.flickr.com/photos/codepo8/',
cache_age: '3600',
provider_name: 'Flickr',
provider_url: 'http://www.flickr.com/',
width: '100',
height: '75',
url: 'http://farm4.static.flickr.com/3128/2475016321_982666ec95_t.jpg'
}
Supported formats for responses so far are photo, video, link and rich.
Christian Heilmann
Yahoo Developer Network
Posted at May 9, 2008 4:51 AM | Permalink
Comments
This is a brilliant idea! Solves the exact problem I've been looking at recently.
Is there any backend "best practice" example for php? I will write a way to parse the response, but wondered if there existed a method that sticks to the spec accurately.
Hopefully this will be adopted by more websites quickly! Well done for getting it out to Flickr to get the ball rolling. Yahoo really seems to be innovating recently - Google is starting to look a little old fashioned!
Posted by: Rich at May 9, 2008 11:35 AM
Rich - there's work going on to make a PHP PEAR module to do all the heavy lifting. I expect it'll be posted at oembed.com in the not too distant future.
Posted by: Cal at May 9, 2008 2:00 PM
While there is definitely a need for what is being provided by oEmbed, it seems the implementation leaves a lot to be desired. Most of this could be accomplished in a much more straightforward manner, using REST guidelines.
I've laid out my thoughts on the matter here:
http://www.backdrifter.com/2008/05/09/oembed-fail-represent-restfully/
I'd be interested in further discussion. Specifically around the need for an oEmbed API endpoint.
Posted by: Jared Hanson at May 9, 2008 3:23 PM
I've created proposal for Zend Framework component Zend_Oembed. Details here: http://framework.zend.com/wiki/display/ZFPROP/Zend_Oembed+-+Pawel+Przeradowski. I also have sketchy but working implementation on top of Zend_Http_Client.
Posted by: Pawel at May 13, 2008 2:42 PM
Configuration for oEmbed is very simple. Providers must specify one or more URL scheme and API endpoint pairs. A consumer wishes to show an embedded representation of a third party resource on their own web site.
Posted by: Janet at May 22, 2008 1:10 AM
Doesn't this bump into problems with copyright and guidelines of the provider? The Flickr example, you wouldn't know its ©all rights and guidelines require link back to the photo page.
Posted by: rev at May 22, 2008 10:41 AM
http://en.wikipedia.org/wiki/OEmbed needs more detail...
Posted by: Rich at June 4, 2008 2:19 PM
Could you please return thumbnail metadata in the response too?
I started to implement a general OEmbed / embedcode service, with a focus on flickr, but I had to realize that I couldn't use flickr's oembed response directly, since the one thing I'd use when embedding a flickr image - the thumbnail - is missing.
Posted by: Adam Nemeth at June 10, 2008 2:21 PM
Post a comment
Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.
Subscribe
Recent Blog Articles
view all
YQL Open Table for Google Buzz now live
Tue, 09 Feb 2010
INSERT INTO twitter.status ...
Mon, 08 Feb 2010
Announcing the Yahoo! Brasil Open Hack Day 2010, 20-21 March
Mon, 08 Feb 2010
Marketing hacks, linchpins, and tech women of valor
Sun, 07 Feb 2010
Yahoo! India invites you to join the first India Hadoop Summit
Thu, 04 Feb 2010
Recent Links
Appcelerator Titanium + Yahoo YQL on Vimeo
Mon, 08 Feb 2010
Tue, 02 Feb 2010
PhoneGap | Cross platform mobile framework
Sat, 30 Jan 2010
Web developers can rule the iPad - O'Reilly Radar
Sat, 30 Jan 2010
rc3.org - Is the iPad the harbinger of doom for personal computing?
Thu, 28 Jan 2010
Archives
2010
2009
2008
2007
2006
2005
Recent Readers

