Shotfly

Use case

HTML to image API

Build the design with the HTML and CSS you already know, send it to Shotfly, and get an image back. It renders in a real browser, so CSS layout and scripts behave the way they do in Chrome, with no headless browser to run yourself.

<main>
  <header><div><p>Invoice</p><h1>#1042</h1></div><strong>Example Studio</strong></header>
  <dl><div><dt>Billed to</dt><dd>Example Co.</dd></div><div><dt>Issued</dt><dd>1 Dec 2026</dd></div><div><dt>Due</dt><dd>15 Dec 2026</dd></div></dl>
  …
</main>
Invoice #1042, rendered by Shotfly from the HTML above
Real render of this HTML · viewport 1200 × 630 · format=png · 2026-11-30 UTC
  1. 01

    Send up to 2 MB of markup in the html field of POST /v1/screenshot; css and js add styles or scripts, and wait_for_selector waits for content that appears late.

  2. 02

    Set the canvas with viewport_width and viewport_height (up to 3840 × 2160) and device_scale_factor up to 3 for sharp images; capture one element with selector, or the whole document with full_page.

  3. 03

    Get PNG, JPEG, WebP or PDF; thumbnail_width resizes the result on our side.

  4. 04

    Billed like any screenshot: one credit per successful render, nothing for failed ones. See the parameter reference.

One request.

Every option is a parameter; see the parameter reference.

Example
curl -X POST "https://api.shotfly.dev/v1/screenshot" -H "Authorization: Bearer $SHOTFLY_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"html":"<h1>Invoice #1042</h1><p>Total: $49.00</p>","css":"body{font-family:sans-serif;padding:48px}","viewport_width":1200,"viewport_height":630,"format":"png"}' \
  -o invoice.png