مدد
hashavatar.app کو browser، frontend، یا backend سے براہ راست استعمال کریں۔ ہر avatar URL deterministic ہے، اس لیے ایک ہی identifier اور options ہمیشہ ایک ہی result دیتے ہیں۔
Basic URL
جب آپ کو simple 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
اگر آپ cleaner 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 پر apply ہوتے ہیں۔ Object-style families جیسے planet, rocket, paws, mushroom, cactus, cupcake, pizza, icecream, diamond, coffee-cup, اور shield کو accessory=none اور expression=default پر normalize کیا جاتا ہے۔
Signed Storage Links
اگر اس deployment میں object storage configured ہے تو /v1/avatar/link سے presigned storage link request کریں۔ یہ endpoint generated object کو store کرتا ہے اور signed URL، object key، اور hashed cache key کے ساتھ JSON واپس کرتا ہے۔ Standard avatar responses response headers میں signed-link metadata 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 پر published ہے۔ Repository · crates.io