{
  "openapi": "3.1.0",
  "info": {
    "title": "HTML Render",
    "version": "1.0.0",
    "description": "HTML to PDF, PNG, JPEG or WebP with headless Chromium: full CSS, web fonts and JavaScript.\n\nConvert HTML into a PDF, PNG, JPEG or WebP with one POST, rendered by headless Chromium so CSS, web fonts and JavaScript work as in a browser. Built for invoices, reports, certificates and screenshots.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/html-render-api.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/html-render"
  },
  "servers": [
    {
      "url": "https://html-render.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Utilities",
      "description": "HTML Render belongs to the Utilities category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/v1/convert": {
      "post": {
        "operationId": "convertHtml",
        "summary": "Convert HTML",
        "description": "Convert HTML endpoint of the HTML Render. Costs 10 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/html-render/convert-html"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "html": "<html><body><h1>Invoice #2025-001</h1><table><tr><th>Description</th><th>Qty</th><th>Total</th></tr><tr><td>HTML to PDF Conversion</td><td>10</td><td>$0.50</td></tr><tr><td>HTML to PNG Rendering</td><td>8</td><td>$0.32</td></tr><tr><td>Custom Branding</td><td>1</td><td>$4.99</td></tr></table><p>Total Due: $5.81</p></body></html>",
                "format": "pdf",
                "options": {
                  "format": "A4",
                  "printBackground": true,
                  "margin": {
                    "top": "20px",
                    "right": "20px",
                    "bottom": "20px",
                    "left": "20px"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 10 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}