Goodbye avatars .io - hello unavatar!
Given a social media user's username, how do you get a picture of their avatar?
I always used avatars.io - but sadly that service has bitten the dust. So I've switched to unavatar.
It's dead easy to use. https://unavatar.now.sh/twitter/edent
will return @edent's avatar. You can use GitHub, Facebook, Gravatar, Instagram, Telegram, YouTube, SoundCloud, and a couple of other providers.
Simple to use, and easy to embed in an <img>
element.
It's also open source and looks pretty easy to deploy if you want to host it yourself.
Why is this needed?
In an ideal world, there would be a standard for where to find a user's avatar. Possibly a .well-known
resource. Until then, we have to make do with 3rd party services playing intermediary.
Kai Hendry says:
What happened to the OSS https://www.libravatar.org/ ?
On the topic of Avatars, I’ve been frustrated that it appears impossible to find out how to set the Gmail avatar from a non-Google account! https://support.google.com/mail/thread/56463134?hl=en
What a mess.
Sufian says:
You could try Avatar API: https://www.avatarapi.com/
It isn't free but you can test the API with 100 free API calls they provide you with. And the best thing is, it pulls profile pictures from gmail, skype, etc.
Once signed up, you can replace this URL with your username and password to access the avatar: https://www.avatarapi.com/avatar.asmx/GetProfile?email=email-to-search-for&username=your-avatar-api-username&password=your-avatar-api-pass