Gravatar CDN API

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

📌 Endpoints

GET /avatar/me

Fetch the maintainer's avatar with no param needed.

GET /avatar/:hash

Fetch avatar via precomputed MD5 or SHA-256 hash of an email address.

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

Fetch avatar via raw email (securely hashed on the server).

  • <email>: The plain email address to resolve a Gravatar (if the email is invalid, we will use `email@example.com` as fallback).

⚙️ Query Parameters

🎨 Format Negotiation

Avatars are automatically converted to AVIF or WebP based on the browser’s Accept header. JPEG is used as a fallback if neither is supported.

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

📦 Caching

🧪 Example Requests