12

I am using google app engine to create a photo gallery site for all of the photos I have taken. The photos I would like displayed are on my google plus account in a public album. I would like my app to automatically display all of the photos in that album. I know I can store all of the url's to the images in the data store and then pass the url's to the template and render the images,

images = LinksToImages.all()
self.renderTemplate(images)

#  Template
{% for img in images %}
<img src={{img}}>
{% endfor %}

I was wondering if there was a way to get all of the images in a google plus album automatically without manually entering the url's each time. I have thought about using the google plus api but I only need to get images from one public album and do not need to access the users account.

Is there a way I can retrieve all of the images or links to images from a public google plus album?

felipsmartins
  • 13,269
  • 4
  • 48
  • 56
Jake Runzer
  • 957
  • 3
  • 17
  • 35

1 Answers1

19

You can do this, but the answer is kind of a trick, since it's not done through Google+ per se.

The Trick:

To list all of the photos in a Google+ album use the Picasa Web Albums Data API. It's not at obvious that this is what should be done, but as I write this all Google+ Photos are Picasa photos.

The relevant documentation for Picasa is under Listing photos in an album.


The Answer:

Basically, GET a page at

https://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID

where UserID and albumID are the values for your Google+ album. That'll give you back some Xml, listing all the photos.


The Explanation:

It may not be obvious from the Google+ page how to find the userID or albumID.

One method of finding the IDs is to navigate to the album you want on Google+, and plug in the long numbers from that Url into the above style.

Concretely, for John "Maddog" Hall's photo album "Campus Party, Brasil - Second Edition", we'd convert the Url from

https://plus.google.com/photos/115999964287637644901/albums/5659736500890118225

to

 https://picasaweb.google.com/data/feed/api/user/115999964287637644901/albumid/5659736500890118225

From there, you can parse the resulting Xml and list all the photos. Caption info, thumbnails, etc. is also available if you need it. The Urls of the images are under /feed/entry/media:group/media:content in the resulting Xml.

I assume you know how to parse and read the Xml in Python.


The Generalization:

If you needed to be able to list all of the albums for a user, you would use a Url in the style below, again replacing userID by the number from Google+.

https://picasaweb.google.com/data/feed/api/user/userID
Community
  • 1
  • 1
Ezra
  • 7,552
  • 1
  • 24
  • 28
  • 5
    Thank you. I am surprised this isn't documented very well. I ended up changing the xml to json with a query of 'alt=json' – Jake Runzer Mar 05 '13 at 03:43
  • 1
    The alt=json is a really useful tip! I'm using PHP to display my album and the XML is a pain to deal with. – George Aug 22 '13 at 23:15
  • @ezra On Official google plus on android you can not get the link of photos. You can only copy the link of the post. Beside, Picasa Web Albums Data API is deprecating. So what now? – Khurshid Alam May 25 '16 at 05:54
  • The above "trick" still works, even more than three years later. If you have a different problem, I would recommend that you open another question. – Ezra May 25 '16 at 15:20
  • 1
    I don't understand why they couldn't have integrated this with the Google+ API. It'd be ***so*** much easier to work with. – EvilTak May 27 '16 at 14:50