hmmd-html2image

Self-hosted HTML/CSS → image rendering API. Source on GitHub

Authentication

All /v1/* routes require an x-api-key header. Requests without a valid key return 401.

x-api-key: <your-api-key>

POST /v1/imageauth required

Renders HTML/CSS (or a live URL) to an image and returns a fetchable URL.

curl -X POST https://html2image.humanmd.club/v1/image \
  -H "x-api-key: $API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "html": "<div style=\"padding:40px;background:#000;color:#fff;font-size:32px;\">Hello HMMD</div>",
    "viewport_width": 1080,
    "viewport_height": 1350,
    "format": "png"
  }'

Response:

{
  "id": "uuid",
  "format": "png",
  "url": "https://html2image.humanmd.club/v1/image/uuid.png",
  "created_at": "2026-06-17T19:31:32.660Z"
}
paramdefaultnotes
htmlHTML to render (or pass url to screenshot a live page instead)
cssinjected as a <style> tag
google_fontse.g. Figtree:wght@400;600
viewport_width1200
viewport_height630
device_scale1pixel density
formatpngpng, jpeg, webp
selectorCSS selector to screenshot a single element instead of full page
ms_delay0wait this many ms before capturing

GET /v1/image/:id.:extpublic

Fetches a previously rendered image. No API key needed — filenames are unguessable UUIDs, so the URL itself is the access control (same model as hcti.io). Files are auto-deleted after 24h.

GET /healthno auth

Liveness check. Returns { "status": "ok" }.

Configuration (this deployment)

Base URLhttps://html2image.humanmd.club
Hosted onVPS vps.humanmd.club, Docker, behind Coolify/Traefik (Let's Encrypt TLS)
RendererHeadless Chromium via Puppeteer
Storage retention24 hours, auto-cleaned hourly