Documentation
Need Production Features?
URLPixel offers 10x performance, site organization, and professional support.
API Reference
Complete technical documentation
URLPixel Open Source provides a simple REST API for generating website screenshots. All endpoints return JSON responses with consistent error handling and detailed metadata.
https://your-domain.com
Quick Start Example
Generate a Screenshot
curl -X POST https://your-domain.com/screenshot \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"quality": "high",
"fullPage": false,
"removeAds": true
}'
API Endpoints
Headers
Name | Required | Description |
---|---|---|
Content-Type | Required | Must be application/json |
X-API-Key | Optional | API key for authentication (if configured) |
Parameters
Name | Type | Required | Description |
---|---|---|---|
url | string | Required | The URL to capture. Must be a valid HTTP or HTTPS URL. |
quality | string | Optional | Screenshot quality profile Default: "standard" Options: "standard", "high", "retina", "mobile" |
wait | number | Optional | Additional wait time in milliseconds (1000-8000) Default: "Smart wait time based on URL" |
fullPage | boolean | Optional | Capture full page height instead of viewport only |
removeAds | boolean | Optional | Attempt to remove ads, cookie banners, and popups Default: true |
Example Request
{
"url": "https://example.com",
"quality": "high",
"fullPage": false,
"removeAds": true
}
Example Response
{
"success": true,
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"url": "https://example.com",
"quality": "standard",
"width": 1280,
"height": 720,
"fileSize": 145678,
"processingTimeMs": 2500
}
Quality Profiles
standard
1280×720
Good quality for web previews and thumbnails
high
1920×1080
High definition for detailed screenshots
retina
2560×1440
Retina/HiDPI displays with double pixel density
mobile
375×667
Mobile viewport simulation
Error Codes
Bad Request
Invalid URL format or missing required parameters
{
"success": false,
"error": "URL is required"
}
Unauthorized
Invalid or missing API key (when authentication is enabled)
{
"error": "Invalid API key"
}
Request Timeout
Website took too long to load or respond
{
"success": false,
"error": "Navigation timeout - site took too long to load"
}
Internal Server Error
Screenshot generation failed or server error
{
"success": false,
"error": "Screenshot generation failed"
}
Authentication (Optional)
URLPixel Open Source supports optional API key authentication. When the API_KEY
environment variable is set, all requests must include the API key in the headers.
Environment Configuration
API_KEY=your-secret-api-key
Request Headers
X-API-Key: your-secret-api-key
Authorization: Bearer your-secret-api-key