400/animate

clip=true requires clip_width and clip_height

How to fix the Scrnpix API error when clip=true is set but clip_width or clip_height is missing from your animate request.

When Does This Happen?

This error occurs when you enable clipping with clip=true on the /animate endpoint but omit the required clip_width or clip_height parameters. Both dimensions must be specified to define the clip rectangle.

Reproduce This Error

curl -H "X-KEY: your-api-key" \
  "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&clip=true"
clip=true requires clip_width and clip_height

How to Fix

  1. 1Add both clip_width and clip_height parameters when using clip=true
  2. 2Set clip_x and clip_y to position the clip rectangle (default is 0,0)
  3. 3Ensure the clip rectangle fits within the viewport dimensions

Correct Request

curl -H "X-KEY: your-api-key" \
  "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&clip=true&clip_x=0&clip_y=0&clip_width=400&clip_height=300" \
  --output animation.gif
200 OK — returns the clipped animation as a GIF

Related Errors

Frequently Asked Questions

What are the valid ranges for clip dimensions?

clip_width accepts values from 1 to 4000 pixels and clip_height accepts values from 1 to 4000 pixels. The clip_x and clip_y offsets accept values from 0 to 10000 pixels.

Still Having Issues?

Check your API key and subscription status in the dashboard, or explore our language guides for integration examples.

Go to Dashboard