HTML → a fixed-size image (query form)
The signed-URL form of the card renderer: pass URL-encoded html (or template + data) in the query string.
Request
- Base URL: https://snaplab.dev
- URL: https://snaplab.dev/api/render/image
- Auth: one of:
- HTTP bearer
- API key in query parameter keyId and API key in query parameter sig
Query parameters
URL-encoded HTML. Provide this or template.
URL-encoded {{ template }} HTML.
JSON object (URL-encoded) with values for the template.
URL-encoded stylesheet.
Comma-separated font families.
Canvas width (default 1200).
Canvas height (default 630).
Pixel ratio (default 2).
Image format.
1–100, jpeg/webp only.
true/force emulate prefers-color-scheme: dark AND turn on Chromium's auto dark mode, so a site with no dark theme still comes back dark (a site that has one is left alone). prefers is the media query only.
Extra settle time.
Set false to force a fresh render.
json answers with a hosted URL.
API key id, for a signed URL. Send with sig.
hex(HMAC_SHA256(signingSecret, canonicalQuery)) over every pair except sig, sorted by name then value.
Optional Unix-seconds expiry, included in the signed canonical string.
Response
The rendered card.
Example response
{
"url": "https://snaplab.dev/i/c/V1StGXR8_Z5j",
"id": "V1StGXR8_Z5j",
"format": "png"
}Changes
No recorded changes to this operation across all 1 revision of this API.