Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving profile image from Google+ API

Tags:

google-plus

I am trying to pull JSON data from Google+ API. When I include the image attribute size of the image is set to 50px. How do I change the image size? I don't see it on the docs.

GET https://www.googleapis.com/plus/v1/people/100300281975626912157?fields=image&key={YOUR_API_KEY}

Response

{
 "image": {
  "url": "https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz=50"
 }
}
like image 602
Maca Avatar asked Dec 24 '12 11:12

Maca


People also ask

How do I recover my Google profile picture?

Tap Manage your Google Account. On your Google Account page, tap "Personal info." Under "Profile," tap your current profile picture. Follow the on-screen prompts to choose or take a photo. Tap Set Profile Photo.

Where are profile pictures stored Google?

A user's profile photo is stored in their Album Archive, at get.google.com/albumarchive, whether it's added by an admin or the user.

Does Google have a image API?

Its Google image API features can index images thus helping you to create a vast image database – so you can find the exact image you're looking for. In addition to retrieving still images, the ContextualWeb image search API provides the most recent photos for your search query.


1 Answers

There are two kinds of google images:

  1. User-uploaded profile Image (ending with s96-c)
  • For User-uploaded Image end of URL will contain "s96-c" just replace that with "s{anyhighernumber}-c" Example: https://lh3.googleusercontent.com/a-/AOh14GicX6CDo0rdCvI0him0hiURm8RFk6aStpHOZQUu=s1500-c
  1. Google generated image (ending with photo.jpg)
  • For Google Generated Image add "?sz={anyhighernumber}" at the end of the URL Example: https://lh3.googleusercontent.com/-smcmFKIr8Mw/AAAAAAAAAAI/AAAAAAAAAAA/AMZuuclFvz6ooU0vUDd-Qkpk5ExSRyEoFg/s96-c/photo.jpg?sz=1500

replace {anyhighernumber} with your desired resolution eg:1500

like image 176
umesh giri Avatar answered Sep 19 '22 05:09

umesh giri