API Reference

ZLA Gravatar CDN

Serve avatars from Gravatar with modern WebP/AVIF support, intelligent caching, and graceful fallback handling.

Endpoints

GET /avatar/me

Returns the configured maintainer avatar.

GET /avatar/:hash

Returns an avatar for a precomputed MD5 or SHA-256 email hash.

  • hash: The MD5 or SHA-256-hashed value of the email (lowercased and trimmed).
GET /avatar?email=<email>

Resolves a raw email address after server-side normalization. Enable this endpoint only when you accept that email addresses can appear in URLs, logs, browser history, and intermediary proxies. Raw email lookups are disabled on this deployment.

  • <email>: The plain email address to resolve. It is trimmed and lowercased before hashing; invalid or missing values fall back to email@example.com.

Query Parameters

Format Negotiation

Avatars are automatically converted to AVIF or WebP based on the browser’s Accept header, including quality values such as q=0.9. The original image format is used as a fallback if neither is supported or the requested image is too large to safely transform at the edge.

Accept: image/avif,image/webp, image/*, */*

Caching

Example Requests