Ship document features
in hours, not weeks

A clean REST API with SDKs for Node.js, Python, PHP, and more. Generate PDFs and images from HTML without managing headless browsers, render queues, or infrastructure.

Why developers choose cloudlayer.io

Simple REST API

One POST request with your HTML, template ID, or URL. Get back a PDF or image. No SDKs required — works from any language with HTTP support.

Full Chromium Rendering

Your HTML renders in a real Chromium browser. CSS Grid, Flexbox, custom fonts, JavaScript execution — if it works in Chrome, it works here.

Official SDKs

First-class SDKs for Node.js, Python, PHP, Ruby, and Go. Install from your package manager and start generating in under five minutes.

Webhook Delivery

For large or batch jobs, get results delivered via webhook instead of waiting on a synchronous response. Built for async architectures.

Template Engine

Use Nunjucks templating syntax in your HTML. Loops, conditionals, filters, and partials let you build complex documents from JSON data.

CDN Asset Hosting

Upload fonts, images, and stylesheets to our built-in CDN. Reference them in templates with stable URLs — no CORS issues, no external hosting.

How to integrate

1

Get your API key

Sign up and grab your API key from the dashboard. Each key is scoped to your account with configurable rate limits.

2

Send HTML or a template ID

POST your HTML string, a template ID with JSON data, or a URL to capture. Set output format, page size, and rendering options.

3

Receive your document

Get the generated PDF or image as a binary response, a base64 string, or a webhook delivery. Store it, email it, or serve it to users.

Built for how developers actually work

Every error response returns structured JSON with a machine-readable code, a human-readable message, and a request ID you can send to support. No more guessing what went wrong — every error maps directly to a fix in the docs.

Our SDKs handle retries with exponential backoff out of the box. Rate limit responses include retry-after headers so your code knows exactly when to try again. Configurable limits scale with your plan, and burst support means short spikes never drop requests.

Full TypeScript definitions ship with every SDK — autocomplete for request options, response shapes, and error types. Pass an idempotency key on any request to safely retry without creating duplicate documents. Build with confidence, debug with clarity.

Error Handling

Structured JSON errors with codes, messages, and request IDs. Every error maps to a specific fix in the documentation.

Rate Limits

Generous defaults with burst support. 429 responses include retry-after headers so your code backs off gracefully. Upgrade for higher limits.

SDK Types

Full TypeScript definitions for every SDK. Autocomplete for every option, every response field, and every error type.

Idempotency

Pass an idempotency key to safely retry failed requests without generating duplicate documents. Essential for reliable integrations.

Integration example

Node.js — Generate and save a PDF

Install the SDK from npm, configure it with your API key, and call htmlToPdf() with an HTML string and an options object. The SDK returns a buffer you can write straight to the filesystem with fs.writeFileSync() or stream to S3 via the AWS SDK.

Every option is type-safe — page size, margins, header and footer templates, print background, and landscape mode all autocomplete in your editor. Response metadata includes render time and page count so you can log performance without extra calls.

Python — Template to PDF

Install via pip, initialize the client with your API key, and pass a template ID along with a JSON data payload. The API merges your data into the saved template and returns a base64-encoded PDF that you can decode and attach to an outbound email via SendGrid or save to cloud storage.

For high-volume workflows, use the async client to fire off batch requests without blocking. Each call accepts the same options — page size, margins, and rendering flags — so switching between sync and async requires no code changes beyond the client import.

5 min
Integration Time
Average time to first document
6
SDK Languages
Node, Python, PHP, Ruby, Go, C#
<200ms
API Latency
Request to response start

Get your API key
and ship

Full API access from day one. SDKs for Node.js, Python, PHP, Ruby, Go, and C#. First 100 documents free.

No commitment. Cancel anytime.