Skip to main content
Screenshotly’s batch capture feature lets you capture screenshots of multiple URLs in a single request, with shared settings applied to all URLs.

Basic batch request

const result = await client.captureBatch({
  urls: [
    'https://example.com',
    'https://google.com',
    'https://github.com'
  ],
  options: {
    format: 'png',
    viewport_width: 1280,
    viewport_height: 800,
    full_page: true
  }
});

if (result.success) {
  console.log(`Succeeded: ${result.succeededCount}, Failed: ${result.failedCount}`);
  console.log('Remaining credits:', result.remainingCredits);
}

Response format

The batch response includes individual results for each URL and summary counts:
{
  "success": true,
  "data": [
    {
      "_id": "67b8a1c2d3e4f5a6b7c8d9e0",
      "url": "https://example.com",
      "status": "pending"
    },
    {
      "_id": "67b8a1c2d3e4f5a6b7c8d9e1",
      "url": "https://google.com",
      "status": "pending"
    }
  ],
  "count": 2,
  "succeededCount": 2,
  "failedCount": 0,
  "remainingCredits": 4998
}
Batch screenshots are processed asynchronously via a background queue. Use the screenshot status endpoint or webhooks to track completion.

Limits

  • Maximum 50 URLs per batch request
  • The API validates that you have enough monthly credits for the entire batch before processing
  • If you don’t have enough credits, the entire request is rejected

Shared options

All options passed in the options object apply to every URL in the batch. Supported options are the same as the capture endpoint:
OptionTypeDefaultDescription
formatstringpngOutput format (png, jpeg, webp, pdf)
viewport_widthinteger1280Viewport width in pixels
viewport_heightinteger1024Viewport height in pixels
full_pagebooleanfalseCapture full scrollable page
delayinteger0Delay in milliseconds
device_scale_factornumber1Device pixel ratio

Handling large batches

For more than 50 URLs, break them into chunks:
const allUrls = [/* hundreds of URLs */];
const chunkSize = 50;

for (let i = 0; i < allUrls.length; i += chunkSize) {
  const chunk = allUrls.slice(i, i + chunkSize);
  const result = await client.captureBatch({
    urls: chunk,
    options: { format: 'png', viewport_width: 1280 }
  });

  console.log(`Batch ${Math.floor(i / chunkSize) + 1}: ${result.succeededCount} queued, ${result.failedCount} failed`);
}

Credits

Each URL in a batch consumes one screenshot credit. A batch of 10 URLs uses 10 credits. Failed captures are automatically refunded. See the batch capture API reference for full endpoint details.