Ndihmë
Përdor hashavatar.app direkt nga browser, frontend ose backend. Çdo avatar URL është deterministic, ndaj i njëjti identifier dhe options japin gjithmonë të njëjtin output.
Basic URL
Përdor query endpoint kur të duhet një public image URL e thjeshtë.
https://hashavatar.app/v1/[email protected]&algorithm=sha512&kind=robot&background=white&accessory=glasses&color=gold&expression=happy&shape=circle&format=webp&size=256
Path Style URL
Përdor path form nëse preferon embed URLs më të pastra.
https://hashavatar.app/avatar/fox/[email protected]/webp
Shembull HTML
<img
src="https://hashavatar.app/v1/[email protected]&algorithm=sha512&kind=monster&background=themed&accessory=horns&color=crimson&expression=grumpy&shape=hexagon&format=webp&size=256"
alt="Generated monster avatar"
/>
Shembull JavaScript
const avatarUrl = new URL("https://hashavatar.app/v1/avatar");
avatarUrl.search = new URLSearchParams({
id: user.email,
algorithm: "sha512",
kind: "robot",
background: "white",
accessory: "glasses",
color: "gold",
expression: "happy",
shape: "circle",
format: "webp",
size: "256",
}).toString();
Supported Parameters
id: any stable identifier such as an email, username, internal user id, or one-way hashtenant: optional namespace partition for multi-tenant appsstyle_version: optional style namespace such asv2algorithm: identity hash mode; onlysha512is supportedkind: any public hashavatar family, includingcat,dog,robot,planet,rocket,frog,panda,cupcake,pizza,octopus,knight,bear,penguin,dragon,ninja,astronaut,diamond,coffee-cup, andshieldbackground:themed,white,black,dark,light,transparent,polka-dot,striped,checkerboard,grid,sunrise,ocean, orstarryaccessory:none,glasses,hat,headphones,crown,bowtie,eyepatch,scarf,halo, orhornscolor:default,neon-mint,pastel-pink,crimson,gold, ordeep-sea-blueexpression:default,happy,grumpy,surprised,sleepy,winking,cool, orcryingshape:square,circle,squircle,hexagon, oroctagonformat: output format; onlywebpis supportedsize: from64up to1024
Accessory dhe expression layers aplikohen për character-style families. Object-style families si planet, rocket, paws, mushroom, cactus, cupcake, pizza, icecream, diamond, coffee-cup dhe shield normalize në accessory=none dhe expression=default.
Signed Storage Links
Nëse ky deployment ka object storage configured, kërko një presigned storage link nga /v1/avatar/link. Ai endpoint store generated object dhe kthen JSON me signed URL, object key dhe hashed cache key. Standard avatar responses nuk shfaqin signed-link metadata në response headers.
GET https://hashavatar.app/v1/avatar/[email protected]&algorithm=sha512&kind=robot&background=white&accessory=glasses&color=gold&expression=happy&shape=circle&format=webp&size=256
Open Source
Source i public site është në API repository dhe reusable avatar renderer është publish në crates.io. Repository · crates.io