GET /animate

CI Regression GIF — Automated Visual Testing Animation

Generate scroll GIFs in your CI pipeline for visual regression testing. Compare animations between builds to catch layout and scroll behavior changes.

Parameters

NameValueDescription
urlhttps://example.comThe page under test
width1280Consistent viewport for comparisons
height720Consistent viewport for comparisons
scroll_duration3000Fixed duration for reproducible output
scroll_easinglinearLinear scroll for consistent frame comparison

cURL Example

cURL
curl -H "X-KEY: your-api-key" "https://api.scrnpix.com/animate?url=https://example.com&width=1280&height=720&scroll_duration=3000&scroll_easing=linear" -o regression.gif

SDK Example

Python
import requests
import sys

url = sys.argv[1] if len(sys.argv) > 1 else "https://example.com"

response = requests.get(
    "https://api.scrnpix.com/animate",
    headers={"X-KEY": "your-api-key"},
    params={
        "url": url,
        "width": 1280,
        "height": 720,
        "scroll_duration": 3000,
        "scroll_easing": "linear"
    }
)

response.raise_for_status()
with open("regression.gif", "wb") as f:
    f.write(response.content)

print(f"Captured {len(response.content)} bytes")

Expected Output

Content-Typeimage/gif
Credit Cost3 credits
Notes3-second linear scroll for reproducibility

Failure Modes

Dynamic content causes non-deterministic output

Symptom: GIF differs between runs even with no code changes

Fix: Use linear easing and fixed duration for maximum reproducibility. Dynamic content like timestamps or ads will still vary.

CI environment cannot reach the API

Symptom: Connection timeout or DNS resolution failure

Fix: Ensure your CI runner has outbound internet access to api.scrnpix.com. Add the API URL to any network allowlists.

Frequently Asked Questions

Why use linear easing for CI regression tests?

Linear easing produces consistent frame spacing regardless of run timing, making frame-by-frame comparison between builds more reliable.

How do I compare GIFs between builds?

Extract frames using tools like ImageMagick or gifsicle, then compare individual frames using pixel-diff tools like pixelmatch.

Related Recipes

Ready to try this recipe?

Get your API key and run this recipe in seconds. Free tier includes 50 credits per month.

Get API Key