NewIntroducing semantic snapshotsPair every capture with structured DOM data →

For products that send or design email

Show a picture of every email template in your app

Render each email's HTML to an image at email width, for template galleries, approvals and archives.

The problem

An email builder needs a thumbnail of every template, an approval step needs to show a manager what will be sent, and a campaign archive needs a picture of each send. All of them start from HTML that nobody wants to open in a browser one at a time.

How domscout handles it

Send the email's HTML with the viewport set to its width, commonly 600 pixels, and get back a PNG or WebP after the images it links to have loaded. The result shows how a browser renders the email. Desktop and mobile mail clients each apply their own rules, so use it for previews and records, not as a test of how every inbox will display the message.

Where it shows up

  • Thumbnails in a template gallery.
  • An approval step that shows exactly what will be sent.
  • A picture of each campaign in a send archive.

The request

POST /screenshot. Available on every plan, including the free Hobby plan, at 1 credit an image. A long email needs fullPage, which starts at Pro.

cURL
curl -X POST https://api.domscout.io/screenshot \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
    "width": 600,
    "height": 800,
    "deviceScaleFactor": 2,
    "format": "png",
    "responseType": "binary"
  }' \
  -o email.png
Node.js
import { writeFile } from "node:fs/promises";

const response = await fetch("https://api.domscout.io/screenshot", {
  method: "POST",
  headers: { "Content-Type": "application/json", "x-api-key": "YOUR_API_KEY" },
  body: JSON.stringify({
    html: "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
    width: 600,
    height: 800,
    deviceScaleFactor: 2,
    format: "png",
    responseType: "binary"
  }),
});
await writeFile("email.png", Buffer.from(await response.arrayBuffer()));
Python
import requests

response = requests.post(
    "https://api.domscout.io/screenshot",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={
        "html": "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
        "width": 600,
        "height": 800,
        "deviceScaleFactor": 2,
        "format": "png",
        "responseType": "binary"
    },
)
with open("email.png", "wb") as f:
    f.write(response.content)
Go
package main

import (
	"bytes"
	"encoding/json"
	"io"
	"net/http"
	"os"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"html": "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
		"width": 600,
		"height": 800,
		"deviceScaleFactor": 2,
		"format": "png",
		"responseType": "binary",
	})
	req, _ := http.NewRequest("POST", "https://api.domscout.io/screenshot", bytes.NewReader(body))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("x-api-key", "YOUR_API_KEY")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := os.Create("email.png")
	defer out.Close()
	io.Copy(out, res.Body)
}
PHP
<?php
$ch = curl_init('https://api.domscout.io/screenshot');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'x-api-key: YOUR_API_KEY'],
    CURLOPT_POSTFIELDS => json_encode([
        'html' => '<table width="600" style="font-family:sans-serif"><tr><td style="padding:24px"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>',
        'width' => 600,
        'height' => 800,
        'deviceScaleFactor' => 2,
        'format' => 'png',
        'responseType' => 'binary'
    ]),
]);
$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
file_put_contents('email.png', $response);
Ruby
require "json"
require "net/http"

response = Net::HTTP.post(
  URI("https://api.domscout.io/screenshot"),
  {
    html: "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
    width: 600,
    height: 800,
    deviceScaleFactor: 2,
    format: "png",
    responseType: "binary"
  }.to_json,
  "Content-Type" => "application/json",
  "x-api-key" => "YOUR_API_KEY"
)
File.binwrite("email.png", response.body)
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

public class Capture {
    public static void main(String[] args) throws Exception {
        String body = """
            {
                "html": "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
                "width": 600,
                "height": 800,
                "deviceScaleFactor": 2,
                "format": "png",
                "responseType": "binary"
            }
            """;
        HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.domscout.io/screenshot"))
            .header("Content-Type", "application/json")
            .header("x-api-key", "YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build();
        HttpResponse<Path> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofFile(Path.of("email.png")));
        System.out.println("Saved " + response.body());
    }
}
C#
using System.Net.Http.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

var response = await client.PostAsJsonAsync("https://api.domscout.io/screenshot", new {
    html = "<table width=\"600\" style=\"font-family:sans-serif\"><tr><td style=\"padding:24px\"><h1>Your October update</h1><p>Here is what changed this month.</p></td></tr></table>",
    width = 600,
    height = 800,
    deviceScaleFactor = 2,
    format = "png",
    responseType = "binary"
});
await File.WriteAllBytesAsync("email.png", await response.Content.ReadAsByteArrayAsync());

Go further

More in Screenshots, images and PDFs: Thumbnails and link previews · PDFs from your own HTML · HTML to image · Web page to PDF · Screenshots of a list of URLs · Product screenshots for docs · Dashboard screenshots to chat · Monthly reports for clients · Full-page captures for review tools · All use cases

Give your product a browser.

Get clean web content and visual proof into your workflow in minutes.