API Documentation
Everything you need to integrate ElementSnap into your application.
Quick Start
Get started with ElementSnap in under 5 minutes. All you need is an API key.
Generate your first PDF
curl -X POST https://api.elementsnap.com/v1/pdf/html \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<html><body><h1>Hello World</h1></body></html>"
}' \
--output document.pdfAuthentication
Authenticate your requests using an API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEYYou can also use the X-API-Key header.
API Endpoints
Base URL: https://api.elementsnap.com
POST
/v1/pdf/htmlGenerate PDF from HTML content
POST
/v1/pdf/urlGenerate PDF from a URL
POST
/v1/screenshot/htmlGenerate screenshot from HTML content
POST
/v1/screenshot/urlGenerate screenshot from a URL
GET
/v1/usageGet current billing period usage
GET
/v1/accountGet account information and API keys
PDF Options
| Option | Type | Default | Description |
|---|---|---|---|
| format | string | "A4" | Page size: A4, Letter, Legal, etc. |
| landscape | boolean | false | Page orientation |
| margin | object | 20px all | Page margins (top, right, bottom, left) |
| printBackground | boolean | true | Print background colors/images |
| scale | number | 1 | Scale (0.1 - 2) |
Screenshot Options
| Option | Type | Default | Description |
|---|---|---|---|
| width | number | 1920 | Viewport width (1-4096) |
| height | number | 1080 | Viewport height (1-4096) |
| fullPage | boolean | false | Capture full scrollable page |
| type | string | "png" | Image format: png, jpeg, webp |
| quality | number | 80 | JPEG/WebP quality (0-100) |
Rate Limits
Rate limits are based on your subscription plan. Headers are included in every response:
X-RateLimit-Limit- Your plan's monthly limitX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Unix timestamp when limit resets
Ready to get started?
Create your free account and start generating documents today.