Docs / Getting started
Image URLs
Every avatar has a URL on seedkin.dev, so you can show one with a plain <img> and nothing to install: in Markdown, on a page without JavaScript, or in a quick prototype.
<img src="https://seedkin.dev/api/2.x/botling/svg?seed=jolly-sprocket-65&size=64"
width="64" height="64" alt="" />
This is a preview. The URLs may still change before the API is announced, and it has no uptime promise. For anything that matters, install the package and draw avatars yourself: it is small, makes no requests and works offline.
The URL
https://seedkin.dev/api/2.x/<style>/svg?seed=<seed>&<options>, where <style> is botling, snoot, noggin, beastie or sprite. 2.x is the package's major version: a seed draws the same avatar at the same URL for as long as 2.x lasts, and a 3.0 would come at new URLs rather than change these. The response is the SVG that seedkin 2.x draws for the same seed and options, byte for byte.
curl 'https://seedkin.dev/api/2.x/sprite/svg?seed=jolly-sprocket-65&element=water&look=sticker'
Options
| Option | Values | What it does |
|---|---|---|
seed | any text, up to 200 characters | Required. Picks the avatar. |
size | 8 to 1024 | Width and height in pixels. Default 96. Below 40 the simpler 9x9 avatar is drawn. |
palette | a number, or a holiday: newYear, valentines, stPatricks, fourthOfJuly, halloween, christmas | The colours. Numbers index the style's palettes; the style pages list them. |
shape | square, circle, triangle, diamond | Cell shape. |
frame | square, rounded, squircle, circle | The outline of the background. |
look | gapped, flat, inked, soft, soft-inked, sticker | How cells are drawn. |
detail | auto, full, small | The 15x15 or the 9x9 avatar, or the size's pick. |
background | true, false | Draw the palette's background. |
grid | auto, true, false | Draw the empty grid cells (gapped look only). |
animate | true, false | A small CSS animation inside the SVG, still for anyone who prefers reduced motion. |
title | up to 64 characters | The SVG's accessible name. Inside an <img>, the alt text is what counts. |
element | fire, water, earth, wind, space | Sprite only. |
skin | a number | Noggin only: an index into its skin tones. |
An unknown option, an option given twice or a value out of range gets a 400 with the reason in plain text, rather than an avatar that quietly ignores it. That way a URL that works today can't draw something else when an option is added later.
Caching
Since a URL always draws the same picture, responses are sent with Cache-Control: public, max-age=31536000, immutable. Browsers and the CDN keep them for a year, so a page full of avatars costs one request each, once.
Privacy
The seed is part of the URL, so it reaches seedkin.dev's logs and anything else that sees the URL. Seed with an opaque id, never an email address or a name. If that doesn't suit you, serve avatars yourself: it is a few lines.
Email and PNG
The API serves SVG only for now. Many email clients, Gmail among them, don't show SVG; for email, convert to PNG on your own server.