user1617207
user1617207

Reputation: 131

Google+ API to get all the photos

I have done the Google+ authentication and now I can access user id, access token etc. I want to access the user personal and shared photos from google plus or picasa [anything works for me].

What API should I call? [Web application]

Upvotes: 4

Views: 6438

Answers (4)

Venryx
Venryx

Reputation: 18079

Note that the Picasa API seems to have cross-origin restrictions for if you want to upload images. So to upload images, you'll need to use a server/proxy, or a helper Chrome extension. (since those don't have the same cross-origin restrictions that webpage code has -- at least when the correct permissions are set in the manifest)

See here for an example solution (in a Chrome extension): https://webapps.stackexchange.com/a/112527/147716

Upvotes: 0

Blackey
Blackey

Reputation: 738

I used the Picasa API to get photos for my app, feel free to use it as a reference. https://bitbucket.org/blackey02/city-log

Upvotes: 0

class
class

Reputation: 8681

Although there isn't a photos API, you could read activities to find public posts with attached images. These posts will contain a full image url that can be used to render/retrieve the content on the post.

You can see what the responses look like from your public feed here:

https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list?userId=me&collection=public&_h=1&

You would look for posts such as:

"verb": "post",
"object": {
"objectType": "note",
"content": "Off the grid!",
"url": "https://plus.google.com/109716647623830091721/posts/FH1rcTBiizW",
"replies": {
 "totalItems": 0,
 "selfLink": "https://www.googleapis.com/plus/v1/activities/z13dwdcw1sy4ztf2p22uydqhrp34gx5np/comments"
},
[....]
"attachments": [
 {
  "objectType": "photo",
  "displayName": "Off the grid!",
  "id": "109716647623830091721.5886945550216000274",
  "content": "6/7/13 - 1",
  "url": "https://plus.google.com/photos/109716647623830091721/albums/5886945550885266913/5886945550216000274",
  "image": {
   "url": "https://lh4.googleusercontent.com/-pGPWKUoUopE/UbKhyZyw8xI/AAAAAAAASsw/6aRt78UJlnc/w506-h750/photo.jpg",
   "type": "image/jpeg",
   "height": 750,
   "width": 506
  },
  "fullImage": {
   "url": "https://lh4.googleusercontent.com/-pGPWKUoUopE/UbKhyZyw8xI/AAAAAAAASsw/6aRt78UJlnc/photo.jpg",
   "type": "image/jpeg",
   "height": 4880,
   "width": 1456
  }
 }
]

},

Within attachments, you will see that fullImage link that contains a reference to the photo attached to the post.

Note that photo albums will work differently.

Upvotes: 2

Prisoner
Prisoner

Reputation: 50721

There is currently no Google+ Photos API. The best you can do at this point is to use the Picasa Web API. For more information, see https://developers.google.com/picasa-web/

Upvotes: 2

Related Questions