API
A small read-only JSON API over the same data this site runs on. No key, no signup, no CORS restrictions.
https://heads.kal.pe/api/api/headsA paginated list of heads. This is the endpoint behind the grid on the homepage.
Query parameters
pagelimitcategorysearchsort{
"heads": [
{
"_id": "6a80c75c6050a7627e244f2d",
"name": "226acf32-9ee5-4ac3-bbe3-8f7d5c50d6d6",
"displayName": "Creeper",
"category": "monsters",
"image": "https://mc-heads.net/avatar/2070c589…/128",
"command": "/give @p minecraft:player_head{…}",
"textureHash": "2070c589…",
"uuid": "226acf32-9ee5-4ac3-bbe3-8f7d5c50d6d6",
"tags": ["monsters", "mob"]
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 93215,
"totalPages": 1865,
"hasNext": true,
"hasPrev": false
}
}/api/heads/:idOne head by its id, with the same fields as a list entry.
/api/heads/randomA single random head. Useful for a head-of-the-day, or for testing.
/api/heads/:id/trackIncrement a counter on a head. This is what powers the popularity sorts.
Request body
{ "type": "click" | "download" | "copy" | "view" }/api/name-to-uuid/:nameResolve a Minecraft username to its UUID, via Mojang.
/api/uuid-to-name/:uuidResolve a UUID back to the current username on that account.
100 requests per minute and 1,000 per hour, per IP. Go over and you'll get a 429; wait for the window to roll and continue.
The catalogue changes rarely. If you're building a browser or a bot, cache responses rather than refetching per page view. It keeps the limits generous for everyone.
The image field points at mc-heads.net, not at us. Use textureHash if you'd rather render heads yourself.