Documentation
HTML to Image Documentation
Pick the path that matches what you want to do.
- I want to send my own HTML and get a PNG back. Read the html parameter docs.
- I want a screenshot of an existing URL. Read the url parameter docs.
- I want a pre-designed image with my data slotted in. Browse the templates gallery.
Core sections
Getting Started
The two endpoints, response format, error codes, and a working first request.
Quick Start
The shortest path from a fresh API key to your first rendered PNG, plus how monthly credits work.
Authentication
Generate a key, send it in the X-API-Key header, rotate keys safely.
Parameters Reference
Every parameter the HTML and Screenshot APIs accept. Defaults, ranges, common values.
Examples
Worked code samples for invoices, charts, OG images, calendar events and more.
Template API Reference
The developer reference for every named template: inputs, defaults, response shape, error codes and code samples. (For sample renders and use cases, see the templates gallery.)
Testing & Debugging
Reproduce and inspect errors locally, including validation failures, rate limits and authentication problems.
JavaScript Support
How ms_delay and wait_for_selector let pages finish rendering client-side JavaScript before the screenshot is taken.
Error handling and rate limits
The API uses a consistent error envelope: 422 for validation failures, 401 for missing or invalid keys, 404 for unknown routes or template slugs, and 429 when you exceed your monthly credits or hit the rate limit. The Getting Started guide lists every status code, and the Testing & Debugging guide shows how to reproduce each one.
Pick your language
- HTML to Image in PHP - Plain cURL or Guzzle, integrate in any framework.
- HTML to Image in Laravel - Use the Http facade, queue with jobs, store on any disk.
- HTML to Image in Ruby on Rails - Net::HTTP or Faraday, perfect for ActionMailer attachments.
- HTML to Image in Python - Requests library, async with httpx, drop into any Flask or Django app.
- HTML to Image in JavaScript and Node.js - Native fetch in modern Node, axios for older versions.
- HTML to Image in React - Generate share images on demand, useEffect or server-side.
- HTML to Image in Vue - Composition API ready, works with Nuxt server routes.