{
  "openapi": "3.0.1",
  "info": {
    "title": "Markdown & HTML to PDF — TOC, Headers, Page Numbers",
    "description": "PDF generator: turn Markdown or HTML into print-ready PDFs with automatic table of contents, headers, footers and page numbers, A4/Letter, Cyrillic-ready fonts and PDF/A-3b. Runs offline, no browser needed. Pay only per rendered page.",
    "version": "1.0",
    "x-build-id": "cPvj5xhzJL2DMSGvb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tiger19935~paged-pdf-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tiger19935-paged-pdf-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/tiger19935~paged-pdf-generator/runs": {
      "post": {
        "operationId": "runs-sync-tiger19935-paged-pdf-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/tiger19935~paged-pdf-generator/run-sync": {
      "post": {
        "operationId": "run-sync-tiger19935-paged-pdf-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "documents"
        ],
        "properties": {
          "documents": {
            "title": "Documents",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "List of documents to convert (max 1000, each max 5 MB). Every item is an object with exactly one of \"markdown\" or \"html\", and optionally \"title\", \"filename\", \"css\" (extra stylesheet), \"language\", \"attachments\" and per-document overrides of \"template\", \"page\", \"toc\", \"header\" and \"footer\". Example: [{\"title\": \"Report\", \"markdown\": \"# Hello\\n\\nText\"}]"
          },
          "template": {
            "title": "Template",
            "enum": [
              "report",
              "article",
              "contract",
              "cv",
              "plain"
            ],
            "type": "string",
            "description": "Built-in design. report = business report (sans-serif, accent headings), article = long-form reading (serif, justified), contract = formal legal text, cv = compact resume, plain = minimal styling for HTML that brings its own CSS. Can be overridden per document.",
            "default": "report"
          },
          "page": {
            "title": "Page setup",
            "type": "object",
            "description": "Page size and margins: {\"size\": \"A4\" | \"Letter\" | \"A5\" | \"Legal\", \"orientation\": \"portrait\" | \"landscape\", \"marginMm\": 5-50}. Missing keys use the defaults. Can be overridden per document.",
            "default": {
              "size": "A4",
              "orientation": "portrait",
              "marginMm": 20
            }
          },
          "toc": {
            "title": "Table of contents",
            "type": "object",
            "description": "Automatic table of contents built from the headings: {\"enabled\": true/false, \"depth\": 1-4 (heading levels, default 3), \"title\": \"Contents\"}. Entries are clickable links and show the real page numbers. Can be overridden per document.",
            "default": {
              "enabled": false,
              "depth": 3,
              "title": "Contents"
            }
          },
          "header": {
            "title": "Header text",
            "type": "string",
            "description": "Text printed at the top centre of every page. Tokens: {page} current page, {pages} total pages, {title} document title, {date} generation date (YYYY-MM-DD). Empty = no header. Can be overridden per document."
          },
          "footer": {
            "title": "Footer text",
            "type": "string",
            "description": "Text printed at the bottom centre of every page. Tokens: {page}, {pages}, {title}, {date}. Use the single word none for no footer. Can be overridden per document.",
            "default": "Page {page} of {pages}"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "BCP-47 language code of the documents (en, uk, de, pt-PT ...). Used for hyphenation and quotation marks. Default en.",
            "default": "en"
          },
          "pdfVariant": {
            "title": "PDF variant",
            "enum": [
              "none",
              "pdf/a-3b"
            ],
            "type": "string",
            "description": "none = regular PDF. pdf/a-3b = archival PDF/A-3b, which can carry attached files (for example an XML invoice). The Actor only formats and embeds - it does not validate invoices or deliver them.",
            "default": "none"
          },
          "attachments": {
            "title": "Attachments",
            "maxItems": 5,
            "type": "array",
            "description": "Files to embed in every PDF (max 5, each max 5 MB), as [{\"name\": \"invoice.xml\", \"contentBase64\": \"...\", \"mimeType\": \"application/xml\", \"description\": \"...\"}]. Mainly used with PDF/A-3b. A document can carry its own \"attachments\" list instead.",
            "default": []
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety limit: a document that would produce more pages is rejected (not charged). Between 1 and 500.",
            "default": 300
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}