Find Google+ avatar for given email address without OAuth

大城市里の小女人 提交于 2019-11-28 21:26:08

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.

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.

I highly doubt this is possible. Any kind of querying against the Google Plus API requires OAUTH. What's more, I'm not aware of way to query for a user ID by email address in the first place.

This thread would seem to confirm that this is currently not possible.

You can use the people.search API to search by email address and without requesting the user to authenticate. However, that will only search the public profile fields, which email is not a public field by default.

The only API methods that require OAuth are those that access private data. For public data, you can use the more simple API key method.

To reliably achieve what you are describing, you'll want to use Oauth and the plus.me scope to get the information that you want. This does require authorizing your app however.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!