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
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.
{
"url": "https://www.iana.org/domains/reserved",
"compareToUrl": "https://www.rfc-editor.org/about/",
"viewport": {
"width": 1024,
"height": 768
},
"waitUntil": "load",
"waitForSelector": "h1"
}{
"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.
Reference
Operations
| Operation | Price |
|---|---|
| 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:
| Approach | What you take on |
|---|---|
| Run a headless browser yourself | Operate browser infrastructure, write the pixel comparison, and store images somewhere. |
| A full visual testing platform | Fits test suites with review workflows; heavier when you only need one comparison from a script or agent. |
| Kanagu | One call at $0.01 returns the numbers and the images, with no browser to run. |
Pricing
$0.01/call, billed only on success
- screenshot.diff$0.01 / call
$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.
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
- E-invoicingGenerate, validate and parse XRechnung and ZUGFeRD invoices.
- France e-reportingDGFiP Flux 10 e-reporting XML for B2C sales, cross-border B2B and service receipts, checked against v3.2.
- Bank statementsTurn Chase, Wells Fargo and Barclays PDF statements into reconciled transactions.
- OTA payoutsMatch Airbnb, Booking.com and Vrbo payouts to the deposits on your bank statement.
- Rent rollsReconcile a multifamily rent roll against its T12: occupancy, loss to lease, vacancy and rent collected.
- Pay applicationsCheck AIA G702 and G703 pay applications line by line, against the last certified one and approved change orders.
- VAT validationCheck EU and UK VAT numbers against VIES and HMRC, with audit evidence.
- Packaging EPRPackaging weights by US state EPR category and Germany LUCID reports, traced to each SKU.
- CPSC eFilingCheck CPC and GCC certificates against each CBP entry line and get the PGA fields to file.
- PFAS reportingDecide Minnesota and Maine PFAS-in-products reporting and get the PRISM rows, MDA statements and deadlines.
- Demurrage auditAudit FMC demurrage and detention invoices against 46 CFR 541, recalculate each day and draft the dispute.
- UK CARFHMRC cryptoasset reports as OECD CARF XML, checked against HMRC's file rules and TIN check digits.
- EU PPWREU packaging regulation checks for heavy metals, PFAS, recycled content and empty space, with a draft declaration.
- SEC fundamentalsPoint-in-time SEC XBRL financials with every restatement, for backtests without look-ahead.
- Business daysBusiness-day math and SLA deadlines with public holidays in 207 countries.
- CSV validationCheck uploaded CSV files against a column schema before you import them.
- Email parsingParse raw .eml messages into headers, bodies, attachments and thread IDs.