Skip to main content

Integration guide

n8n integration guide

Use n8n's HTTP Request node to call htmltoany and receive image or PDF binaries. A good starting pattern is one API key per workflow group or per environment.

Image example

POST /api/v1/image
x-api-key: YOUR_API_KEY
content-type: application/json

{
  "html": "<div><h1>{{$json.title}}</h1></div>",
  "css": "h1{color:#111827}",
  "width": 1200,
  "height": 630,
  "format": "png"
}

PDF example

POST /api/v1/pdf
Authorization: Bearer YOUR_API_KEY
content-type: application/json

{
  "html": "<main><h1>Invoice {{$json.invoiceNumber}}</h1></main>",
  "format": "A4",
  "printBackground": true
}

Troubleshooting

  • 401: check key header and key status
  • 413: reduce HTML or CSS payload size
  • 429: inspect dashboard quota and recent request logs
  • 500: validate HTML/CSS and increase wait time if the page is dynamic