Simple, fast, and free avatar API for your applications.
MyAvatar provides a simple HTTP API to generate consistent avatars based on email addresses. It's a drop-in replacement for Gravatar.
hash: The MD5 hash of the lowercase, trimmed email address..svg: (Optional) .svg extension is supported.d or default: (Optional) Default image when no avatar has been saved. Set to "mp" or "mystery" to show an empty silhouette.When a user has not explicitly defined an avatar for their email address, you can specify a default image to display. Use d=mp to show a mystery person silhouette.
d=mp or d=mystery: Display a gray silhouette (mystery person) instead of generating a random avatar.d parameter: Display the auto-generated deterministic avatar (default behavior).Example:
<!-- Show mystery person if no avatar exists -->
<img src="https://myavatar.onlc.eu/avatar/205e460b479e2e5b48aec07710c08d50?d=mp" alt="User Avatar" />
<!-- Show deterministic avatar (default) -->
<img src="https://myavatar.onlc.eu/avatar/205e460b479e2e5b48aec07710c08d50" alt="User Avatar" />
<img src="https://myavatar.onlc.eu/avatar/205e460b479e2e5b48aec07710c08d50" alt="MyAvatar" />
$email = "[email protected]";
$hash = md5(strtolower(trim($email)));
$avatarUrl = "https://myavatar.onlc.eu/avatar/" . $hash;
// Optional: Add default=mp to show mystery person when no avatar is saved
// $avatarUrl .= "?d=mp";
echo '<img src="' . $avatarUrl . '" />';
import md5 from 'md5'; // You need an MD5 library
const email = "[email protected]";
const hash = md5(email.trim().toLowerCase());
const avatarUrl = `https://myavatar.onlc.eu/avatar/${hash}`;
// Optional: append ?d=mp for mystery person default
// const avatarUrl = ... + "?d=mp";
const img = document.createElement('img');
img.src = avatarUrl;
document.body.appendChild(img);
Avatars are cached by the browser for 1 hour and by our CDN for 1 month. They are generated as optimized SVGs for infinite scalability.