API Documentation

Authentication

All API requests must include your API key in the Authorization header using the Bearer token scheme.

Authorization: Bearer YOUR_API_KEY

Screenshot API

Endpoint: POST /v1/screenshot

Capture pixel-perfect screenshots of any public website.

Parameters (JSON Body)

ParameterTypeDefaultDescription
urlstring(Required)The full URL of the website to capture.
fullPagebooleanfalseWhether to capture the entire scrolling page.
widthnumber1280Viewport width in pixels.
heightnumber800Viewport height in pixels.
waitFornumber0Wait X milliseconds before capture.
blockAdsbooleanfalseAttempt to block known ad and tracker domains.
headersobjectnull(Business Tier) Dictionary of custom HTTP headers to send with the request.
cookiesarraynull(Business Tier) Array of cookie objects (e.g. [{"name": "session", "value": "123"}]).

Example Request

curl -X POST https://api.snapsly.dev/v1/screenshot \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "fullPage": true, "darkMode": true}'

Example Response

Returns binary image/png

PDF API

Endpoint: POST /v1/pdf

Convert websites to PDF documents.

Parameters (JSON Body)

ParameterTypeDefaultDescription
urlstring(Required)The full URL of the website to capture.
formatstring"A4"Paper format (e.g., A4, Letter).
printBackgroundbooleantrueInclude background graphics.
marginstring"0"Margins in CSS units (e.g., "1cm", "0.5in").

Example Request

curl -X POST https://api.snapsly.dev/v1/pdf \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "format": "Letter"}'

OG Image API

Endpoint: POST /v1/og

Generate dynamic Open Graph images from templates.

Parameters (JSON Body)

ParameterTypeDefaultDescription
templatestring(Required)Name of the template (e.g., "article", "product").
dataobject(Required)Key-value pairs corresponding to template fields.

Example Request

curl -X POST https://api.snapsly.dev/v1/og \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "template": "article", "data": { "title": "Building a Screenshot API", "author": "Snapsly Team", "date": "Oct 24, 2023" } }'

Custom Templates

If you'd like to use your own HTML, you can pass "template": "custom" and provide a customHtml field inside data. We use Handlebars for templating, so you can inject variables using {{varName}}.

{ "template": "custom", "data": { "customHtml": "<html><body style='background: {{bgColor}};'><h1>{{title}}</h1></body></html>", "title": "My Custom Card", "bgColor": "#ff0000" } }

Batch API (Pro & Business)

Endpoint: POST /v1/batch

Process multiple screenshots or PDFs in a single API call concurrently. Ideal for bulk scraping or processing.

Parameters (JSON Body)

ParameterTypeDefaultDescription
requestsarray(Required)An array of up to 25 capture objects. Each object must have a type ("screenshot" or "pdf") and any standard parameters for that type.

Example Request

curl -X POST https://api.snapsly.dev/v1/batch \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "requests": [ { "type": "screenshot", "url": "https://example.com", "fullPage": true }, { "type": "pdf", "url": "https://example.org", "format": "A4" } ] }'

Example Response

{ "results": [ { "index": 0, "status": "success", "url": "/captures/c1b2.png" }, { "index": 1, "status": "success", "url": "/captures/d3e4.pdf" } ] }

AI Mode (Pro & Business)

For the Screenshot API, include "mode": "ai" in your JSON body to return a JSON response containing both a hosted screenshot URL and extracted page metadata optimized for LLMs.

AI Mode forces JPEG capture at 60% quality (token-efficient) and extracts bounding boxes for interactable elements (buttons, inputs, links) to help vision models map the UI.

Example Request

curl -X POST https://api.snapsly.dev/v1/screenshot \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "mode": "ai"}'

Example Response

{ "metadata": { "title": "Example Domain", "description": "This domain is for use in illustrative examples...", "headings": ["Example Domain"], "links": ["https://www.iana.org/domains/example"], "wordCount": 28, "elements": [ { "tag": "a", "text": "More information...", "bounds": { "x": 100, "y": 250, "width": 120, "height": 30 } } ] }, "screenshot_url": "/captures/abc123.jpeg" }

No-Code Integrations

Snapsly is built to integrate seamlessly with no-code automation tools like Zapier, Make.com, and Retool.

To get started instantly, you can import our OpenAPI Specification directly into your platform of choice to automatically generate the API actions.

Download OpenAPI Spec

Make.com

Use the "Make an API Call" HTTP module or the "Make a Custom App" builder, upload the openapi.yaml, and input your API key.

Zapier

Use the "Webhooks by Zapier" action and select "Custom Request", or build a private integration via the Zapier Developer Platform using the OpenAPI spec.

Rate Limits

Rate limits are based on your current billing plan. When you exceed your monthly allowance, the API will return a 429 Too Many Requests error.

  • Free: 200 captures / month
  • Starter: 3,000 captures / month
  • Pro: 10,000 captures / month
  • Business: 30,000 captures / month

Error Handling

The API uses standard HTTP status codes to indicate success or failure.

CodeMeaningDescription
200OKThe request was successful.
400Bad RequestMissing required parameters or invalid formatting.
401UnauthorizedMissing, invalid, or revoked API key.
429Too Many RequestsMonthly quota exceeded.
500Internal ErrorSomething went wrong on our end during capture.