Documentation

Everything you need to integrate the Capture API into your application.

Quick Start

1. Get your API key
Sign up for a free account to get your API key
2. Make your first request
Use your API key to capture a screenshot
curl -X POST https://api.capture.dev/v1/screenshot \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"url": "https://example.com", "format": "png"}'

Authentication

All API requests require authentication using your API key. Include it in the request header:

X-API-Key: cap_live_your_api_key

# Or use Bearer token format:
Authorization: Bearer cap_live_your_api_key

API Endpoints

POST/v1/screenshot
Capture a URL as an image

Request body:

{
  "url": "https://example.com",
  "format": "png",
  "width": 1200,
  "height": 630
}
POST/v1/render
Render HTML/CSS to an image

Request body:

{
  "html": "<div>Hello {{name}}</div>",
  "css": "div { color: blue; }",
  "variables": { "name": "World" },
  "width": 1200,
  "height": 630
}
POST/v1/templates
Create a reusable template

Request body:

{
  "name": "Social Card",
  "html": "<div class='card'>{{title}}</div>",
  "css": ".card { padding: 40px; }",
  "variables": { "title": "string" }
}
POST/v1/templates/:id/render
Render a saved template

Request body:

{
  "variables": { "title": "My Post" }
}

Response Format

Successful Response
{
  "id": "job_abc123",
  "status": "completed",
  "url": "https://captures.capture.dev/abc123.png",
  "width": 1200,
  "height": 630,
  "format": "png",
  "size": 124532,
  "duration": 1234
}
Error Response
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid URL format"
  }
}

Rate Limits

Rate limits vary by plan. The current limits are included in response headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1704067200

Need Help?