Networking
Website Screenshot API
GET request to /v1/screenshot, returning json in the standard envelope.
GET
/v1/screenshot40 credits / call PaidAuthentication
Send your API key as a bearer token. Create one free in the dashboard.
Authorization: Bearer $TOOLSXPO_KEYParameters
Sent as query-string parameters. The values below are the examples used throughout this page.
| Name | Example value |
|---|---|
| url | https://example.com |
| fullPage | false |
| format | png |
| width | 1280 |
| height | 800 |
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.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_input | A parameter failed validation. `details` lists which. |
| 401 | unauthorized | Missing or invalid API key. |
| 402 | quota_exceeded | Out of credits on this workspace. |
| 404 | not_found | No such tool. |
| 429 | rate_limited | Too many requests. Retry after `Retry-After` seconds. |
| 503 | service_unavailable | Temporarily 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
fullPage—false(default) captures just the viewport;truecaptures the entire scrollable page. Usetruefor long articles,falsefor above-the-fold previews and social cards.format—pngfor crisp UI/text (lossless),jpegfor 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
JAVASCRIPTconst 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.