Documentation
Everything you need to integrate CaptureAPI into your application. Get started in under 5 minutes.
Quick Start
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.pngBase URL
https://captureapi.dev/api/v1All API endpoints are served over HTTPS. HTTP requests are automatically redirected.
API Endpoints
/api/v1/screenshotScreenshot API
Capture pixel-perfect screenshots of any web page with customizable viewport, format, and timing options.
/api/v1/pdfPDF Generation
Convert HTML content or URLs to PDF documents with full control over page layout, margins, and headers.
/api/v1/ogOG Image Generator
Generate dynamic Open Graph images for social media with customizable templates, themes, and fonts.
/api/auth/registerAuthentication
Learn how to authenticate your API requests, manage your API keys, and understand rate limits.
Response Format
API responses vary by endpoint. Screenshot and OG image endpoints return binary image data by default. PDF endpoints return binary PDF data. All endpoints support a ?json=true query parameter to receive a JSON response with a temporary URL instead.
// JSON response mode
GET /api/v1/screenshot?url=https://example.com&json=true
{
"success": true,
"data": {
"url": "https://cdn.captureapi.dev/captures/abc123.png",
"width": 1280,
"height": 720,
"format": "png",
"size": 245678,
"expiresAt": "2026-03-18T12:00:00Z"
},
"meta": {
"requestId": "req_abc123",
"duration": 1250,
"plan": "pro",
"remaining": 1987
}
}Error Handling
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 | INVALID_PARAMS | Missing or invalid request parameters |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | PLAN_LIMIT | Feature not available on your plan |
| 429 | RATE_LIMIT_EXCEEDED | Monthly or per-second rate limit exceeded |
| 500 | CAPTURE_FAILED | Screenshot or PDF generation failed |
| 504 | TIMEOUT | Page load exceeded the timeout limit |
Rate Limits
Rate limit information is included in every response via headers:
X-RateLimit-Limit: 2000
X-RateLimit-Remaining: 1987
X-RateLimit-Reset: 2026-04-01T00:00:00Z