API文档

将我们的截图服务集成到您的应用程序中

RESTful API JSON Response 200+ Requests/Month Free

Quick Start

1

Get API Access

Sign up for free to get your API key (optional for basic use)

2

Make a Request

Send a POST request with the URL and parameters

3

Get Screenshot

Receive base64 encoded image in JSON response

API Overview

Base URL
https://scrollingscreenshot.com/api
Authentication
API Key (optional for basic use)
Pricing
Free: 200/month · Pro: 3,000+/month

Interactive API Tester

Test our API directly in your browser. No signup required!

Enter any website URL to capture

Test results will appear here

API Endpoints

POST /api/screenshot

Capture a screenshot with parameters in the request body (recommended for complex requests)

Content-Type: application/json
Response: JSON with base64 image
GET /api/screenshot

Capture a screenshot with parameters as query strings (simple requests only)

Parameters: URL query string
Response: JSON with base64 image

Request Parameters

Parameter Type Required Default Description
url string Required - The URL of the webpage to capture
width number Optional 1920 Width of the screenshot in pixels (240-8000)
height number Optional 1080 Height of the screenshot in pixels (240-8000)
fullPage boolean Optional false Capture the entire page (scrolling screenshot)
darkMode boolean Optional false Capture in dark mode
format string Optional png Image format (png, jpeg, webp)
delay number Optional 1 Delay before capturing in seconds (1-15)
scale number Optional 1.0 Scale factor (0.1-1.0)

Code Examples

// 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);
}

Response Examples

Success Response (200 OK)

{
  "success": true,
  "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
  "filename": "example.com_1920x1080.png",
  "url": "blob:https://scrollingscreenshot.com/..."
}

Error Response (400 Bad Request)

{
  "success": false,
  "error": "URL is required",
  "details": "The url parameter is missing or invalid"
}

Best Practices

Use Full Page Wisely

Full page screenshots take longer. Use only when necessary for better performance.

Optimize Image Format

Use WEBP for smaller file sizes, PNG for quality, JPEG for photos.

🔄

Handle Errors Gracefully

Always check the 'success' field and handle errors appropriately.

⏱️

Set Appropriate Delays

Use delays for dynamic content but keep them as short as possible.

Need Help?

Our documentation covers most use cases, but we're here if you need assistance.