Generate documents from data: Handlebars template + JSON to a finished PDF, PNG or HTML — invoices, reports, certificates. German helpers formatNumber and formatDate included.
curl -X POST https://api.bigapi.dev/v1/template/render -H 'Authorization: Bearer $KEY' -H 'Content-Type: application/json' -d '{"template":"<h1>{{title}}</h1>","data":{"title":"Report"}}' -o out.pdf
New keys come with 100 free operations, no signup: curl -X POST https://api.bigapi.dev/v1/keys. Failed calls cost nothing.
| Name | Meaning |
|---|---|
template required | HTML with Handlebars placeholders such as {{customer.name}} or {{#each items}} … {{/each}}; filled with data and printed. {{x}} escapes HTML, {{{x}}} inserts it raw. Helpers: {{formatNumber amount 2}} gives 1.234,50 (German format, 2 decimals), {{formatDate date}} gives 6.10.2026. An unknown helper returns 400 template_compile_failed. |
data | JSON values for the placeholders in template. A placeholder without a value stays empty; the response lists such names in X-BigAPI-Warnings (missing_values). Default: empty object |
format | pdf for a document, png for an image, html for the filled page without printing. Allowed: pdf, png, htmlDefault: "pdf" |
pdf | Page setup for PDF output, same options as render: format (A4, Letter …), landscape, margin, printBackground, scale. Default: A4 portrait, margins 20 mm top and bottom and 18 mm left and right |
Returns application/pdf | image/png | text/html. Response headers carry the cost (X-BigAPI-Cost) and notes about your input (X-BigAPI-Warnings).
Connect BiGapi as an MCP server: https://api.bigapi.dev/mcp (hosted) or npx -y @bigapi/mcp (local). Then ask in plain words; the agent finds template_render on its own.