Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Google+ avatar for given email address without OAuth

In my app I want to show the Google+ profile picture for a user. The only function, I found, in the API to get the profile picture needs a userId. However, I only have their email adress and not their Google+ userID.
Moreover the person, whose image I want to get, should not be forced to log in and authorize my app, as this person is mostly not identical to the user of the app.

So I think I need to get their userId by email. I read through the Google+ API documentation but can't find a way to do this, but I can't believe that this is not possible.

So my question is:
How can I get the Google+ userID with only an email address?
Is there maybe an other Google API to get a profile picture?

like image 509
pre Avatar asked Jan 09 '13 17:01

pre


2 Answers

There is an API provided by https://www.avatarapi.com/ which returns the user's name and profile pic from an email address based on Google's public info.

It can be called via SOAP or HTTP at this API endpoint: https://www.avatarapi.com/avatar.asmx

One of the benefits of this API is that it does not require the user to be authenticated with Google via OAUTH, so this could be exactly what you are looking for.

like image 135
Fiach Reid Avatar answered Oct 18 '22 00:10

Fiach Reid


You can't do this using just their email address, however, if they paste their Google+ url, you could parse the id from the URL string and then get their profile image (and cover image!) using the public data API. The url: https://plus.google.com/me will bring you to their profile.

like image 35
class Avatar answered Oct 18 '22 01:10

class