Everything you need to integrate CaptureAPI into your application. Get started in under 5 minutes.
Register with your email to get a free API key instantly.
Pass your API key in the header and the target URL as a parameter.
Receive PNG, PDF, or JSON response in under 2 seconds.
Follow these four steps to start capturing screenshots, generating PDFs, and creating OG images:
# 1. Get your free API key
curl -X POST https://captureapi.dev/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com"}'
# Response: {"apiKey": "cap_abc123...", "plan": "free"}
# 2. Take your first screenshot
curl "https://captureapi.dev/api/v1/screenshot?url=https://example.com" \
-H "X-API-Key: cap_abc123..." \
-o screenshot.png
# 3. Generate a PDF
curl -X POST "https://captureapi.dev/api/v1/pdf" \
-H "X-API-Key: cap_abc123..." \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
-o page.pdf
# 4. Create an OG image
curl "https://captureapi.dev/api/v1/og?title=Hello+World&theme=dark" \
-H "X-API-Key: cap_abc123..." \
-o og-image.pnghttps://captureapi.dev/api/v1All API endpoints are served over HTTPS. HTTP requests are automatically redirected.
/api/v1/screenshotCapture pixel-perfect screenshots of any web page with customizable viewport, format, and timing options.
/api/v1/batchCapture up to 10 URLs in one request, or loop the single endpoint for hundreds. Includes the time-budget and not_processed contract.
/api/v1/pdfConvert HTML content or URLs to PDF documents with full control over page layout, margins, and headers.
/api/v1/ogGenerate dynamic Open Graph images for social media with customizable templates, themes, and fonts.
/api/auth/registerLearn how to authenticate your API requests, manage your API keys, and understand rate limits.
Evaluating CaptureAPI against other screenshot and PDF providers? See our comparison of pricing, features, and EU data residency.
API responses vary by endpoint. GET /v1/screenshot and the OG image endpoint return binary image data; POST /v1/pdf returns binary PDF.GET /v1/screenshot also accepts ?json=true, which returns the image inline as a base64 data URL together with everything we know about the capture. We do not host captures, so there is no temporary URL to hand you — the bytes come back in the response.
// JSON response mode
GET /api/v1/screenshot?url=https://example.com&json=true
{
"success": true,
"data": {
"image": "data:image/png;base64,iVBORw0KGgo...",
"width": 1280,
"height": 720,
"format": "png",
"fullPage": false,
"size": 245678,
"truncated": false,
"page_height": null
},
"meta": {
"requestId": "req_abc123",
"duration": 1250,
"plan": "pro",
"remaining": 1987,
"degraded": false,
"overlays_hidden": ["#onetrust-banner-sdk"],
"ignored_params": []
}
}All errors return a consistent JSON structure with an error code and human-readable message:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Monthly request limit exceeded. Upgrade your plan for more requests.",
"status": 429
}
}| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_FAILED | A parameter failed validation. The message names the field. |
| 400 | INVALID_PARAMS | Missing or invalid request parameters, or a URL our SSRF guard refuses |
| 400 | URL_UNREACHABLE | The target URL could not be reached — DNS failure, refused connection, or a typo |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | PLAN_LIMIT | Feature not available on your plan |
| 413 | RESPONSE_BUDGET_EXCEEDED | Batch only: this image did not fit in the response. Capture it on GET /v1/screenshot. |
| 422 | SELECTOR_NOT_FOUND | No element matched your selector |
| 429 | RATE_LIMIT_EXCEEDED | Monthly or per-second rate limit exceeded |
| 500 | CAPTURE_FAILED | A genuine failure in our render engine. This one is ours. |
| 502 | TARGET_RENDERED_NOTHING | The page loaded but painted nothing, so the image would have been blank. Usually a site that blocks automated browsers. |
| 503 | CAPTURE_BUSY | Render capacity is momentarily full — retry after the seconds given in Retry-After |
| 503 | ENGINE_UNAVAILABLE | Our rendering engine could not start. This is on our side, not your URL — retry shortly |
| 504 | CAPTURE_TIMEOUT | The page never rendered within the navigation budget |
Rate limit information is included in every response via headers:
X-RateLimit-Limit: 15000
X-RateLimit-Remaining: 14987
X-RateLimit-RetryAfter: 3600 # only on a 429, in seconds