🎯 Online Debug
🚀 API Interface
Generate Website Screenshot
GET /api/screenshot
📋 Request Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
url |
string | Yes | - | Target website URL for screenshot |
format |
string | No | webp | Image format (webp, png) |
width |
number | No | 1920 | Viewport width (100-3840) |
height |
number | No | 1080 | Viewport height (100-2160) |
💡 Usage Examples
Basic Usage
GET /api/screenshot?url=https://example.com
Custom Format & Size
GET /api/screenshot?url=https://example.com&format=png&width=1920&height=1080
JavaScript Example
// Get screenshot const response = await fetch('/api/screenshot?url=https://example.com&format=webp'); const imageBlob = await response.blob(); // Display image const img = document.createElement('img'); img.src = URL.createObjectURL(imageBlob); document.body.appendChild(img);
✨ Features
🚀 High Performance
Global edge computing architecture, fast response, stable and reliable
💾 Smart Cache
R2 bucket cache, 7-day cache support, significantly improves access speed
🖼️ Multi-format Support
Supports WebP and PNG formats, WebP is smaller, PNG has better compatibility