• Stars
    star
    946
  • Rank 48,319 (Top 1.0 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.

logo

Welcome to unavatar.io, the ultimate avatar service that offers everything you need to easily retrieve user avatars:

  • Versatile: A wide range of platforms and services including Facebook, Instagram, YouTube, Twitter, Gravatar, etc., meaning you can rule all of them just querying against unavatar.

  • Speed: Designed to be fast and efficient, all requests are being cached and delivered +200 global datacenters, allowing you to consume avatars instantly, counting more than 20 millions requests per month.

  • Optimize: All the images are not only compressed on-the-fly to reduce their size and save bandwith, but also optimized to maintain a high-quality ratio. They are ready for immediate use, enhancing the overall optimization of your website or application.

  • Integration: The service seamlessly incorporates into your current applications or websites with ease. We offer straightforward documentation and comprehensive support to ensure a quick and effortless onboarding experience.

In summary, unavatar.io provides versatility, speed, optimization, and effortless integration, making it the ultimate avatar retrieval service.

Quick start

The service is a single endpoint exposed in unavatar.io that can resolve:

So, no matter what type of query you use, unavatar.io has you covered. You can read more about that in providers.

Query parameters

TTL

Type: string
Default: '24h'
Range: from '1h' to '28d'

It determines the maximum quantity of time an avatar is considered fresh.

e.g., https://unavatar.io/kikobeats?ttl=1h

When you look up for a user avatar for the very first time, the service will determine it and cache it respecting TTL value.

The same resource will continue to be used until reach TTL expiration. After that, the resource will be computed, and cache as fresh, starting the cycle.

Fallback

Type: string|boolean

When it can't be possible to get a user avatar, a fallback image is returned instead, and it can be personalized to fit better with your website or application style.

You can get one from boringavatars.com:

e.g., https://unavatar.io/github/37t?fallback=https://source.boringavatars.com/marble/120/1337_user?colors=264653r,2a9d8f,e9c46a,f4a261,e76f51

or avatar.vercel.sh:

e.g., https://unavatar.io/github/37t?fallback=https://avatar.vercel.sh/37t?size=400

or even an static image:

e.g., https://unavatar.io/github/37t?fallback=https://avatars.githubusercontent.com/u/66378906?v=4

You can pass fallback=false for explicitly disable this behavior. In that case, a 404 Not Found HTTP status code will returned when is not possible to get the user avatar.

JSON

The service returns media content by default.

This is in this way to make easier consume the service from HTML markup.

In case you want to get a JSON payload as response, just pass json=true:

e.g., https://unavatar.io/kikobeats?json

Limitations

For preventing abusive usage, the service has associated a daily rate limit based on requests IP address.

You can verify for your rate limit state checking the following headers in the response:

  • x-rate-limit-limit: The maximum number of requests that the consumer is permitted to make per minute.
  • x-rate-limit-remaining: The number of requests remaining in the current rate limit window.
  • x-rate-limit-reset: The time at which the current rate limit window resets in UTC epoch seconds.

When you reach the API quota limit, you will experience HTTP 429 errors, meaning you need to wait until the API quota reset. If you need need more quota, contact us.

Providers

With unavatar.io, you can retrieve user avatars based on an email, domain, or username.

The providers are grouped based on which kind of input they can resolve.

Based on that, a subset of providers will be used for resolving the user query, being the avatar resolved the fastest provider that resolve the query successfully.

Alternatively, you can query for an individual provider.

DeviantArt

Type: username

It resolves user avatar against deviantart.com.

e.g., https://unavatar.io/deviantart/spyed

Dribbble

Type: username

It resolves user avatar against dribbble.com.

e.g., https://unavatar.io/dribbble/omidnikrah

DuckDuckGo

Type: domain

It resolves user avatar using duckduckgo.com.

e.g., https://unavatar.io/duckduckgo/gummibeer.dev

GitHub

Type: username

It resolves user avatar against github.com.

e.g., https://unavatar.io/github/mdo

Google

Type: domain

It resolves user avatar using google.com.

e.g., https://unavatar.io/google/netflix.com

Gravatar

Type: email

It resolves user avatar against gravatar.com.

e.g., https://unavatar.io/gravatar/[email protected]

Instagram

Type: username

It resolves user avatar against instagram.com.

e.g., https://unavatar.io/instagram/willsmith

Microlink

Type: domain

It resolves user avatar using microlink.io.

e.g., https://unavatar.io/microlink/microlink.io

Read.cv

Type: username

It resolves user avatar against read.cv.

e.g., https://unavatar.io/readcv/elenatorro

Reddit

Type: username

It resolves user avatar against reddit.com.

e.g., https://unavatar.io/reddit/kikobeats

SoundCloud

Type: username

It resolves user avatar against soundcloud.com.

e.g., https://unavatar.io/soundcloud/gorillaz

Substack

Type: username

It resolves user avatar against substack.com.

e.g., https://unavatar.io/substack/bankless

Telegram

Type: username

It resolves user avatar against telegram.com.

e.g., https://unavatar.io/telegram/drsdavidsoft

Twitter

Type: username

It resolves user avatar against twitter.com.

e.g., https://unavatar.io/twitter/kikobeats

YouTube

Type: username

It resolves user avatar against youtube.com.

e.g., https://unavatar.io/youtube/casey

More Repositories

1

metascraper

Get unified metadata from websites using Open Graph, Microdata, RDFa, Twitter Cards, JSON-LD, HTML, and more.
HTML
2,300
star
2

browserless

browserless is an efficient way to interact with a headless browser built in top of Puppeteer.
JavaScript
1,393
star
3

sdk

Make any URL embeddable. Turn any URL into a beautiful link preview.
HTML
583
star
4

keyvhq

Simple key-value storage with support for multiple backends.
JavaScript
422
star
5

cards

The easiest way to create and share dynamic images at scale.
JavaScript
389
star
6

youtube-dl-exec

A simple Node.js wrapper for youtube-dl/yt-dlp.
JavaScript
316
star
7

async-ratelimiter

Rate limit made simple, easy, async.
JavaScript
298
star
8

react-json-view

JSON viewer for React
JavaScript
188
star
9

www

Browser as API
JavaScript
120
star
10

splashy

Given an whatever image (GIF, PNG, WebP, AVIF, etc) extract predominant & palette colors.
JavaScript
88
star
11

spotify-url-info

Get metadata from any Spotify URL.
JavaScript
68
star
12

html-get

Get the HTML from any website, using prerendering when necessary.
JavaScript
65
star
13

mql

Microlink Query Language. The official HTTP client to interact with Microlink API for Node.js, browsers & Deno.
JavaScript
47
star
14

nanoclamp

πŸ—œResponsive clamping component for React in 735 bytes.
JavaScript
41
star
15

metatags

Ensure your HTML is previewed beautifully across social networks.
JavaScript
29
star
16

async-memoize-one

memoize the last result, in async way.
JavaScript
21
star
17

recipes

JavaScript
15
star
18

oembed-spec

A parser for oEmbed specification.
JavaScript
14
star
19

function

JavaScript Serverless functions with browser programmatic access.
JavaScript
11
star
20

server-proxy

Interact with Microlink API without exposing your credentials
JavaScript
9
star
21

queue

The high resilient queue for processing URLs.
JavaScript
9
star
22

keyv-s3

Amazon S3 storage adapter for Keyv.
JavaScript
8
star
23

openkey

Fast authentication layer for your SaaS, backed by Redis.
JavaScript
7
star
24

cdn

Content Delivery Network for Microlink assets
JavaScript
6
star
25

analytics

Microservice to retrieve your CloudFlare Analytics.
JavaScript
6
star
26

keyv-redis

Redis storage adapter for Keyv.
JavaScript
6
star
27

ping-url

Fast DNS resolution caching results for a while.
JavaScript
6
star
28

lighthouse-viewer

Lighthouse Viewer as service
JavaScript
6
star
29

cli

A CLI for interacting with Microlink API
JavaScript
5
star
30

geolocation

Get detailed information about the incoming request based on the IP address.
JavaScript
5
star
31

oss

Microservice to get the latest public GitHub repos from a user/organization
JavaScript
4
star
32

local

Runs Microlink Function locally.
JavaScript
4
star
33

html

Get HTML from any URL.
JavaScript
3
star
34

youtube-dl-binary

Tiny tool for downloading the latest `youtube-dl` version available.
JavaScript
3
star
35

open

3
star
36

mql-cli

CLI for interacting with Microlink Query Language.
JavaScript
2
star
37

healthcheck

Microservice to retrieve your CloudFlare Health Checks.
JavaScript
2
star
38

demo-links

A set of links used for demo purposes
2
star
39

meta

Open Graph Image as Service
TypeScript
2
star
40

proxy

Interact with Microlink API using an Edge Function.
JavaScript
2
star
41

logo

Adding logos to any website, powered by Microlink API.
JavaScript
2
star
42

microclap

clap button as service
JavaScript
1
star