← All articles

How to Automate Visual Regression Testing with an API

Manual visual QA doesn’t scale with CI

Clicking through a comparison tool works fine for a one-off check. It doesn’t work for a pipeline that runs on every pull request, every deploy, or every build. If visual regression testing depends on someone remembering to manually upload two screenshots, it won’t happen consistently — and the whole point of catching a broken layout or a rendering regression is catching it before it ships, automatically, every time.

Compare images or video via API in a few requests

DiffALL’s API is built for exactly this — submit a comparison job, poll for the result, and get a score your pipeline can act on:

  1. Submit a comparison job with POST /api/v1/compare — your API key goes in the X-API-Key header, and the two files (a baseline screenshot and a new one, or two video renders) go as multipart form fields file1 and file2.
  2. Poll for the result — image and text comparisons return the result immediately; video and audio jobs return a job_id and status_url to poll with GET /api/v1/compare/<job_id> until it’s done.
  3. Read the response — a similarity score, a heatmap of what changed, and the metrics behind it (SSIM/PSNR for images and video).

What you get back

  • A similarity score you can gate a build on — fail the pipeline if it drops below a threshold you set.
  • A diff heatmap — so a failed check comes with a visual you can attach to the PR or build log, not just a number.
  • Structured JSON output — easy to parse in any CI system (GitHub Actions, GitLab CI, Jenkins, or a custom script).
  • API key management — generate and manage keys without touching the UI.

Common use cases

  • Visual regression in CI/CD — automatically compare screenshots of key pages or components against an approved baseline on every PR.
  • Render pipeline QA — verify that a video rendering or transcoding pipeline produces consistent output across runs or environment changes.
  • Design system enforcement — catch unintended visual drift in shared components before it reaches production.
  • Cross-browser or cross-device checks — compare the same page rendered in different environments and flag meaningful differences automatically.

Beyond CI

The same API handles audio and text/JSON comparisons too, so a broader QA pipeline — visual, audio, and data — can run through one integration instead of stitching together separate tools.

Try it now

If visual QA only happens when someone remembers to do it, it’s not really QA. Check the API docs and wire a similarity check into your pipeline so it runs on every build, automatically.

Stop hunting for differences by hand. DiffALL spots every change between any two files — automatically.

Compare your files — free