Visual regression screenshot API for baseline capture in CI
Use Scrnpix as the hosted screenshot capture layer in your visual regression workflow. Capture fixed-view and full-page PNGs from public URLs, store them as baselines, and compare them with the diff tooling you already trust.
Good fit
- Capturing baseline screenshots from public staging, preview, or production URLs before a diff step.
- CI jobs that need a hosted browser rendering surface instead of local browser setup just to create reference images.
- Regression checks for public landing pages, docs, pricing pages, and other routes where URL-based capture is enough.
Not a fit
- Authenticated flows that need login state, test accounts, or private network access.
- Teams that need Scrnpix to provide image diffing, thresholds, approvals, or pull-request annotations.
- Cross-browser parity testing where the browser engine itself is the subject of the test.
Code example
Use the same endpoint and fixed capture settings for baseline and candidate screenshots so your diff step compares the same viewport, page height, and output format.
curl "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fwww.scrnpix.com%2Fpricing&width=1440&height=900&full_page=true&format=png" \ -H "X-KEY: your-api-key" \ -o visual-regression-baseline.png
Supported parameters
url
https://www.scrnpix.com/pricingThe public page URL to capture for the baseline or comparison image.
width
1440Viewport width. Keep this fixed across baseline and candidate runs.
height
900Viewport height used before capture. Keep this fixed with the width.
full_page
trueCapture the full scrollable page when below-the-fold changes matter.
format
pngUse PNG for visual regression baselines because it preserves lossless image detail.
Sample output
- Returns screenshot bytes directly as `image/png` or `image/jpeg` for storage as a baseline or CI artifact.
- Uses the same screenshot endpoint, API key header, and credit model as the core website screenshot API.
- Each capture costs 1 credit and returns the `X-Credit-Cost` header so CI usage is easy to account for.
Known boundaries
- Scrnpix captures public URLs only. Private preview apps need to be publicly reachable before the hosted API can render them.
- Dynamic content, cookie banners, rotating ads, timestamps, and experiments can still create noisy diffs if the target page renders them.
- Scrnpix returns the screenshot. Diffing, review, threshold tuning, and approval workflows stay in your CI or visual testing tool.
Related visual testing guides
Playwright screenshot API
Use Scrnpix as a baseline capture layer inside Playwright visual tests.
GitHub Actions screenshots
Capture screenshots from CI jobs and store them as workflow artifacts.
Vercel preview screenshots
Render public deploy previews before review or comparison steps.
Full-page capture recipe
Use full_page=true when visual changes below the fold matter.
Basic screenshot recipe
Start with the exact screenshot endpoint, API key header, and image response.
Screenshot workflow hub
Browse focused developer workflows for screenshot capture from public URLs.
Pricing examples
Scrnpix charges in credits. Screenshots cost 1 credit. Animations cost 1 credit per second of GIF duration (minimum 1).
Free
Use 50 monthly credits to validate baseline capture on a small set of public routes.
Basic
Run lightweight visual checks on selected pages across pull requests or scheduled jobs.
Growth
Cover recurring CI and deploy-preview captures across a larger public page set.
Frequently asked questions
Does Scrnpix replace Percy, Chromatic, or Playwright comparisons?
No. Scrnpix is the capture layer. Use it to generate screenshots from public URLs, then compare those images with your existing visual diff workflow.
How should I use this in CI?
Call the screenshot endpoint with fixed url, width, height, full_page, and format parameters. Save the returned image as a baseline or candidate artifact, then run your diff step.
Can I capture deploy previews?
Yes, as long as the preview URL is public from Scrnpix. Private previews, VPN-only apps, and routes requiring login still need your own authenticated browser flow.
Get an API key and test the flow end to end
Start with the free tier, verify the capture shape you need, then move up when the workflow becomes recurring.