ToolsXpo

Networking

Website Screenshot API

GET request to /v1/screenshot, returning json in the standard envelope.

GET/v1/screenshot40 credits / call Paid

Authentication

Send your API key as a bearer token. Create one free in the dashboard.

Authorization: Bearer $TOOLSXPO_KEY

Parameters

Sent as query-string parameters. The values below are the examples used throughout this page.

NameExample value
urlhttps://example.com
fullPagefalse
formatpng
width1280
height800

Example request

curl "https://api.toolsxpo.com/v1/screenshot?url=https%3A%2F%2Fexample.com&fullPage=false&format=png&width=1280&height=800" \
  -H "Authorization: Bearer $TOOLSXPO_KEY"

Response

Every endpoint answers with the same envelope. The result is in data (json); meta.credits reports what the call cost.

{
  "ok": true,
  "data": { /* json */ },
  "meta": { "credits": 40 }
}

Errors

Failures use the same envelope with ok: false and a machine-readable code.

StatusCodeMeaning
400invalid_inputA parameter failed validation. `details` lists which.
401unauthorizedMissing or invalid API key.
402quota_exceededOut of credits on this workspace.
404not_foundNo such tool.
429rate_limitedToo many requests. Retry after `Retry-After` seconds.
503service_unavailableTemporarily disabled by an administrator.

How to use the Screenshot API

Capture a pixel-perfect PNG or JPEG of any public web page. A real headless browser loads the URL, waits for it to render, and returns the image base64-encoded inside the JSON envelope (the API is JSON-only) — so you decode data.base64 to get the file.

Options that matter

  • fullPagefalse (default) captures just the viewport; true captures the entire scrollable page. Use true for long articles, false for above-the-fold previews and social cards.
  • formatpng for crisp UI/text (lossless), jpeg for photo-heavy pages and smaller payloads.
  • width / height — the viewport, in pixels. Set a mobile width (e.g. 390) to capture responsive layouts.

Turning the result into a file

JAVASCRIPT
const res = await fetch(
  "https://api.toolsxpo.com/v1/screenshot?url=https://example.com&fullPage=true",
  { headers: { Authorization: `Bearer ${process.env.TOOLSXPO_KEY}` } },
);
const { data } = await res.json();
// Node: write it to disk
import { writeFileSync } from "node:fs";
writeFileSync("shot.png", Buffer.from(data.base64, "base64"));
// Browser: embed it directly
img.src = `data:${data.contentType};base64,${data.base64}`;

Tips & gotchas

  • Pages behind a login or a hard bot-wall can't be captured — the browser sees what an anonymous visitor sees.
  • Very heavy pages may take a few seconds; the call waits for render, so budget for it in your own timeouts.
  • This is a paid tool (it runs a real browser). Any credit purchase or plan unlocks it.