---
name: unavatar
description: Resolve avatars, logos, favicons and artwork by username, email or domain through the unavatar.io REST API. Use when an app needs a profile picture for a user, a logo for a company domain, or an icon for an app, without integrating each platform's API.
---

# unavatar.io

One GET endpoint returns an image for a username, email or domain across 90+ providers (GitHub, X, Instagram, Gravatar, YouTube, app stores, music services, domains and more). The URL works directly as an `<img src>`.

## Endpoints

| Pattern | Use it for |
| --- | --- |
| `https://unavatar.io/{provider}/{input}` | A specific provider, e.g. `https://unavatar.io/github/kikobeats` |
| `https://unavatar.io/{email}` | Any email, tried across every email provider, e.g. `https://unavatar.io/hello@microlink.io` |
| `https://unavatar.io/{domain}` | Any domain, tried across every domain provider, e.g. `https://unavatar.io/reddit.com` |

A bare username without a provider (`/kikobeats`) is not an API route. Usernames always need a provider.

Every provider slug and the inputs it accepts are in the OpenAPI document at https://unavatar.io/openapi.json (`components.schemas.Provider`). Some providers take a typed input, e.g. `https://unavatar.io/apple-music/artist:daft%20punk`. URL-encode the input.

## Query parameters

- `fallback`: image URL (or base64 data URI) returned when nothing is found. `fallback=false` returns `404` instead, which is the right choice when your code needs to know the lookup failed.
- `json`: return `{ "url": "..." }` instead of the image bytes.
- `ttl`: cache freshness, `1h` to `28d`, default `24h`. Custom values need the PRO plan (`ETTL` otherwise).
- `token`: publishable key for places where headers cannot be set, such as `<img>` tags.

## Authentication and limits

- Anonymous: 25 requests/day per IP. Cache hits are free and do not count.
- Free usage requires an attribution link to `https://unavatar.io` on the page that shows the avatars: `<a href="https://unavatar.io">Avatars provided by Unavatar</a>`. No `rel="nofollow"`, no redirects.
- With an API key: 50 origin requests/day included, metered billing beyond that (PRO). Send the key as the `x-api-key` header. Secret keys (`sk_`) are server-side only. Publishable keys (`pk_`) are safe in client code and go in `?token=`.
- Keys come from https://unavatar.io/checkout and are managed at https://unavatar.io/dashboard.
- Read `x-rate-limit-remaining` and `x-rate-limit-reset` (UTC epoch seconds) to stay under the limit. A `429` with code `ERATE` carries `retry-after`.

## Errors

JSON errors look like `{ "status": "fail" | "error", "code": "E...", "message": "...", "more": "https://..." }`. Branch on `code`, not on `message`. Common codes: `EAPIKEY` (401, bad key), `ERATE` (429), `ETTL` (403, custom `ttl` without PRO), `EPRO` (403, provider needs PRO), `EPKDOMAIN` (403, publishable key used from a domain it does not allow). A missing avatar with `fallback=false` is a plain `404` without a code.

## Guidance

- Prefer embedding the URL in `<img>` over downloading and re-hosting the image. The response is cached on a global CDN.
- Always set `fallback` for user-facing images so a missing avatar never renders as a broken image.
- Build URLs on the server for secret keys. Never put an `sk_` key in a URL or in client code.
- To check whether a user has an avatar at all, request `?json&fallback=false`: `200` returns `{ "url": "..." }`, `404` means none was found.

## References

- Docs: https://unavatar.io/docs
- Docs as markdown: https://unavatar.io/llms.txt
- OpenAPI: https://unavatar.io/openapi.json
- Health: https://unavatar.io/ping
