Visual Regression & Screenshot Diff for AI Agents
Pricing
$5.00 / 1,000 page pair compared on one viewports
Visual Regression & Screenshot Diff for AI Agents
Compare two web pages (production vs preview, before vs after a deploy) on desktop and phone sizes: percent of pixels changed, changed regions as boxes, a diff image and PASS or FAIL. Visual regression testing for AI agents and MCP. $0.005 per page pair per viewport.
Pricing
$5.00 / 1,000 page pair compared on one viewports
Rating
0.0
(0)
Developer
FFS Marketing
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 hours ago
Last modified
Categories
Features
Share
Compare two web pages, for example production and a preview deploy, on desktop and phone sizes, and get back the percent of pixels that changed, every changed region as a box, a diff image and a PASS or FAIL verdict. It answers the question a coding agent should ask after every change: "did my edit move or break something I did not mean to touch?" The check runs outside the agent's own code, so the agent cannot quietly patch the test to make it pass.
Works as a tool for AI agents. Add it to Claude, ChatGPT, Cursor, VS Code or any MCP client through Apify's MCP server (https://mcp.apify.com/?tools=fluidfaith/visual-diff-gate), or call it with one API request. JSON in, JSON out, one overall verdict in OUTPUT. Setup is in Use it from an agent.
Costs $0.005 per page pair per viewport. One page on desktop and phone is $0.01. Pages that fail to load are free, and your maximum charge per run is never exceeded.
Why use it
- A verdict, not just a picture. PASS or FAIL against the change you allow (default 0.2% of pixels), plus
diffPercent,changedPixelsandheightChanged. - Changed regions an agent can reason about. Each change comes back as a box (
x,y,width,height, changed pixels), largest first, so the agent can tell "one word changed in the hero" from "the whole pricing section moved down 120px". - Production vs preview in one call. Give two site addresses and a list of paths (
/,/pricing,/blog), and every path is compared on every viewport. - Steady results. Fonts are pinned, animations are finished or stopped, lazy images are scrolled into view, the caret is hidden. Mask the parts that change on every load (clocks, carousels, ads) and hide cookie banners.
- Desktop, laptop, tablet and today's phones: the same phone sizes as Mobile QA Gate (iPhone 15 to 18, Galaxy, Pixel), or any size like
1024x768.
What you get
| Field | What it is |
|---|---|
verdict | PASS, FAIL or ERROR (could not be compared, not charged). |
diffPercent | Percent of pixels that changed, for example 0.2864. |
changedPixels, totalPixels | The raw counts behind diffPercent. |
regions | Up to 20 changed regions, largest first: { x, y, width, height, changedPixels } in CSS pixels from the top left of the page. |
regionCount | How many separate changed regions there were in total. |
heightChanged, baselineHeight, candidateHeight | Whether the page got taller or shorter. The extra area counts as changed. |
diffImageUrl | PNG: the baseline page faded to grey, changed pixels in red (anti-aliasing edges in yellow). |
baselineImageUrl, candidateImageUrl | The two screenshots (PNG). |
baselineStatus, candidateStatus | HTTP status of each page. |
warnings, error | Anything worth knowing (page cut at the height limit, blocked embeds) and why a comparison failed. |
Input
Two ways to give pages; you can use both in one run.
Pairs of URLs:
{"pairs": [{ "name": "home", "baseline": "https://www.example.com/", "candidate": "https://preview-123.example.pages.dev/" },{ "name": "pricing", "baseline": "https://www.example.com/pricing", "candidate": "https://preview-123.example.pages.dev/pricing" }],"viewports": ["Desktop", "iPhone 15-16"]}
Two sites plus paths (production vs preview):
{"baselineOrigin": "https://www.example.com","candidateOrigin": "https://preview-123.example.pages.dev","paths": ["/", "/pricing", "/blog"],"viewports": ["Desktop", "iPhone 15-16"],"maskSelectors": [".testimonial-carousel", "#live-visitors"],"hideSelectors": ["#cookie-banner"]}
| Field | Default | Notes |
|---|---|---|
pairs | none | { baseline, candidate, name } objects, up to 100 pairs. |
baselineOrigin, candidateOrigin, paths | paths: ["/"] | Each path becomes one pair. |
viewports | ["Desktop", "iPhone 15-16"] | Presets: Desktop (1440x900), Laptop (1280x800), Tablet (820x1180), iPhone 15-16, iPhone 17-18 Pro, iPhone 18 Pro Max, Galaxy S, Pixel, or any WIDTHxHEIGHT from 320 to 2560. Up to 10. Each viewport is billed separately. |
maxDiffPercent | 0.2 | FAIL above this percent of changed pixels. 0 fails on any changed pixel. |
pixelThreshold | 0.1 | Colour sensitivity, 0 (any difference) to 1. 0.1 ignores tiny colour noise. |
fullPage | true | Compare the whole scrolling page. false compares the first screen only. |
maxPageHeight | 8000 | Pages taller than this (CSS px) are compared from the top down to this height. Up to 20000. |
maskSelectors | [] | CSS selectors painted over in both screenshots (they never count as changed). |
hideSelectors | [] | CSS selectors made invisible before the screenshot. |
waitAfterLoadMs | 800 | Extra wait after the load event. |
navigationTimeoutSecs | 45 | Page load limit. |
saveImages | true | Save the diff image and both screenshots and return their links. |
maxConcurrency | 2 | Pairs compared at the same time (up to 3). |
proxyConfiguration | none | Optional Apify proxy for sites that block data-center traffic. |
Output
One dataset row per pair per viewport (example, trimmed):
{"name": "pricing","baselineUrl": "https://www.example.com/pricing","candidateUrl": "https://preview-123.example.pages.dev/pricing","viewport": "iPhone 15-16","viewportSize": { "width": 393, "height": 852 },"verdict": "FAIL","diffPercent": 1.0493,"changedPixels": 7555,"totalPixels": 719976,"maxDiffPercent": 0.2,"baselineHeight": 1832,"candidateHeight": 1832,"heightChanged": false,"regionCount": 2,"regions": [{ "x": 41, "y": 515, "width": 101, "height": 42, "changedPixels": 3778 },{ "x": 41, "y": 321, "width": 101, "height": 42, "changedPixels": 3777 }],"diffImageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/<key>-iPhone1516-diff","baselineImageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/<key>-iPhone1516-baseline","candidateImageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/<key>-iPhone1516-candidate","baselineStatus": 200,"candidateStatus": 200,"warnings": [],"error": null}
The run's OUTPUT record holds one overall answer, the easiest thing for an agent to branch on:
{ "verdict": "FAIL", "comparisons": 4, "passed": 3, "failed": 1, "errors": 0,"results": [ { "name": "pricing", "viewport": "iPhone 15-16", "verdict": "FAIL", "diffPercent": 1.0493, "regionCount": 2, "diffImageUrl": "..." } ] }
If the run stops at your maximum charge, OUTPUT also has "stoppedAtSpendingCap": true and "notCompared": <count>.
Use it from an agent
Through Apify's MCP server (Claude, ChatGPT, Cursor, VS Code, any MCP client)
{"mcpServers": {"visual-diff-gate": {"url": "https://mcp.apify.com/?tools=fluidfaith/visual-diff-gate","headers": { "Authorization": "Bearer <APIFY_TOKEN>" }}}}
Claude Code: claude mcp add --transport http visual-diff-gate "https://mcp.apify.com/?tools=fluidfaith/visual-diff-gate" --header "Authorization: Bearer $APIFY_TOKEN". Claude Desktop: paste the JSON above into Settings > Developer > Edit config. Or run it over stdio: npx -y @apify/actors-mcp-server --tools fluidfaith/visual-diff-gate with APIFY_TOKEN set.
A good instruction for coding agents: "Before you report a front-end change as done, call visual-diff-gate with production as the baseline and your preview deploy as the candidate. Every changed region must be one you meant to change. Open diffImageUrl for any FAIL."
Through the API (one call, waits for the result)
curl -s -X POST "https://api.apify.com/v2/acts/fluidfaith~visual-diff-gate/run-sync-get-dataset-items?token=$APIFY_TOKEN" \-H 'Content-Type: application/json' \-d '{"baselineOrigin":"https://www.example.com","candidateOrigin":"https://preview.example.com","paths":["/"]}'
From JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('fluidfaith/visual-diff-gate').call({baselineOrigin: 'https://www.example.com', candidateOrigin: 'https://preview.example.com', paths: ['/', '/pricing'],});const { value } = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');if (value.verdict !== 'PASS') console.log(value.results.filter((r) => r.verdict !== 'PASS'));
Pricing
Pay per event: $0.005 per page pair per viewport (viewport-pair-compared).
| Example | Cost |
|---|---|
| 1 page, desktop and phone | $0.01 |
| 10 pages, desktop and phone | $0.10 |
| 50 pages on 4 viewports | $1.00 |
Pages that never arrive, return an error status, are refused or hit the time limit are free. A page whose load event is slow but whose content arrived is still compared (with a warning). If you set a maximum charge per run, the Actor sets aside the cost of each comparison before starting it, so it never charges past your maximum, even with pairs running in parallel. It stops starting new comparisons when the budget is used up and still writes OUTPUT.
Safety
- Only public web addresses are compared. Localhost, private networks (10.x, 172.16-31.x, 192.168.x), link-local and cloud metadata addresses (169.254.x), CGNAT, IPv6 loopback and private ranges, and
.local/.internalnames are refused, also when a public page redirects to them. Embedded frames that point at them are blocked and noted inwarnings. Refused pages areERRORand not charged. - Hard time limits on every page load and on the whole comparison: a page that never answers or a script that never stops becomes an
ERRORrow (not charged) instead of holding the run. - Pages are loaded as an anonymous visitor: no login, no clicks, no forms.
- Image links point to the run's key-value store and can be opened by anyone with the link. Keep that in mind for private preview builds.
Privacy
Pages are loaded in the run, and the screenshots and results are kept only in your own run storage for your account's retention period. Query strings are left out of the run log.
FAQ
Can it compare a preview or staging deploy? Yes, if the URL is publicly reachable (Vercel, Netlify and Cloudflare Pages preview links work). Localhost and private networks are refused.
Why did an unchanged page FAIL? Something on it changes on every load: a clock, a rotating testimonial, an ad, a random image. Add its CSS selector to maskSelectors. The regions boxes show where to look.
Why did a changed word PASS? One word is usually under the default 0.2%. It is still listed in regions. Set maxDiffPercent to 0 to fail on any change.
The page got taller. Why is half of it red? When content is added, everything below it moves down, so it all counts as changed, and the extra height counts too. heightChanged and the first region's y tell you where the shift starts.
Can I compare against a saved screenshot? Not yet: both sides are live pages. Keep production as the baseline, or compare two deploy URLs.
What happens at my spending limit? The Actor stops before the comparison that would go over it, writes OUTPUT with stoppedAtSpendingCap: true, and charges nothing past the limit.
How do I get help? Open an issue on the Issues tab. We read and answer every one.
Other Actors by Fluid Faith
- Mobile Website Test on iPhone & Android (Mobile QA Gate): PASS or FAIL per page on today's phones, with screenshots. $0.01 per page per phone.
- Lighthouse & Accessibility Audit: Lighthouse scores, Core Web Vitals and axe-core issues with the top 5 fixes. $0.02 per URL per form factor.
- PDF to Markdown with Tables: PDF, Word, PowerPoint and Excel to Markdown with every table as JSON rows. $0.002 per page.
- Video Frame Extractor & Media Probe: ffprobe metadata, frames, scene cuts, a contact sheet and loudness from direct video or audio links. $0.001 per frame.
Load them together as MCP tools: https://mcp.apify.com/?tools=fluidfaith/visual-diff-gate,fluidfaith/mobile-qa-gate,fluidfaith/lighthouse-gate,fluidfaith/pdf-to-markdown-tables,fluidfaith/media-probe