将我们的截图服务集成到您的应用程序中
https://scrollingscreenshot.com/api
Test our API directly in your browser. No signup required!
Capture a screenshot with parameters in the request body
Capture a screenshot with parameters as query strings
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
url | string | Yes | - | The URL of the webpage to capture |
width | number | No | 1920 | Width of the screenshot in pixels (240-8000) |
height | number | No | 1080 | Height of the screenshot in pixels (240-8000) |
fullPage | boolean | No | false | Capture the entire page (scrolling screenshot) |
darkMode | boolean | No | false | Capture in dark mode |
format | string | No | png | Image format (png, jpeg, webp) |
delay | number | No | 1 | Delay before capturing in seconds (1-15) |
scale | number | No | 1.0 | Scale factor (0.1-1.0) |
// Using fetch API
const response = await fetch('https://scrollingscreenshot.com/api/screenshot', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com',
width: 1920,
height: 1080,
fullPage: true,
format: 'png'
})
});
const data = await response.json();
if (data.success) {
// Create image element
const img = document.createElement('img');
img.src = data.base64;
document.body.appendChild(img);
}
{
"success": true,
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"filename": "example.com_1920x1080.png",
"url": "blob:https://scrollingscreenshot.com/..."
}
{
"success": false,
"error": "URL is required",
"details": "The url parameter is missing or invalid"
}