Search code examples
google-plususer-profilesocialauth

How to fetch a profile picture of a Google Plus account?


I'm kind of building a website and I want to allow Google login. I don't want my customers upload their profile pictures again to my website. I have some clue on how to do it with facebook, but how do I fetch a profile picture from a google plus account once the user has been authenticated via a Google account? Is there any API for this? If yes, kindly share.


Solution

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

    Here's the latest docs; https://docs.avatarapi.com/

    One of the benefits of this API is that it does not require the user to be authenticated with Google. However, in your particular case this would not be an issue.