உதவி
Browser, frontend அல்லது backend-இல் இருந்து hashavatar.app-ஐ நேரடியாக பயன்படுத்துங்கள். ஒவ்வொரு avatar URL-மும் deterministic, எனவே அதே identifier மற்றும் options எப்போதும் அதே result தரும்.
Basic URL
எளிய public image URL வேண்டும் என்றால் query endpoint பயன்படுத்துங்கள்.
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
சுத்தமான embed URLs விரும்பினால் path form பயன்படுத்துங்கள்.
https://hashavatar.app/avatar/fox/[email protected]/webp
HTML example
<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"
/>
JavaScript example
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 மற்றும் expression layers character-style families-க்கு பொருந்தும். planet, rocket, paws, mushroom, cactus, cupcake, pizza, icecream, diamond, coffee-cup, shield போன்ற object-style families accessory=none மற்றும் expression=default ஆக normalize செய்யப்படும்.
Signed storage links
இந்த deployment-ல் object storage configured இருந்தால் /v1/avatar/link-இல் இருந்து presigned storage link கேட்கவும். அந்த endpoint generated object-ஐ store செய்து signed URL, object key, hashed cache key உடன் JSON தரும். Standard avatar responses signed-link metadata-ஐ response headers-ல் expose செய்யாது.
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
Public site source API repository-ல் உள்ளது; reusable avatar renderer crates.io-ல் வெளியிடப்பட்டுள்ளது. Repository · crates.io