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.pdf

Authentication

Authenticate your requests using an API key. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

You can also use the X-API-Key header.

API Endpoints

Base URL: https://api.elementsnap.com

POST/v1/pdf/html

Generate PDF from HTML content

POST/v1/pdf/url

Generate PDF from a URL

POST/v1/screenshot/html

Generate screenshot from HTML content

POST/v1/screenshot/url

Generate screenshot from a URL

GET/v1/usage

Get current billing period usage

GET/v1/account

Get account information and API keys

PDF Options

OptionTypeDefaultDescription
formatstring"A4"Page size: A4, Letter, Legal, etc.
landscapebooleanfalsePage orientation
marginobject20px allPage margins (top, right, bottom, left)
printBackgroundbooleantruePrint background colors/images
scalenumber1Scale (0.1 - 2)

Screenshot Options

OptionTypeDefaultDescription
widthnumber1920Viewport width (1-4096)
heightnumber1080Viewport height (1-4096)
fullPagebooleanfalseCapture full scrollable page
typestring"png"Image format: png, jpeg, webp
qualitynumber80JPEG/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 limit
  • X-RateLimit-Remaining - Remaining requests
  • X-RateLimit-Reset - Unix timestamp when limit resets

Ready to get started?

Create your free account and start generating documents today.