Node.js
Screenshot API for Node.js
No Puppeteer in your dependency tree, no Chromium in your container image, no memory ceiling to babysit.
screenshot api nodejs · request and resultPAGECAPTURE / 01
Node.js
import { writeFile } from "node:fs/promises";
export async function capture(url: string) {
const response = await fetch("https://api.pagecapture.dev/v1/take", {
method: "POST",
headers: {
"X-Access-Key": process.env.PAGECAPTURE_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({ url, format: "png", full_page: true }),
});
if (!response.ok) {
const { error_code, error_message } = await response.json();
throw new Error(`${error_code}: ${error_message}`);
}
await writeFile("shot.png", Buffer.from(await response.arrayBuffer()));
}Capture result
succeededhttps://example.com
Noma
Shop nowNEW COLLECTION
Objects for slower mornings.
Thoughtful essentials, made in small batches from natural materials.
Explore the collectionOur materials
No. 01 · Hinoki
PLANT-BASEDMADE IN SMALL BATCHESREFILLABLE
- Artifact
- PNG · 1440×900
- Billing
- 1 credit
- Engine
- stable
Just fetch
Node 18+ has everything you need. No native modules, no post-install browser download.
Smaller images
A Chromium layer is roughly 300 MB of container image you stop shipping.
Typed errors
Stable error codes are easy to model as a union type and exhaustively handle.
Serverless friendly
Async mode with a webhook keeps you inside a short function timeout.
Pricing
One credit per successful capture. Failures and cache hits are free.
Related
Screenshot API
A screenshot API that returns the file, not a job to poll
Python
Screenshot API for Python
HTML to image
Render your own HTML into an image
Ready to try it against your own page?
Try it free — no signup