# avatarapi — one URL for anyone's avatar

> Put a username, email address, or domain in the URL. The response is image bytes for an `<img src>`. avatarapi checks the image before serving it. Misses return typed errors.

```html
<img src="https://avatarsapi.com/github/torvalds" alt="">
```

## Lookup routes

| Route | What it does | Example |
| --- | --- | --- |
| `/:source/:handle` | Look up one Handle from a named Source. | https://avatarsapi.com/twitch/theprimeagen |
| `/email/:address` | Checks Gravatar and GitHub together, then BIMI. The first Hit wins. | https://avatarsapi.com/email/jane@stripe.com |
| `/domain/:domain` | Checks BIMI first, then DuckDuckGo and Google favicons. | https://avatarsapi.com/domain/anthropic.com |
| `/:handle` | Infers email or domain from the Handle's shape. A bare username returns `EAMBIGUOUS`; name a Source. | https://avatarsapi.com/anthropic.com |
| `/p/:key/…` | Runs any Lookup through a Project's publishable key and Plan. | https://avatarsapi.com/docs#plans |

Add `?json` for the metadata envelope and `?size=16–1000`. Starter Projects can also set `?ttl=1h–28d`.

## Sources

72 Sources, including GitHub, GitLab, X, Bluesky, Mastodon, YouTube, Twitch, Telegram, Discord, TikTok, Steam, npm, Hugging Face, Gravatar, and BIMI. The live list is [GET /sources](https://avatarsapi.com/sources).

## Pricing

Anonymous use needs no signup or key and is meant for trying it out. A free Project adds a browser-safe `pk_` key. Free use requires a visible "Avatars by avatarsapi.com" link. Starter is $19 per Project per month, with no daily limit, custom cache lifetime, and no attribution. Each Project is billed separately, and cached images do not count toward usage. Current limits: https://avatarsapi.com/docs#plans

## More

- API reference: https://avatarsapi.com/docs.md
- OpenAPI: https://avatarsapi.com/openapi.json
- Blog: https://avatarsapi.com/blog/
- Dashboard: https://app.avatarsapi.com
