Skip to content

Visual diff of two web pages in one call

Give two public URLs, or one URL and a stored baseline. Kanagu captures both at the same viewport, compares them pixel by pixel, and returns the changed regions with links to the images.

$0.01/call · 10 free calls a day, no signup · REST and MCP

curl https://api.kanagu.dev/v1/screenshot/diff \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.iana.org/domains/reserved","compareToUrl":"https://www.rfc-editor.org/about/","viewport":{"width":1024,"height":768},"waitUntil":"load","waitForSelector":"h1"}'
const res = await fetch("https://api.kanagu.dev/v1/screenshot/diff", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://www.iana.org/domains/reserved",
    "compareToUrl": "https://www.rfc-editor.org/about/",
    "viewport": {
      "width": 1024,
      "height": 768
    },
    "waitUntil": "load",
    "waitForSelector": "h1"
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "screenshot.diff",
    "arguments": {
      "url": "https://www.iana.org/domains/reserved",
      "compareToUrl": "https://www.rfc-editor.org/about/",
      "viewport": {
        "width": 1024,
        "height": 768
      },
      "waitUntil": "load",
      "waitForSelector": "h1"
    }
  }
}

Why

What it solves

Visual regression checks need a browser, stable captures, masking of dynamic content and somewhere to keep the images. Kanagu runs the browser and the comparison and stores the PNGs, so a single HTTP call or agent tool call gives you an answer.

Built for

  • Teams checking deploys, previews and marketing pages for visual regressions
  • Monitoring jobs that watch a competitor, partner or status page for changes
  • AI agents that need to confirm a UI change actually happened
Two URLs or a baseline
Compare a page with another page, or with a capture from an earlier comparison using its baselineId, to track one page over time.
Stable captures
Choose the viewport, wait for load or network idle, wait for a selector, add a delay, and mask selectors such as ads or timestamps.
Results you can act on
Changed pixel count and ratio, bounding rectangles of the changes, and before, after and diff PNGs.

Example

What goes in, what comes out

In: A URL and a second URL or a baseline ID, plus viewport, waits and masks. Out: Changed pixels, diff ratio, changed rectangles, and before, after and diff PNG links.

Request · POST /v1/screenshot/diff
{
  "url": "https://www.iana.org/domains/reserved",
  "compareToUrl": "https://www.rfc-editor.org/about/",
  "viewport": {
    "width": 1024,
    "height": 768
  },
  "waitUntil": "load",
  "waitForSelector": "h1"
}
Response · illustrative values
{
  "changedPixels": 412318,
  "diffRatio": 0.5243,
  "width": 1024,
  "height": 768,
  "rectangles": [
    {
      "x": 0,
      "y": 0,
      "width": 1024,
      "height": 768
    }
  ],
  "before": {
    "id": "…",
    "url": "https://api.kanagu.dev/v1/screenshot/artifacts/…",
    "expiresAt": "2026-12-24T09:12:03.000Z"
  },
  "after": {
    "id": "…",
    "url": "https://api.kanagu.dev/v1/screenshot/artifacts/…",
    "expiresAt": "2026-12-24T09:12:03.000Z"
  },
  "diff": {
    "id": "…",
    "url": "https://api.kanagu.dev/v1/screenshot/artifacts/…",
    "expiresAt": "2026-12-24T09:12:03.000Z"
  }
}

Values are illustrative. Images are kept for 30 days.

Try it

Run it on the live API

The sample request is ready to run. No key needed for 10 calls a day.

screenshot.diff

$0.01/call

No key needed · 10 free calls per IP per day

Response

Run the request to see the live response here.

Reference

Operations

OperationPrice
screenshot.diff

Compare public web pages or a stored screenshot baseline at a fixed viewport.

$0.01/call
curl https://api.kanagu.dev/v1/screenshot/diff \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.iana.org/domains/reserved","compareToUrl":"https://www.rfc-editor.org/about/","viewport":{"width":1024,"height":768},"waitUntil":"load","waitForSelector":"h1"}'
const res = await fetch("https://api.kanagu.dev/v1/screenshot/diff", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://www.iana.org/domains/reserved",
    "compareToUrl": "https://www.rfc-editor.org/about/",
    "viewport": {
      "width": 1024,
      "height": 768
    },
    "waitUntil": "load",
    "waitForSelector": "h1"
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
claude mcp add --transport http kanagu https://api.kanagu.dev/mcp \
  --header "Authorization: Bearer $KANAGU_KEY"
{
  "mcpServers": {
    "kanagu": {
      "url": "https://api.kanagu.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${env:KANAGU_KEY}"
      }
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "screenshot.diff",
    "arguments": {
      "url": "https://www.iana.org/domains/reserved",
      "compareToUrl": "https://www.rfc-editor.org/about/",
      "viewport": {
        "width": 1024,
        "height": 768
      },
      "waitUntil": "load",
      "waitForSelector": "h1"
    }
  }
}

Every field, error and schema is in the screenshot.diff reference.

Coverage

Limits and coverage

Viewport
320–1600 × 240–1200 px, default 1280 × 720. The visible viewport is captured, not the full page.
Waiting
waitUntil load, domcontentloaded, networkidle0 or networkidle2; waitForSelector; waitMs up to 2 seconds
Masking
Up to 20 CSS selectors; per-pixel threshold 0–0.5, default 0.1
Pages
Public URLs only
Images
Before, after and diff PNGs are kept for 30 days and can serve as baselines until then

Compare

Compared with the usual approaches

Ways teams usually compare pages:

ApproachWhat you take on
Run a headless browser yourselfOperate browser infrastructure, write the pixel comparison, and store images somewhere.
A full visual testing platformFits test suites with review workflows; heavier when you only need one comparison from a script or agent.
KanaguOne call at $0.01 returns the numbers and the images, with no browser to run.

Pricing

$0.01/call, billed only on success

$1 of usage free every month after sign-in. Then pay as you go with no monthly fee, or the $9/month Bundle with $9 of usage included, shared across every Kanagu product. Compare plans

Sign in, create a key and use $1 of calls free each month, no card needed. Subscribe from your dashboard when you need more. Polar is the merchant of record and handles payment, tax and invoices.

10 free calls a day
Start without a key
Try every call above for free. When it works, sign in for a key with $1 of usage free every month.

FAQ

Screenshot diff questions

Does it capture the full page?
No. It captures the viewport you set, up to 1600 × 1200 pixels.
How do I compare a page with yesterday's version?
Pass the before or after ID from an earlier response as baselineId. Captures are kept for 30 days.
How do I ignore dynamic content?
List CSS selectors in maskSelectors, such as ad slots, dates or carousels, and raise threshold for anti-aliasing noise.
What does a comparison cost?
$0.01 per call, which includes both captures and the stored images.

More APIs with the same key