Guides / Create

Template → PDF

POST /v1/template/render  · 

Handlebars template + JSON data → finished PDF, PNG or HTML. Helpers for German number/date formatting included.

Parameters

NameTypeDescription
templatestring · requiredHandlebars/HTML template.
dataobject · optionalJSON data for the template.
formatstring · optionalpdf (default), png or html.
pdfobject · optionalPage options (format, margin, …).

Example request

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

Example response

HTTP/1.1 200 OK
Content-Type: application/pdf
X-BigAPI-Cost: 1

(rendered PDF body)

Related guides