Webcap API Documentation

Capture high-quality screenshots of any website with a simple, reliable API. Built-in queueing, retries, and webhooks.

πŸš€ Fast & Reliable

Average response time under 3s

πŸŽ›οΈ Customizable

20+ parameters to control output

πŸ“± Device-true

Mobile & desktop profiles

Base URL

https://api.getwebcap.com

Authentication

Webcap uses API keys. Include your key in the request headers.

Keep your API key secretβ€”never expose it in client-side code.

Header Authentication

Authorization: Bearer YOUR_API_KEY
# or
x-authorization: YOUR_API_KEY

Screenshot API

Capture any public page with sensible defaults and fine-grained control.

POST /screenshot

Request Parameters

Required

ParameterTypeDescription
url REQUIRED string Valid HTTP(S) URL to capture
Content Blocking
block_ads

Block ads (boolean)

block_resources

Block unnecessary resources

block_cookie_banners

Hide cookie banners

block_chat_widgets

Hide chat widgets

Device & Viewport
device

"desktop" | "mobile" (default: desktop)

window_width

200–10000 (default 1920)

window_height

200–10000 (default 1080)

full_page

Capture full page height

Timing & Waiting
timeout

1000–140000 (default 140000)

wait

Extra delay ms

wait_browser

"domcontentloaded" | "load" | "networkidle0"

wait_for

CSS selector to wait for

Image Options
image_type

"png" | "jpeg" (default png)

image_quality

1–100 (jpeg only)

screenshot_selector

Capture a specific element

clip

{x,y,width,height}

Advanced Options
js_code

Run JS before snapshot

cookies

Set cookies

forward_headers

Forward request headers

forward_headers_pure

Forward headers without modification

Response

{
  "url": "https://wikipedia.org",
  "image_url": "https://cdn.getwebcap.com/screenshots/abc123.png",
  "expires_at": "2024-01-15T12:00:00.000Z",
  "error_message": "",
  "total_time": 2341
}
FieldTypeDescription
urlstringCaptured URL
image_urlstringDirect link to image
expires_atstringDeletion timestamp (24h)
error_messagestringError if failed
total_timenumberProcessing time (ms)

Account API

Retrieve credit balance and subscription details.

GET /account

Response

{
  "email": "user@example.com",
  "credits": 142,
  "next_billing_date": "2024-02-01T00:00:00.000Z",
  "plan": "builder"
}
FieldTypeDescription
emailstringAccount email
creditsnumberRemaining credits
next_billing_datestringNext renewal
planstringPlan name

Error Handling

Standard HTTP codes indicate request success or failure.

HTTP Status Codes

CodeDescription
200Success (check success field)
401Unauthorized – invalid/missing key
422Validation error
400Bad request

Error Response Formats

Validation Error (422)

{
  "error": "Validation failed",
  "details": [{ "type": "field","msg": "url must be a valid http(s) URL","path": "url","location": "body"}]
}

Screenshot Error (200 with success: false)

{
  "success": false,
  "error": "Timeout: Page did not load within 140 seconds"
}

Authentication Error (401)

{}

Code Examples

Pick your language and endpoint.

// Node.js (fetch API)
import fetch from "node-fetch";

const url = "https://api.getwebcap.com/screenshot";
const res = await fetch(url, {
  method: "POST",
  headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" },
  body: JSON.stringify({ url: "https://wikipedia.org", window_width:1920, window_height:1080, full_page:true, device:"desktop", block_ads:true, image_type:"png" })
});

if (!res.ok) throw new Error(await res.text());
const data = await res.json();
console.log("Screenshot URL:", data.image_url);

Remember: replace YOUR_API_KEY with the key from your dashboard.

Rate Limits

Limits are enforced per minute by plan.

10
requests / min
Free
50
requests / min
Sandbox
100
requests / min
Builder
100
requests / min
On-demand

Response Headers

HeaderDescription
CREDITSRemaining credits