Tuesday, May 8, 2007

[zz]Google’s New Picasa API

Google released a new API: the Picasa Web Albums Data API for photos. Using this API, which is part of the "GData" framework (which itself makes use of Atom feeds), you can include your photos on web pages or manage them from within other applications, among other stuff.

One of the most straightforward, read-only uses is to simply request the contents of a public album to display its images. You'll use the following URL return a "REST"-style XML:

http://picasaweb.google.com/data/feed/api/
user/philipp.lenssen/album/55WaysToHaveFunWithGoogle

... where the first bold parameter is the user ID, and the second bold parameter is the album name. Here's a small sample function in PHP5, which generates this output:

Image editor Picnik, which needs Flash 9, is a (very cool) third-party sample application making use of this API already. The problem? To connect to your Picasa album, Picnik requires you to enter your Google Account login & password. There's no way I'll do that on a non-Google domain (outside of Orkut, I guess, but even at Orkut the login Iframe is hosted at Google.com). A better way to implement this might be to forward to a Google.com page – one that promises your credentials won't be shared with the site – which then only passes back a token to the application.

No comments: