Skip to content
JavaScript / TypeScript

JavaScript Screenshot API for Node.js, Browser Automation, and PDF

Integrate web capture into any Node.js application — Express, Next.js, Fastify, serverless functions, or CLI tools. Capture screenshots, generate PDFs, record videos, and extract HTML. Fully typed with TypeScript support.

What you can build

Server-side rendering checks

Verify SSR output, OG images, and meta tags by capturing the rendered page from 80+ countries.

Authenticated pages

Automate login flows with click, type, and navigate steps before the capture — no Puppeteer scripts needed.

PDF generation

Convert any web page to a formatted PDF with paper size, margin, and landscape controls — one API call from Node.js.

CI/CD visual snapshots

Capture visual baselines in your GitHub Actions or Jenkins pipeline and store results in S3 or Google Drive.

What the API handles for you

Every output format

PNG, JPEG, WebP, full-page PDF, raw HTML, and video screencasts from one endpoint.

Automation steps

Click, type, scroll, navigate, and wait before capture — handle logins, cookie banners, and dynamic content.

80+ country routing

Render geo-gated pages from real browsers in any target country.

14+ app integrations

Deliver results to S3, Google Drive, Dropbox, Slack, and more — no upload code needed.

Batch & crawl

Capture entire sitemaps or crawl domains with built-in retries and progress tracking.

On-premise browsers

Run browser clients inside your network for compliance or latency requirements.

Installation

terminal
npm install screenshotcenter
Available on npmnpmjs.com/package/screenshotcenter

Quick start

index.mjs
import { ScreenshotCenterClient } from 'screenshotcenter';

const client = new ScreenshotCenterClient({ apiKey: 'YOUR_API_KEY' });

// Request a screenshot and wait for it to finish
const screenshot = await client.screenshot.create({ url: 'https://example.com' });
const result = await client.waitFor(screenshot.id);

console.log(result.status);       // 'finished'
console.log(result.storage_url);  // S3 URL

More examples

Capture pleine page dans un pays donné
import { ScreenshotCenterClient } from 'screenshotcenter';

const client = new ScreenshotCenterClient({ apiKey: 'YOUR_API_KEY' });

const screenshot = await client.screenshot.create({
  url: 'https://example.com',
  size: 'page',        // capture the full scrollable page
  country: 'fr',       // route through a French browser client
  language: 'fr-FR',
  timezone: 'Europe/Paris',
});

const result = await client.waitFor(screenshot.id);
await client.screenshot.saveImage(result.id, './output/fr-full.png');
Générer un PDF
import { ScreenshotCenterClient } from 'screenshotcenter';

const client = new ScreenshotCenterClient({ apiKey: 'YOUR_API_KEY' });

const screenshot = await client.screenshot.create({
  url: 'https://example.com/report',
  pdf: true,
  pdf_landscape: true,
  pdf_format: 'A4',
});

const result = await client.waitFor(screenshot.id);
await client.screenshot.savePDF(result.id, './output/report.pdf');
Gestion des erreurs
import {
  ScreenshotCenterClient,
  ApiError,
  TimeoutError,
  ScreenshotFailedError,
} from 'screenshotcenter';

const client = new ScreenshotCenterClient({ apiKey: 'YOUR_API_KEY' });

try {
  const screenshot = await client.screenshot.create({ url: 'https://example.com' });
  const result = await client.waitFor(screenshot.id, { timeout: 60_000 });
} catch (err) {
  if (err instanceof ApiError) {
    console.error('API error ' + err.status + ': ' + err.message);
  } else if (err instanceof TimeoutError) {
    console.error('Timed out for screenshot ' + err.screenshotId);
  } else if (err instanceof ScreenshotFailedError) {
    console.error('Screenshot failed: ' + err.screenshotError);
  }
}
Crawl de site web
const crawl = await client.crawl.create('https://example.com', 'example.com', 100);
const result = await client.crawl.waitFor(crawl.id);
console.log(result.total_discovered);  // pages found
console.log(result.screenshots);       // screenshot list

Resources

Frequently asked questions

Is this a Puppeteer replacement?

For screenshot, PDF, and video capture — yes. ScreenshotCenter manages the browser fleet, retries, and scaling. You just call the API.

Does it work with TypeScript?

Yes. The SDK ships with full TypeScript type definitions out of the box.

Can I use it in serverless functions?

Absolutely. The SDK makes a simple HTTP call — there are no browser binaries to bundle. It works in AWS Lambda, Vercel, Cloudflare Workers, and any Node.js runtime.

How do I capture a page behind a login?

Pass automation steps to click through login forms, wait for redirects, and capture the authenticated page — all in one API request.

Related

Start capturing with JavaScript / TypeScript today

Get 500 captures on the free trial — no credit card required. Install the SDK and take your first screenshot in minutes.