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:

Quick Start Guide
# 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.png

Base URL

https://captureapi.dev/api/v1

All API endpoints are served over HTTPS. HTTP requests are automatically redirected.

API Endpoints

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
// 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 Response
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Monthly request limit exceeded. Upgrade your plan for more requests.",
    "status": 429
  }
}
StatusCodeDescription
400INVALID_PARAMSMissing or invalid request parameters
401UNAUTHORIZEDMissing or invalid API key
403PLAN_LIMITFeature not available on your plan
429RATE_LIMIT_EXCEEDEDMonthly or per-second rate limit exceeded
500CAPTURE_FAILEDScreenshot or PDF generation failed
504TIMEOUTPage load exceeded the timeout limit

Rate Limits

Rate limit information is included in every response via headers:

Rate Limit Headers
X-RateLimit-Limit: 2000
X-RateLimit-Remaining: 1987
X-RateLimit-Reset: 2026-04-01T00:00:00Z