92

Does the Google Photos app, released on May 28, 2015, have an API which allows uploading of photos? The app seems to build on Picassa and Google+. Can one of their APIs can be used to upload into Google Photos?

Matthew Simoneau
  • 6,199
  • 6
  • 35
  • 46

4 Answers4

52

By the looks of it Google Photos is based off the same system Google+ handled photos which was through the Picasa Web Albums Data API.

EDIT: So I came across this question while trying to develop something using Google Photos. Currently I am working on an application that will transfer stuff from Dropbox over to Google Photos.

I can confirm that Google Photos does indeed use Picasa Web Albums API. The API is simply a data storage for anything related to Photos. Drive and Google+ make use of the Data API to persist photos. Looking at picasaweb.google.com you can see it redirects you to Google+ and shows a collection of all of your photo.

You can actually experiment by looking over the Protocol Guide You can further experiment by using the OAuth 2.0 Playground through the Picasa API.

Preshoth P.
  • 621
  • 1
  • 4
  • 3
  • 3
    Were you able to upload the photos against the unlimited quota? – Rishabh Aug 25 '15 at 06:40
  • 2
    @Rishabh Through my testing and experimentation, I could not find any flags to go against the unlimited quota from an app's point of view. It seems its the user's discretion, they have to toggle the unlimited option within their account. It seems like it is a personal choice and apps will follow whatever the user chooses. – Preshoth P. Sep 08 '15 at 14:14
  • @PreshothP. did you every get your DropBox to GPhotos app working? I wrote a SmugMug to GPhotos transfer app back when GPhotos first came out, but never got it up to production quality. It works well enough for me. – Andy Apr 03 '16 at 23:09
29

I figured it out using Fiddler against the Google Photos Uploader and toggling the resolution level back and forth.

If you use the mediaBackground upload, it has a parameter for "storage". If you set the parameter to "standard", it is unlimited quota. If you set it to "full", it is against your quota.

So the API Call for full-res quota photos is:

/resumable/upload/plus/v1whitelisted/mediasets/me.cinstant/mediaBackground?uploadType=resumable&imageSize=1024&mediaType=photo&storage=**full**&remainingMediaCount=111

While the API call for standard-res (up to 16 megapixel) unlimited photos is:

/resumable/upload/plus/v1whitelisted/mediasets/me.cinstant/mediaBackground?uploadType=resumable&imageSize=1024&mediaType=photo&storage=**standard**&remainingMediaCount=111
Tunaki
  • 132,869
  • 46
  • 340
  • 423
Justin Grote
  • 579
  • 5
  • 12
  • 3
    Do you have to post the file in a reduced size do you send the full file and Google reduces it? – Jj. Dec 15 '15 at 19:34
  • 1
    Could you please clarify how to use your answer? I think Google Photos uses Picasa Web Albums Data API, but it doesn't have method `mediaBackground`. – LA_ Dec 17 '15 at 11:28
  • 1
    judging by the answer here http://stackoverflow.com/a/32525986/202168 you need to downsize the photos to < 16 mpix first before uploading as 'standard' resolution – Anentropic Dec 30 '15 at 10:19
  • @justin-grote Will that be a POST request? What sort of data do I need to send? In which format? Can you clarify? – Khurshid Alam Feb 02 '16 at 04:44
  • 8
    Unfortuantely Khurshid they have now locked down the v1whitelisted API to only registered clients, so this doesn't seem to work anymore unless you use Fiddler to snatch the token of another program like the media uploader and use it to issue the call, which is of course a violation of Google ToS In short there is totally an API for this but Google has in their infinite wisdom decided to make it private rather than opening it up for some bizarre reason. This kind of lock-in was why I switched to Amazon Cloud Drive to store my photos. Way better APIs – Justin Grote Feb 03 '16 at 01:35
11

There's an official API for Google Photos now.
It contains an upload media endpoint. That section mentions that all photos uploaded through that endpoint are counted towards the user's storage limit:

Note: All media items uploaded to Google Photos through the API are stored in full resolution at original quality. If your uploads exceed 25MB per user, your application should remind the user that these uploads will count towards storage in their Google Account.

Thor77
  • 322
  • 2
  • 10
  • When photos/videos are uploaded via Photos API to user's Google account, is then the same user able to (manually) use the "Recover storage" button and convert the photos/videos from "Original quality" to "High quality" so that the media would not count towards the storage limit (currently 15 GB)? – Kozuch Nov 10 '20 at 18:29
10

There is no API or other solution that uploads against the unlimited quota. Even if the user selects "use high quality, unlimited uploads", uploading any photos through the Picasa Web Albums Data API will count against the storage.

Szak1
  • 435
  • 4
  • 11