મદદ
hashavatar.app ને તમારા browser, frontend અથવા backend માંથી સીધું વાપરો. દરેક avatar URL deterministic છે, એટલે સમાન identifier અને options હંમેશાં સમાન output આપે છે.
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 ઉદાહરણ
<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 ઉદાહરણ
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 response headers માં signed-link metadata બતાવતા નથી.
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 પર publish થયેલ છે. Repository · crates.io