API reference

Avatar endpoints, request options, image formats, and cache lifetimes.

Endpoints

GET /avatar/me

Returns the configured maintainer avatar.

GET /avatar/:hash

Returns an avatar for a precomputed MD5 or SHA-256 email hash. Trim whitespace and lowercase the email before hashing.

GET /avatar?email=<email>

Raw email addresses can appear in URLs, logs, browser history and proxies. Missing or invalid emails fall back to email@example.com.

Raw email lookup is disabled on this deployment.

Query parameters

  • s= / size=

    Width and height in pixels. Default: 200

  • d= / default=

    Fallback for missing avatars: a supported Gravatar option or an image URL. Default: 404

  • initials=

    Custom initials; requires d=initials.

  • name=

    Derives initials from a name; requires d=initials.

Format negotiation

The Accept header selects AVIF or WebP, respecting quality values. Unsupported or oversized images keep their original format. A cache miss still requires CPU-intensive encoding; caching does not guarantee the Free plan CPU limit.

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

Caching

200 OK
Edge: 604,800 seconds (7 days)
Browser: 259,200 seconds (3 days)
Successful avatar responses can be reused for this period.
404 Not Found
Edge: 3,600 seconds (1 hour)
Browser: 300 seconds (5 minutes)
Missing avatars are cached briefly to avoid repeating the lookup.
Vary: Accept
Negotiated formats use separate cache entries.

Example requests

GET /avatar/205e460b479e2e5b48aec07710c08d50?s=128
GET /avatar?email=email@example.com&size=256
GET /avatar?email=email@example.com&size=500&d=initials&initials=A

Raw email lookup is disabled on this deployment.