Animation error
How to fix the Scrnpix API 500 Animation Error when the browser fails to create a scrolling GIF animation of the target page.
When Does This Happen?
This error occurs when the headless browser fails to load the target page or capture animation frames. Common causes include page load timeouts (20 second limit for animations), JavaScript errors, pages with scroll-hijacking that interfere with programmatic scrolling, or memory limits exceeded with too many frames.
Reproduce This Error
curl -H "X-KEY: your-api-key" \ "https://api.scrnpix.com/animate?url=https%3A%2F%2Fhttpstat.us%2F504"
{"error": "Animation error"}How to Fix
- 1Verify the target URL loads correctly in a regular browser
- 2Check that the page loads within 20 seconds
- 3Reduce max_frames if the animation is very long (default is 30, max is 60)
- 4Try disabling scroll_back to reduce the total number of frames
- 5Test with the /screenshot endpoint first to confirm the page renders correctly
Correct Request
curl -H "X-KEY: your-api-key" \ "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&max_frames=20" \ --output animation.gif
200 OK — returns a scrolling GIF animation
Related Errors
Frequently Asked Questions
What is the page load timeout for animations?
Scrnpix waits up to 20 seconds for the page to reach the networkidle0 state before starting the scroll animation. This is longer than the screenshot timeout (15 seconds) to accommodate more complex pages.
How can I debug animation issues?
First, try capturing a static screenshot of the same URL using the /screenshot endpoint. If the screenshot succeeds, the issue is likely related to scrolling behavior. Try reducing max_frames, increasing frame_delay, or testing with a simpler page.
Still Having Issues?
Check your API key and subscription status in the dashboard, or explore our language guides for integration examples.
Go to Dashboard