{
  "openapi": "3.1.0",
  "info": {
    "title": "Printwren API",
    "version": "1.0.0",
    "summary": "Free HTML to PDF API, URL to PDF converter and MCP server: real Chrome printing with paper size, margins, backgrounds and page numbers. GET a PDF back or JSON with base64.",
    "description": "Paste a URL or send your HTML and get a PDF printed by real Chrome: A4 or Letter, margins, backgrounds and page numbers. For invoices, reports, receipts and saving pages. Free, no key.\n\nFree tier: 4 PDFs per minute per IP address, one document per call. HTML up to 200 KB; public http(s) pages only. About 25 seconds per document at most. Shared free renderer: if it is busy you get a clear 503, try again a minute later. Free, no key, no sign-up. Nothing is stored: the PDF is made on each call. No key needed. Remote MCP server: https://printwren.cybermax-tools.workers.dev/mcp",
    "contact": {
      "name": "CyberMax",
      "url": "https://cybermax-tools-cybermax.static.hf.space/"
    },
    "license": {
      "name": "Proprietary (free to call)",
      "identifier": "LicenseRef-CyberMax"
    }
  },
  "servers": [
    {
      "url": "https://printwren.cybermax-tools.workers.dev"
    }
  ],
  "paths": {
    "/api/pdf": {
      "get": {
        "tags": [
          "Printwren"
        ],
        "summary": "Print a URL or HTML to PDF (JSON result)",
        "description": "Renders the page in real Chrome and prints it. Returns title, page count, size, a direct download link (for URLs) and, with includePdfBase64=true, the PDF bytes as base64.",
        "operationId": "makePdfGet",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public web page (or POST \"html\" instead)",
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Paper size: A4, Letter, Legal, A3, A5, Tabloid (default A4)",
            "schema": {
              "type": "string",
              "enum": [
                "A4",
                "Letter",
                "Legal",
                "A3",
                "A5",
                "Tabloid"
              ],
              "default": "A4"
            }
          },
          {
            "name": "landscape",
            "in": "query",
            "required": false,
            "description": "Wide pages",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "margin",
            "in": "query",
            "required": false,
            "description": "CSS length for all sides (default 10mm)",
            "schema": {
              "type": "string",
              "default": "10mm"
            }
          },
          {
            "name": "pageNumbers",
            "in": "query",
            "required": false,
            "description": "Footer with \"page / total\"",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "printBackground",
            "in": "query",
            "required": false,
            "description": "Include background colours and images",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "media",
            "in": "query",
            "required": false,
            "description": "\"print\" (default, like Ctrl+P) or \"screen\" (looks like the browser)",
            "schema": {
              "type": "string",
              "enum": [
                "print",
                "screen"
              ],
              "default": "print"
            }
          },
          {
            "name": "includePdfBase64",
            "in": "query",
            "required": false,
            "description": "Return the PDF bytes as base64 (up to 3 MB)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "results": [
                    {
                      "source": "https://developer.mozilla.org/en-US/docs/Web/CSS/@page",
                      "status": "ok",
                      "title": "@page CSS at-rule - CSS | MDN",
                      "pages": 9,
                      "bytes": 1517607,
                      "format": "A4",
                      "landscape": false,
                      "renderMs": 4568,
                      "downloadUrl": "https://printwren.cybermax-tools.workers.dev/pdf?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FCSS%2F%40page&format=A4&pageNumbers=true",
                      "renderedAt": "2026-09-26T00:31:08.019Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (see the Retry-After header)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Printwren"
        ],
        "summary": "Print a URL or HTML to PDF (JSON result)",
        "description": "Renders the page in real Chrome and prints it. Returns title, page count, size, a direct download link (for URLs) and, with includePdfBase64=true, the PDF bytes as base64.",
        "operationId": "makePdfPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string",
                    "maxLength": 200000
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "A4",
                      "Letter",
                      "Legal",
                      "A3",
                      "A5",
                      "Tabloid"
                    ]
                  },
                  "landscape": {
                    "type": "boolean"
                  },
                  "margin": {
                    "type": "string"
                  },
                  "pageNumbers": {
                    "type": "boolean"
                  },
                  "printBackground": {
                    "type": "boolean"
                  },
                  "includePdfBase64": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "html": "<h1>Invoice #1042</h1><p>Total: $120.00</p>",
                "format": "Letter",
                "pageNumbers": true,
                "includePdfBase64": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "results": [
                    {
                      "source": "https://developer.mozilla.org/en-US/docs/Web/CSS/@page",
                      "status": "ok",
                      "title": "@page CSS at-rule - CSS | MDN",
                      "pages": 9,
                      "bytes": 1517607,
                      "format": "A4",
                      "landscape": false,
                      "renderMs": 4568,
                      "downloadUrl": "https://printwren.cybermax-tools.workers.dev/pdf?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FCSS%2F%40page&format=A4&pageNumbers=true",
                      "renderedAt": "2026-09-26T00:31:08.019Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (see the Retry-After header)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          },
          "limits": {
            "type": "object"
          }
        },
        "required": [
          "error",
          "message"
        ]
      }
    }
  },
  "x-mcp-server": "https://printwren.cybermax-tools.workers.dev/mcp"
}