Avatar Generator API

Default profile pictures from a name: initials avatars that read Vietnamese names correctly (Nguyễn Văn An → NA) or identicons, with a stable colour per user.

GEThttps://apibox.io.vn/v1/avatar
Images & Codes▶ Try it online

The avatar API draws a default profile picture for users who have not uploaded one. style=initials (default) writes the initials on a coloured circle, square or rounded square. Vietnamese names put the given name last, so the initials are the first letter of the family name and of the given name (Nguyễn Văn An → NA, Đặng Thị Ánh → ĐÁ, with accents preserved); length=1 keeps only the given name and initials= sets them yourself.

style=identicon draws a symmetric 5×5 pattern, handy for anonymous accounts, API keys or wallet addresses. The colour comes from a hash of the name, so the same user always gets the same avatar on every page, and text switches to dark on light backgrounds for contrast. background and color override the colours.

Initials avatars are SVG (crisp at any size, usable directly in <img src>); identicons are also available as PNG. Use the URL form /v1/avatar/Nguyễn Văn An.svg; responses are cacheable for a week.

Parameters

NameInTypeRequiredDefault
namequery|pathstringyesName or any seed (email, id…); or /v1/avatar/{name}.svg.
stylequerystringnoinitialsinitials or identicon.
sizequerynumberno128Size in px (16–1024).
shapequerystringnocirclecircle, square or rounded.
formatquerystringnosvgsvg, or png (identicon).
lengthquerynumberno2Number of initials (1–3).
backgroundquerystringnoBackground colour (hex).
colorquerystringnoText / pattern colour (hex).

Example

curl "https://apibox.io.vn/v1/avatar?name=Nguyễn Văn An&size=128" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o output

Response

binary image/svg+xml

Use cases

  • Default avatars in SaaS apps, forums and comment sections
  • Contact lists and chat apps
  • Identicons for API keys, devices or anonymous users
  • Placeholders in design mock-ups

FAQ

Why “NA” for Nguyễn Văn An?

Vietnamese names are family – middle – given name. Two letters use the family and given names; length=1 shows only the given name (A).

Can I get PNG?

Identicons yes (format=png). Initials are SVG only, because PNG text would need a font renderer; SVG works in all browsers and in <img> tags.

Will the colour change?

No. It is derived from the name (case-insensitive), so it is stable across requests.

Related APIs

Start with 1,000 free requests every month. Get free API key →