Capture screenshots in PHP
Add screenshot and scrolling GIF capabilities to your PHP applications with built-in cURL. No Selenium, no headless browsers to manage.
Installation
- 1Ensure cURL extension is enabled (usually pre-installed)
- 2Get your API key from the dashboard
- 3Set the X-KEY header in your cURL requests
Authentication
Include your API key in the X-KEY header with every request:
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-KEY: your-api-key'
]);PHP Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
curl "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png" \ -H "X-KEY: your-api-key" \ -o screenshot.png
curl "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out" \ -H "X-KEY: your-api-key" \ -o animation.gif
Response Format
On success, the API returns the image binary data directly in the response body.
| Status Code | 200 OK |
| Content-Type | image/png, image/jpeg, or image/gif |
| Body | Binary image data (string) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
No need to install Selenium or manage headless Chrome. Just use the cURL extension included with most PHP installations.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
PHP Integration
Simple cURL pattern. Integrates seamlessly with Laravel, Symfony, WordPress, or any PHP framework.
Rich Features
Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.
Frequently Asked Questions
Do I need to install any browser dependencies for PHP?
No. Scrnpix runs browsers on our infrastructure. You only need the PHP cURL extension (usually pre-installed) to make HTTP calls.
Can I use this with Laravel or WordPress?
Yes. Scrnpix works with any PHP framework — Laravel, Symfony, WordPress, or plain PHP scripts.
How do I handle errors in PHP?
Check the HTTP response code using curl_getinfo(). A 200 status means success with image bytes in the body. 4xx errors indicate invalid params or auth issues, 5xx errors are server-side.
What PHP version is required?
Any modern PHP version (7.4+) with cURL extension support. The API is a simple HTTP GET request.
Ready to capture screenshots in PHP?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free