Important: This is an old version of this page. For the latest version, use the links in the left-side navbar.
Picasa Web Albums allows client applications to view and update albums, photos, and comments in the form of Google Data API feeds. Your client application can use the Picasa Web Albums Data API to create new albums, upload photos, add comments, edit or delete existing albums, photos, and comments, and query for items that match particular criteria.
This document is intended for programmers who want to write client applications that can interact with Picasa Web Albums. It provides a series of examples of basic Data API interactions using raw XML/HTTP, with explanations. After reading this document, you can learn more about interacting with the API using our client libraries by reading the language-specific examples found on the other sections of this document.
For Picasa Web Albums Data API reference information, see the reference guide.
This document assumes that you understand the general ideas behind the Google Data APIs protocol. Each example in this document first shows how to use the bare protocol to interact with Picasa Web Albums.
To request or upload documents, your client needs an authentication token. The following sections explain how to authenticate for different types of client applications.
Your choice of authentication method should be determined by the kind of client you're writing: single-user desktop applications should use the ClientLogin system, while multi-user web apps should use the AuthSub system. For a more detailed discussion of these authentication systems, see the Google Account Authentication document.
Whichever method you choose, you can either send raw HTTP requests or have Google's client libraries handle the authentication for you.
To authenticate the user, send a POST request to the following URL:
https://www.google.com/accounts/ClientLogin
Include the relevant parameters in the body of the POST request, as described in the ClientLogin documentation. The service name for Picasa Web Albums is lh2.
If the request succeeds, then the response contains an alphanumeric string labeled Auth.
After a successful authentication request, use the Auth value to create an Authorization header for each request:
Authorization: GoogleLogin auth=yourAuthValue
To acquire an AuthSub token for a given Picasa Web Albums user, your application must redirect the user to the AuthSubRequest URL at Google, which prompts them to log into their Google account.
After the user logs in, the AuthSub system redirects them to the URL you specified in the next query parameter of the AuthSubRequest URL. The AuthSub system appends an authentication token to the next URL as the value of the token query parameter. Your application then uses that authentication token in subsequent interactions with Picasa Web Albums.
The below example shows a request to authorize www.example.com:
https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2F&session=1&secure=0&next=http%3A%2F%2Fwww.example.com%2Fwelcome.pyc
The important part to note above is that the scope of the AuthSub token for all of the Picasa Web Albums feeds is:
http://picasaweb.google.com/data/
By default, the AuthSub token can only be used for one request. To receive a token which can be used for multiple requests, it must be upgraded
by making an HTTP GET request which contains the single use token as an Authorization header. A token may only be upgraded if the initial AuthSub request included session=1 as a URL parameter.
GET https://www.google.com/accounts/accounts/AuthSubSessionToken Authorization: AuthSub token="yourAuthToken"
If the token was upgraded successfully, the server's response contains the new token information in the HTTP headers. Here's an example response:
Token=DQAA...7DCTN Expiration=20061004T123456Z
You can disregard the "Expiration" value, this token will not expire unless it is revoked by the user or the application. Use the authentication token to create an Authorization header for each request:
Authorization: AuthSub token="DQAA...7DCTN"
For details, including information on registering your application with Google and other topics, see the AuthSub documentation.
Albums are the way Picasa Web Albums groups photos into useful sets. These albums can be public or unlisted, and have their own properties such as a geographic location, a description, or a date.
You do not have to authenticate to retrieve data about public albums, but in order to create, update, or delete content you must authenticate using one of the methods discussed in the authentication section.
To get a feed listing all of the albums belonging to user userID, you send an HTTP request like the following to Picasa Web Albums:
GET http://picasaweb.google.com/data/feed/api/user/userID
The string "default" can be used in place of a real userID, in which case the server will use the userID of the user credentials used to authenticate the request.
You will get back a feed of album entries, which will look similar to the following:
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>http://picasaweb.google.com/data/feed/api/user/default</id>
<updated>2008-08-15T19:20:21.903Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#user' />
<title type='text'>liz</title>
<subtitle type='text'></subtitle>
<icon>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</icon>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz' />
<link rel='http://schemas.google.com/g/2005#post'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz' />
<link rel='http://schemas.google.com/photos/2007#slideshow'
type='application/x-shockwave-flash'
href='http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fliz%3Falt%3Drss' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz?start-index=1&max-results=1000' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<generator version='1.00' uri='http://picasaweb.google.com/'>
Picasaweb</generator>
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>1000</openSearch:itemsPerPage>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:thumbnail>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</gphoto:thumbnail>
<gphoto:quotalimit>1073741824</gphoto:quotalimit>
<gphoto:quotacurrent>23044</gphoto:quotacurrent>
<gphoto:maxPhotosPerAlbum>500</gphoto:maxPhotosPerAlbum>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041</id>
<published>2008-07-28T07:00:00.000Z</published>
<updated>2008-08-15T18:58:45.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#album' />
<title type='text'>lolcats</title>
<summary type='text'>Hilarious Felines</summary>
<rights type='text'>public</rights>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5228155363249705041' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz/Lolcats' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041' />
<link rel='edit' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/1218826725077000' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<gphoto:id>5228155363249705041</gphoto:id>
<gphoto:name>Lolcats</gphoto:name>
<gphoto:location>mountain view, ca</gphoto:location>
<gphoto:access>public</gphoto:access>
<gphoto:timestamp>1217228400000</gphoto:timestamp>
<gphoto:numphotos>1</gphoto:numphotos>
<gphoto:numphotosremaining>499</gphoto:numphotosremaining>
<gphoto:bytesUsed>23044</gphoto:bytesUsed>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:commentingEnabled>true</gphoto:commentingEnabled>
<gphoto:commentCount>0</gphoto:commentCount>
<media:group>
<media:title type='plain'>lolcats</media:title>
<media:description type='plain'>Hilarious
Felines</media:description>
<media:keywords></media:keywords>
<media:content url='http://lh5.ggpht.com/liz/SI4jmlkNUFE/AAAAAAAAAzU/J1V3PUhHEoI/Lolcats.jpg'
type='image/jpeg' medium='image' />
<media:thumbnail url='http://lh5.ggpht.com/liz/SI4jmlkNUFE/AAAAAAAAAzU/J1V3PUhHEoI/s160-c/Lolcats.jpg'
height='160' width='160' />
<media:credit>Liz</media:credit>
</media:group>
<georss:where>
<gml:Point>
<gml:pos>37.38911780598221 -122.08638668060303</gml:pos>
</gml:Point>
<gml:Envelope>
<gml:lowerCorner>37.38482151758655
-122.0958924293518</gml:lowerCorner>
<gml:upperCorner>37.39341409437787
-122.07688093185425</gml:upperCorner>
</gml:Envelope>
</georss:where>
</entry>
</feed>
For information about what each of those elements means, see the Picasa Web Albums Reference document, the Google Data APIs Protocol Reference document, or the Atom 1.0 specification.
Albums can be created through the API by doing a POST request with an appropriately formed entry. Note you will have to authenticate this request using one of the authentication mechanisms discussed in the Authentication section.
POST http://picasaweb.google.com/data/feed/api/user/userID
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<title type='text'>Trip To Italy</title>
<summary type='text'>This was the recent trip I took to Italy.</summary>
<gphoto:location>Italy</gphoto:location>
<gphoto:access>public</gphoto:access>
<gphoto:commentingEnabled>true</gphoto:commentingEnabled>
<gphoto:timestamp>1152255600000</gphoto:timestamp>
<media:group>
<media:keywords>italy, vacation</media:keywords>
</media:group>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#album'></category>
</entry>
Picasa Web Albums creates a new album using the data you sent, then returns an HTTP 201 status code, along with a copy of the new album in the form of an <entry> element. The returned entry is similar to the one you sent, but the returned one contains various elements added by the server, such as an <id> element. The body of the response will look similar to the following:
<?xml version='1.0' encoding='utf-8'?>
<entry xmlns='http://www.w3.org/2005/atom'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/albumid/5234895224305218129</id>
<published>2006-07-07T07:00:00.000Z</published>
<updated>2008-08-15T23:47:03.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#album' />
<title type='text'>Trip To Italy</title>
<summary type='text'>This was the recent trip I took to
Italy.</summary>
<rights type='text'>public</rights>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5234895224305218129' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz/TripToItaly' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5234895224305218129' />
<link rel='edit' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5234895224305218129/1218844023990000' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<gphoto:id>5234895224305218129</gphoto:id>
<gphoto:name>TripToItaly</gphoto:name>
<gphoto:location>Italy</gphoto:location>
<gphoto:access>public</gphoto:access>
<gphoto:timestamp>1152255600000</gphoto:timestamp>
<gphoto:numphotos>0</gphoto:numphotos>
<gphoto:numphotosremaining>500</gphoto:numphotosremaining>
<gphoto:bytesUsed>0</gphoto:bytesUsed>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:commentingEnabled>true</gphoto:commentingEnabled>
<gphoto:commentCount>0</gphoto:commentCount>
<media:group>
<media:title type='plain'>Trip To Italy</media:title>
<media:description type='plain'>This was the recent trip I took
to Italy.</media:description>
<media:keywords></media:keywords>
<media:content url='http://lh3.ggpht.com/liz/SKYVeIkZ8lE/AAAAAAAAA0M/uYvOzEAgx78/TripToItaly.jpg'
type='image/jpeg' medium='image' />
<media:thumbnail url='http://lh3.ggpht.com/liz/SKYVeIkZ8lE/AAAAAAAAA0M/uYvOzEAgx78/s160-c/TripToItaly.jpg'
height='160' width='160' />
<media:credit>Liz</media:credit>
</media:group>
<georss:where>
<gml:Point>
<gml:pos>41.871939999999995 12.56738</gml:pos>
</gml:Point>
<gml:Envelope>
<gml:lowerCorner>36.07218184999999
6.620518900000001</gml:lowerCorner>
<gml:upperCorner>47.67169815 18.5142411</gml:upperCorner>
</gml:Envelope>
</georss:where>
</entry>
If your request fails for some reason, then a different status code may be returned. For information about the status codes used by the API, see the HTTP status codes section of the Google Data APIs protocol reference document.
Once an album entry is retrieved, it can be modified by sending a PUT request to the URI inside of the <link rel="edit"> with the new album data.
PUT http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/versionNumber
Note that if you try to update using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
You can delete an album by sending an authenticated HTTP DELETE request to the URI inside of the <link rel="edit">:
DELETE http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/versionNumber
Note that if you try to update using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
When uploading, modifying, or removing photos, you will have to authenticate using one of the methods discussed in the Authentication section.
There are different ways to retrieve photos. The most common is to get a list of all of the photos in an album, but you can also retrieve recent photos from a user, or search photos from the public albums of other users.
To get a feed listing all of the photos in an album with the id albumID, belonging to user userID, you send an HTTP request like the following to Picasa Web Albums:
GET http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
The string "default" can be used in place of a real userID, in which case the server will use the userID of the user credentials used to authenticate the request.
In this example, we're retrieving the album by its ID, which can be found in the <gphoto:id> element of the Album entry.
Note: The entries in a feed are ordered based upon the display order on the web site.
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>
http://picasaweb.google.com/data/feed/api/user/default/albumid/5228155363249705041</id>
<updated>2008-08-15T19:01:04.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#album' />
<title type='text'>lolcats</title>
<subtitle type='text'>Hilarious Felines</subtitle>
<rights type='text'>public</rights>
<icon>
http://lh5.ggpht.com/liz/SI4jmlkNUFE/AAAAAAAAAzU/J1V3PUhHEoI/s160-c/Lolcats.jpg</icon>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5228155363249705041' />
<link rel='http://schemas.google.com/g/2005#post'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5228155363249705041' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz/Lolcats' />
<link rel='http://schemas.google.com/photos/2007#slideshow'
type='application/x-shockwave-flash'
href='http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fliz%2Falbumid%2F5228155363249705041%3Falt%3Drss' />
<link rel='http://schemas.google.com/photos/2007#report'
type='text/html'
href='http://picasaweb.google.com/lh/reportAbuse?uname=liz&aid=5228155363249705041' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5228155363249705041?start-index=1&max-results=1000' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<generator version='1.00' uri='http://picasaweb.google.com/'>
Picasaweb</generator>
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>1000</openSearch:itemsPerPage>
<gphoto:id>5228155363249705041</gphoto:id>
<gphoto:name>Lolcats</gphoto:name>
<gphoto:location>mountain view, ca</gphoto:location>
<gphoto:access>public</gphoto:access>
<gphoto:timestamp>1217228400000</gphoto:timestamp>
<gphoto:numphotos>1</gphoto:numphotos>
<gphoto:numphotosremaining>499</gphoto:numphotosremaining>
<gphoto:bytesUsed>23044</gphoto:bytesUsed>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:commentingEnabled>true</gphoto:commentingEnabled>
<gphoto:commentCount>0</gphoto:commentCount>
<georss:where>
<gml:Point>
<gml:pos>37.38911780598221 -122.08638668060303</gml:pos>
</gml:Point>
<gml:Envelope>
<gml:lowerCorner>37.38482151758655
-122.0958924293518</gml:lowerCorner>
<gml:upperCorner>37.39341409437787
-122.07688093185425</gml:upperCorner>
</gml:Envelope>
</georss:where>
<gphoto:allowPrints>true</gphoto:allowPrints>
<gphoto:allowDownloads>true</gphoto:allowDownloads>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306</id>
<published>2008-08-15T18:58:44.000Z</published>
<updated>2008-08-15T19:01:04.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#photo' />
<title type='text'>invisible_bike.jpg</title>
<summary type='text'></summary>
<content type='image/jpeg'
src='http://lh5.ggpht.com/liz/SKXR5BoXabI/AAAAAAAAAzs/tJQefyM4mFw/invisible_bike.jpg' />
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/lh/photo/THdOPB27qGrofntiI91-8w' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306' />
<link rel='edit' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/1218826864901001' />
<link rel='edit-media' type='image/jpeg'
href='http://picasaweb.google.com/data/media/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/1218826864901001' />
<link rel='media-edit' type='image/jpeg'
href='http://picasaweb.google.com/data/media/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/1218826864901001' />
<link rel='http://schemas.google.com/photos/2007#report'
type='text/html'
href='http://picasaweb.google.com/lh/reportAbuse?uname=liz&aid=5228155363249705041&iid=5234820919508560306' />
<gphoto:id>5234820919508560306</gphoto:id>
<gphoto:version>1218826864901001</gphoto:version>
<gphoto:position>1.0</gphoto:position>
<gphoto:albumid>5228155363249705041</gphoto:albumid>
<gphoto:width>410</gphoto:width>
<gphoto:height>295</gphoto:height>
<gphoto:size>23044</gphoto:size>
<gphoto:client></gphoto:client>
<gphoto:checksum></gphoto:checksum>
<gphoto:timestamp>1218826724000</gphoto:timestamp>
<exif:tags>
<exif:imageUniqueID>
0657130896bace739a44ce90a7d5b451</exif:imageUniqueID>
</exif:tags>
<gphoto:commentingEnabled>true</gphoto:commentingEnabled>
<gphoto:commentCount>1</gphoto:commentCount>
<media:group>
<media:title type='plain'>invisible_bike.jpg</media:title>
<media:description type='plain'></media:description>
<media:keywords>invisible, bike</media:keywords>
<media:content url='http://lh5.ggpht.com/liz/SKXR5BoXabI/AAAAAAAAAzs/tJQefyM4mFw/invisible_bike.jpg'
height='295' width='410' type='image/jpeg' medium='image' />
<media:thumbnail url='http://lh5.ggpht.com/liz/SKXR5BoXabI/AAAAAAAAAzs/tJQefyM4mFw/s72/invisible_bike.jpg'
height='52' width='72' />
<media:thumbnail url='http://lh5.ggpht.com/liz/SKXR5BoXabI/AAAAAAAAAzs/tJQefyM4mFw/s144/invisible_bike.jpg'
height='104' width='144' />
<media:thumbnail url='http://lh5.ggpht.com/liz/SKXR5BoXabI/AAAAAAAAAzs/tJQefyM4mFw/s288/invisible_bike.jpg'
height='208' width='288' />
<media:credit>Liz</media:credit>
</media:group>
<georss:where>
<gml:Point>
<gml:pos>37.427399548633325 -122.1703290939331</gml:pos>
</gml:Point>
<gml:Envelope>
<gml:lowerCorner>37.42054944692195
-122.1825385093689</gml:lowerCorner>
<gml:upperCorner>37.4342496503447
-122.15811967849731</gml:upperCorner>
</gml:Envelope>
</georss:where>
</entry>
</feed>
It is also possible to retrieve the photos associated with a user, but without specifying any particular album. The following request retrieves the last 10 photos uploaded by userID:
GET http://picasaweb.google.com/data/feed/api/user/userID?kind=photo&max-results=10
For more information about the query parameters that can be used with the API, consult the query parameters section of the Reference Guide.
With the API, you can search photos uploaded by other users, as long as they are in a public album. The following request retrieves 10 photos matching a search for "puppy":
GET http://picasaweb.google.com/data/feed/api/all?q=puppy&max-results=10
This will return a feed that looks similar to the following:
<?xml version='1.0' encoding='utf-8'?<
<feed xmlns='http://www.w3.org/2005/atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>http://picasaweb.google.com/data/feed/api/all</id>
<title type='text'>Search Results</title>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/all' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/all?q=puppy&start-index=1&max-results=1' />
<link rel='next' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/all?q=puppy&start-index=2&max-results=1' />
<generator version='1.00' uri='http://picasaweb.google.com/'>
Picasaweb</generator>
<openSearch:totalResults>625082</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>1</openSearch:itemsPerPage>
<gphoto:crowded_length>10</gphoto:crowded_length>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/captaincool/albumid/5149978741790672209/photoid/5150621887373445842</id>
<published>2008-01-01T21:23:28.000Z</published>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#photo' />
<title type='text'>Nash2.jpg</title>
<summary type='text'></summary>
<content type='image/jpeg'
src='http://lh3.ggpht.com/captaincool/R3qvUUE_CtI/AAAAAAAAAUI/6OfFN8oPdVs/Nash2.jpg' />
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/captaincool/albumid/5149978741790672209/photoid/5150621887373445842' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/lh/photo/rWtmnLrEZ2RRHvtL6dFKKw' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/captaincool/albumid/5149978741790672209/photoid/5150621887373445842' />
<link rel='http://schemas.google.com/photos/2007#report'
type='text/html'
href='http://picasaweb.google.com/lh/reportAbuse?uname=captaincool&aid=5149978741790672209&iid=5150621887373445842' />
<author>
<name>Chuck G</name>
<uri>http://picasaweb.google.com/captaincool</uri>
<email>captaincool</email>
<gphoto:user>captaincool</gphoto:user>
<gphoto:nickname>Chuck G</gphoto:nickname>
<gphoto:thumbnail>
http://lh4.ggpht.com/captaincool/AAAAUbIDjgE/AAAAAAAAAAA/U8PdSmOpLUY/s48-c/captaincool.jpg</gphoto:thumbnail>
</author>
<gphoto:albumtitle>Monctondog.com Blog</gphoto:albumtitle>
<gphoto:albumctitle>MonctondogComBlog</gphoto:albumctitle>
<gphoto:albumdesc>Pictures of Dogs from the Monctondog.com
Blog</gphoto:albumdesc>
<gphoto:location>Moncton NB</gphoto:location>
<gphoto:access>public</gphoto:access>
<gphoto:id>5150621887373445842</gphoto:id>
<gphoto:albumid>5149978741790672209</gphoto:albumid>
<gphoto:width>1024</gphoto:width>
<gphoto:height>768</gphoto:height>
<gphoto:timestamp>1196770081000</gphoto:timestamp>
<exif:tags>
<exif:fstop>2.8</exif:fstop>
<exif:make>SONY</exif:make>
<exif:model>DSC-W1</exif:model>
<exif:exposure>0.025</exif:exposure>
<exif:flash>true</exif:flash>
<exif:focallength>7.9</exif:focallength>
<exif:iso>100</exif:iso>
<exif:time>1196770081000</exif:time>
</exif:tags>
<media:group>
<media:title type='plain'>Nash2.jpg</media:title>
<media:description type='plain'></media:description>
<media:keywords>doindogs, doindogs nash, lab, labrador,
labrador retriever, nash, puppies, puppy,
retriever</media:keywords>
<media:content url='http://lh3.ggpht.com/captaincool/R3qvUUE_CtI/AAAAAAAAAUI/6OfFN8oPdVs/Nash2.jpg'
height='768' width='1024' type='image/jpeg' medium='image' />
<media:thumbnail url='http://lh3.ggpht.com/captaincool/R3qvUUE_CtI/AAAAAAAAAUI/6OfFN8oPdVs/s72/Nash2.jpg'
height='54' width='72' />
<media:thumbnail url='http://lh3.ggpht.com/captaincool/R3qvUUE_CtI/AAAAAAAAAUI/6OfFN8oPdVs/s144/Nash2.jpg'
height='108' width='144' />
<media:thumbnail url='http://lh3.ggpht.com/captaincool/R3qvUUE_CtI/AAAAAAAAAUI/6OfFN8oPdVs/s288/Nash2.jpg'
height='216' width='288' />
<media:credit>Chuck G</media:credit>
</media:group>
<gphoto:snippet>... nash, <b>puppies</b>
...</gphoto:snippet>
<gphoto:snippettype>PHOTO_TAGS</gphoto:snippettype>
<gphoto:truncated>0</gphoto:truncated>
</entry>
</feed>
There are two ways to add a photo to an album using the Data API:
POST body, and binary-encoded image data in another part. This is the preferred approach.While all photos appearing on the Picasa Web Albums site are in the JPEG format, photos of any of the following types can be uploaded using the API:
To send metadata along with the photo, post to the following URL:
POST http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
And use the following format for the body of the POST:
Content-Type: multipart/related; boundary="END_OF_PART"
Content-Length: 423478347
MIME-version: 1.0
Media multipart posting
--END_OF_PART
Content-Type: application/atom+xml
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>plz-to-love-realcat.jpg</title>
<summary>Real cat wants attention too.</summary>
<category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/photos/2007#photo"/>
</entry>
--END_OF_PART
Content-Type: image/jpeg
...binary image data...
--END_OF_PART--
Note that the <title> element contains the filename you want to use for the image.
To send a photo without its associated metadata, post to the following URL:
POST http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
And use the following format for the body of the POST:
Content-Type: image/jpeg Content-Length: 47899 Slug: plz-to-love-realcat.jpg ...binary image data goes here...
The optional Slug: HTTP header specifies a filename for Picasa Web Albums to use for the photo. Not specifying a Slug: causes the server to use a default title for the image.
Note: If you want to post a photo, but don't want the hassle of requiring the user of your app to choose an album, you can post the photo to the 'Drop Box.' This special album will automatically be created the first time it is used to store a photo. To post to the 'Drop Box,' use a an albumid value of 'default': http://picasaweb.google.com/data/feed/api/user/default/albumid/default.
A video is posted in the same way as a photo with metadata. Instead of an image MIME type you have to use an appropriate video MIME type. The recognized video MIME types are:
Note: You cannot submit a video without metadata at this time. You must use a MIME multipart request like in the Post a photo with metadata section.
Videos have to undergo some processing before they become available for streaming. In order to monitor the current processing state, the photo entry returned after posting a new video will contain an additional <gphoto:videostatus> element. The element can also be found in the photo feeds. The four possible values of the status element are:
pending: the video is still being processedready: the video has been processed but still needs a thumbnailfinal: the video has been processed and has received a thumbnailfailed: a processing error has occured and the video should be deletedUsually a video can be streamed/played or accessed at the URL provided in the <media:group> section of the entry feed shortly after reaching the status ready or final. The <media:content ... medium="video"> element will contain the URL to the FLV video stream.
Normally the video processing system will automatically provide a thumbnail at the end of the processing stage. This thumbnail is created from one of the first few frames of the video. Instead, you can provide your own thumbnail by simply following the steps outlined under Update a photo. You can do this at any time while the video is still being processed or afterwards. Automatically provided thumbnails always come at QVGA resolution (320x240 pixels). To account for larger than 4:3 aspect ratios (e.g. 16:9), black borders will be added to the top and bottom of the thumbnail image.
All uploaded videos will be processed and converted into a video stream format that can be played back using the Flash video player integrated into Picasa Web Album's one-up view. The only supported format at this time is the H.263 based FLV320 with a maximum resolution of 320 by 240 pixels. The maximum upload size is limited to 100MB. Download of original video files is currently not supported. However, the FLV video stream can be downloaded by using the URL of the <media:content> video element provided in the photo entry or feed.
You can replace the metadata and/or the binary image data for a photo.
To replace both the binary data and metadata for the photo that you inserted earlier, use an HTTP request like the following:
PUT http://picasaweb.google.com/data/media/api/user/userID/albumid/albumID/photoid/photoID/versionNumber
The URI is the value of the <link rel="edit-media"> tag that was returned after you did the earlier POST. Note that if you try to update using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
In the body of the PUT, include the updated metadata and image data, in the same multipart format that you used to do the POST with metadata.
Note: As usual with Google Data APIs, you can't do a partial update of an entry; you have to send the full entry data to replace the existing data. The exception is that you can choose to send only the metadata or only the image, as described in the following sections.
To replace only the photo's binary data, use the following HTTP request:
PUT http://picasaweb.google.com/data/media/api/user/userID/albumid/albumID/photoid/photoID/versionNumber
The URI is the value of the <link rel="edit-media"> tag that was returned after you did the earlier POST. Note that if you try to update using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
In the body of the PUT, include the replacement image data, in the same format that you used to do the POST without metadata.
To replace only the photo's metadata (and not the image itself), you follow the steps that you would follow to send an update to a non-media feed.
In particular, send the following HTTP request:
PUT http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/photoid/photoID/versionNumber
The URI is the value of the <link rel="edit"> tag that was returned after you did the earlier POST. Note that if you try to update using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
In the body of the PUT, provide the updated metadata, in the form of an <atom:entry> element containing image metadata.
Note: You can't do a partial update of an entry; you have to send the full entry metadata to replace the existing metadata.
The photo itself is not re-sent to the server.
To delete a photo and its metadata, send an HTTP DELETE request to either the edit link or the edit-media link. In both cases, the photo and metadata are deleted.
For example, to delete the photo from the previous examples:
DELETE http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/photoid/photoID/versionNumber
As with updating, if you try to delete using a version number other than the latest one, you may receive an error; for more information, see Optimistic concurrency (versioning) in the Google Data APIs reference document.
Tags are a convenient way to label and organize your photos. By associating photos with descriptive strings, it makes searching through large quantities of photos easier.
Your program can retrieve a list of tags that are used by a user, in a particular album, or that are associated with a particular photo.
The following request returns a feed of the tags that userID has used in photos in their albums:
GET http://picasaweb.google.com/data/feed/api/user/userID?kind=tag
The string "default" can be used in place of a real userID, in which case the server will use the userID of the user credentials used to authenticate the request.
The feed will look similar to the following:
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>http://picasaweb.google.com/data/feed/api/user/default</id>
<updated>2008-08-15T20:24:11.146Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#user' />
<title type='text'>liz</title>
<subtitle type='text'></subtitle>
<icon>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</icon>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz' />
<link rel='http://schemas.google.com/photos/2007#slideshow'
type='application/x-shockwave-flash'
href='http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fliz%3Falt%3Drss' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz?start-index=1&max-results=500&kind=tag' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<generator version='1.00' uri='http://picasaweb.google.com/'>
Picasaweb</generator>
<openSearch:totalResults>2</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>500</openSearch:itemsPerPage>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:thumbnail>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</gphoto:thumbnail>
<gphoto:quotalimit>1073741824</gphoto:quotalimit>
<gphoto:quotacurrent>23044</gphoto:quotacurrent>
<gphoto:maxPhotosPerAlbum>500</gphoto:maxPhotosPerAlbum>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/tag/invisible</id>
<updated>1970-01-01T00:13:50.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#tag' />
<title type='text'>invisible</title>
<summary type='text'>invisible</summary>
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/lh/searchbrowse?q=invisible&psc=G&uname=liz&filter=0' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/tag/invisible' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
</entry>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/tag/bike</id>
<updated>1970-01-01T00:13:50.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#tag' />
<title type='text'>bike</title>
<summary type='text'>bike</summary>
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/lh/searchbrowse?q=bike&psc=G&uname=liz&filter=0' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/tag/bike' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
</entry>
</feed>
The following request will return a feed of tags that userID has tagged photos with in the album with ID albumID.
http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID?kind=tag
The following request will return a feed of tags that userID has tagged the photo identified by photoID with in the album with ID albumID. You can inspect the <gphoto:id> element of a photo entry to find a value for photoID.
http://picasaweb.google.com/data/feed/api/user/default/albumid/albumID/photoid/photoID?kind=tag
Note that this same information is available inside of the <media:keywords> element of the photo itself in a comma separated format.
The following request uses the tag parameter to search for all photos belonging to userID that are tagged with both "foo" and "bar".
http://picasaweb.google.com/data/feed/api/user/userID?kind=photo&tag=foo,bar
Note you could search for photos in a particular album by adding the album id to the end of the feed. Also, the comma should be percent-escaped to "%2C" in your actual request.
The following request adds the tag "awesome" to the photo identified by photoID, in the album with ID albumID which is owned by userID.
POST http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID/photoid/photoID
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>awesome</title>
<category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/photos/2007#tag"/>
</entry>
Note that this can also be done in bulk as described in the Update a photo section using the <media:keywords> element.
To delete a tag, you can use a HTTP DELETE on that tag's edit link:
DELETE http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/photoid/photoID/tag/tagID
Comments are short text snippets attached to photos by Picasa Web Albums users.
The following request returns a feed of the 10 most recent comments on a userID's photos.
The string "default" can be used in place of a real userID, in which case the server will use the userID of the user credentials used to authenticate the request.
GET http://picasaweb.google.com/data/feed/api/user/default?kind=comment&max-results=10
The resulting feed will look similar to the following:
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<id>http://picasaweb.google.com/data/feed/api/user/default</id>
<updated>2008-08-15T20:55:37.594Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#user' />
<title type='text'>liz</title>
<subtitle type='text'></subtitle>
<icon>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</icon>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz' />
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/liz' />
<link rel='http://schemas.google.com/photos/2007#slideshow'
type='application/x-shockwave-flash'
href='http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fliz%3Falt%3Drss' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/feed/api/user/liz?start-index=1&max-results=10&kind=comment' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
</author>
<generator version='1.00' uri='http://picasaweb.google.com/'>
Picasaweb</generator>
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>10</openSearch:itemsPerPage>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:thumbnail>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s64-c/liz.jpg</gphoto:thumbnail>
<gphoto:quotalimit>1073741824</gphoto:quotalimit>
<gphoto:quotacurrent>23044</gphoto:quotacurrent>
<gphoto:maxPhotosPerAlbum>500</gphoto:maxPhotosPerAlbum>
<entry>
<id>
http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/commentid/5234821429321343444</id>
<published>2008-08-15T19:00:41.000Z</published>
<updated>2008-08-15T19:00:41.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#comment' />
<title type='text'>Liz</title>
<content type='text'>I do say! What an amusing image!</content>
<link rel='alternate' type='text/html'
href='http://picasaweb.google.com/lh/photo/THdOPB27qGrofntiI91-8w' />
<link rel='self' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/commentid/5234821429321343444' />
<link rel='edit' type='application/atom+xml'
href='http://picasaweb.google.com/data/entry/api/user/liz/albumid/5228155363249705041/photoid/5234820919508560306/commentid/5234821429321343444' />
<author>
<name>Liz</name>
<uri>http://picasaweb.google.com/liz</uri>
<gphoto:user>liz</gphoto:user>
<gphoto:nickname>Liz</gphoto:nickname>
<gphoto:thumbnail>
http://lh3.ggpht.com/liz/AAAA2X2Bow4/AAAAAAAAAAA/N9xSZ7RoJY4/s48-c/liz.jpg</gphoto:thumbnail>
</author>
<gphoto:id>5234821429321343444</gphoto:id>
<gphoto:photoid>5234820919508560306</gphoto:photoid>
</entry>
</feed>
You can also retrieve all of the comments associated with a particular photo. The following response retrieves a feed of the comments on the photo identified by photoID, inside of the album with ID albumID, owned by the userID user.
GET http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID/photoid/photoID?kind=comment
The following request adds the comment "great photo!" to the photo identified by photoID in the album with ID albumID owned by userID.
POST http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID/photoid/photoID
<entry xmlns='http://www.w3.org/2005/Atom'>
<content>great photo!</content>
<category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/photos/2007#comment"/>
</entry>
To delete a comment, you can use a HTTP DELETE on that comment's edit link:
DELETE http://picasaweb.google.com/data/entry/api/user/userID/albumid/albumID/photoid/photoID/commentid/commentID