Screenshot API: Automated Website Screenshots with Browser Automation
Screenshot API with interactive browser automation. Capture websites, click buttons, fill forms, crop areas. 600 free screenshots/month with Make.com & n8n integration.
If you need to generate website screenshots for previews, monitoring, QA, or automation workflows, you’ll quickly end up comparing three approaches: Puppeteer, Playwright, or a managed Screenshot API (like CustomJS).
They can all produce high-quality images, but they differ massively in operational overhead, scaling, reliability in CI, and total cost of ownership.
In this guide, you’ll get a practical comparison with copy-paste code examples, a feature matrix, and a “what to choose” decision framework.
| Feature | Puppeteer | Playwright | CustomJS Screenshot API |
|---|---|---|---|
| Setup time | Medium | Medium | Low |
| Infra & scaling | You run it | You run it | Managed |
| Browser engines | Chromium | Chromium, Firefox, WebKit | API abstraction (common screenshot use cases) |
| Interactive automation | Yes | Yes | Yes (commands) |
| No-code modules | No | No | Make.com, n8n |
| Best for | Chrome automation on your infra | Cross-browser testing + automation | Shipping screenshots fast, low ops |
The fastest way to avoid “it works locally but fails in CI” issues is to use a tool that makes browser actions explicit: wait conditions, cookie banner clicks, scrolling, and cropping.
Use the widget below to build a screenshot request (including interactions) and get ready-to-use API code.
Try a URL that has a cookie banner. Add a click, add a wait, then crop a region.
The widget uses our Native API. For the full request/response schema and endpoint details, see Native API documentation.
Puppeteer is a Node.js library that controls Chromium. It’s excellent when you already operate Node services and want full control, but you also inherit all responsibility: browser updates, concurrency limits, timeouts, CPU spikes, and flaky rendering.
const puppeteer = require('puppeteer');
async function screenshotWithPuppeteer(url) {
const browser = await puppeteer.launch({
headless: 'new'
});
try {
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 720 });
await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });
// Example: click cookie banner (update selector for your site)
// await page.click('#accept-cookies');
await page.waitForTimeout(500);
await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
await browser.close();
}
}
screenshotWithPuppeteer('https://example.com');Operational note: in real systems you usually do not launch a new browser per request. You keep a browser pool or a worker queue. That’s where complexity starts.
Playwright provides a robust API, great tooling, and multi-browser automation. If you must test and screenshot with browser parity (Chromium/Firefox/WebKit), Playwright is usually the strongest self-hosted option.
const { chromium } = require('playwright');
async function screenshotWithPlaywright(url) {
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
// Example: wait for a selector to appear
// await page.waitForSelector('main');
await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
await browser.close();
}
}
screenshotWithPlaywright('https://example.com');With a managed API, you trade direct browser control for speed of integration and lower ops. You simply send a request with the URL and optional commands (click, type, wait, scroll, crop).
curl -X POST 'https://e.customjs.io/screenshot' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"input": {
"url": "https://example.com",
"commands": []
}
}' \
> screenshot.pngconst axios = require('axios');
const fs = require('fs');
async function screenshotWithCustomJS(url) {
const response = await axios.post(
'https://e.customjs.io/screenshot',
{
input: {
url,
commands: []
}
},
{
headers: {
'x-api-key': process.env.CUSTOMJS_API_KEY,
'Content-Type': 'application/json'
},
responseType: 'arraybuffer'
}
);
fs.writeFileSync('screenshot.png', response.data);
}
screenshotWithCustomJS('https://example.com');To add interactions (cookie clicks, waits, scrolling) use the visual builder above and copy the generated command list.
Public benchmarks for screenshot generation are often misleading because latency depends heavily on:
In practice, the “winner” is usually the approach that gives you consistent results with minimal operational burden.
The biggest hidden cost of Puppeteer/Playwright isn’t the library—it’s everything around it:
If screenshot generation is a core competency for your business, self-hosting can be right. If it’s an enabling feature, a managed API usually wins.
For many teams the screenshot itself is just a step inside an automation:
If you’re already working in Make.com or n8n, native modules dramatically reduce setup time compared to running Node workers and managing browser containers.
In many real-world cases the difference is negligible compared to network latency and page complexity. Choose based on browser support, reliability, and operational fit.
Yes. With self-hosted tools you write automation steps; with CustomJS you send commands (or use the visual builder to generate them).
All approaches support it. Be careful with long pages and lazy loading: you typically need scroll/wait strategies.
See Native API documentation for details.
Puppeteer and Playwright are excellent tools when you want maximum control and can operate browser automation infrastructure.
If you want to ship a screenshot feature quickly—with low maintenance and easy automation via Make.com and n8n—a managed Screenshot API is usually the most pragmatic choice.
Start free with 600 screenshots per month
Continue reading on similar topics
Screenshot API with interactive browser automation. Capture websites, click buttons, fill forms, crop areas. 600 free screenshots/month with Make.com & n8n integration.
Generate automated social media screenshots and dynamic OG images from HTML templates. Includes API examples and Make.com/n8n automation workflows.
A deep dive into the top 5 screenshot APIs for 2025, comparing features, pricing, and performance to help you choose the best one.