5

I am working on something to download and archive Google Photos libraries on to offline storage media. Before downloading, I'd like to calculate how much media will be needed to store the photos library but all I can get is a user's storage quota for photos but not the actual size of their Google Photos library.

My understanding is that the quota refers to the amount of storage a Google user's photo counts against the 15GB of free storage Google offers for Gmail, Photos and other services. To be clear, that quota number isn't helpful when I'm trying to calculate how large a Google Photos library actually will be when I download it.

Does anyone know how to get the actual size of the library to be downloaded?

Josh J
  • 6,813
  • 3
  • 25
  • 47
Xavius Prime
  • 51
  • 1
  • 3

1 Answers1

1

When requesting the album data, to get the original images/video, use the imgmax=d parameter. The size is returned along with other details. Add the size up to get an idea of the total download size. For photos the size is accurate, but for video, it seems off. I'm still working on figuring video sizes out.

This is the request I make when getting an album.

'https://picasaweb.google.com/data/feed/api/user/default/albumid/' + albumId + '?imgmax=d&start-index=' + start + '&max-results=' + max + '&fields=entry(title,updated,gphoto:size,media:group/media:content)'

From the API Docs: https://developers.google.com/picasa-web/docs/2.0/reference

gphoto:size

The size of the photo in bytes.

The < gphoto:size > element can appear as a child of < atom:entry > or < atom:feed >. The < gphoto:size > element is valid with the photo kind.