{
  "openapi": "3.0.1",
  "info": {
    "title": "Markdown & HTML to PDF Converter (+ URL)",
    "description": "Convert Markdown to PDF, HTML to PDF or any web page URL to PDF via API. GitHub-style tables, code and task lists; A4, Letter, Legal, landscape, margins, page numbers, headers, custom CSS, PNG preview. Batch up to 200 docs. $0.004 per PDF, failures free. For AI agents, MCP, n8n, Make.",
    "version": "1.0",
    "x-build-id": "yEsOk5qJsqwJLBbcq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigaceboy~markdown-html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigaceboy-markdown-html-to-pdf",
        "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/bigaceboy~markdown-html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-bigaceboy-markdown-html-to-pdf",
        "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/bigaceboy~markdown-html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-bigaceboy-markdown-html-to-pdf",
        "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",
        "properties": {
          "documents": {
            "title": "Documents",
            "type": "array",
            "description": "List of documents. Each item is an object with exactly one of \"markdown\", \"html\" or \"url\", plus optional \"fileName\" (without .pdf) and \"title\". Example: [{\"markdown\": \"# Report\\n\\nHello\", \"fileName\": \"report\"}, {\"url\": \"https://example.com\"}]. Max 200 per run; each Markdown/HTML document up to 5 million characters."
          },
          "markdown": {
            "title": "Markdown (single document shortcut)",
            "type": "string",
            "description": "Optional quick way to convert one Markdown document. Added to the Documents list. GitHub Flavored Markdown: tables, task lists, fenced code with syntax highlighting, strikethrough, autolinks."
          },
          "html": {
            "title": "HTML (single document shortcut)",
            "type": "string",
            "description": "Optional quick way to convert one HTML document or fragment. Added to the Documents list. Scripts are not executed for HTML input."
          },
          "urls": {
            "title": "Web page URLs",
            "type": "array",
            "description": "Optional public http(s) pages to print to PDF (one PDF each). Added to the Documents list. Private, loopback, link-local and cloud-metadata addresses are blocked.",
            "items": {
              "type": "string"
            }
          },
          "fileName": {
            "title": "File name for the shortcut document",
            "type": "string",
            "description": "Optional file name (without .pdf) used for the Markdown or HTML shortcut fields."
          },
          "format": {
            "title": "Paper size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A5",
              "A3",
              "Tabloid"
            ],
            "type": "string",
            "description": "Page size of the PDF: A4 (most of the world) or US Letter/Legal (USA, Canada), plus A5, A3 and Tabloid.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Turn the page sideways (good for wide tables).",
            "default": false
          },
          "pageNumbers": {
            "title": "Page numbers",
            "type": "boolean",
            "description": "Add \"Page X of Y\" at the bottom of every page. Ignored if you set your own footer template.",
            "default": true
          },
          "marginTop": {
            "title": "Top margin",
            "type": "string",
            "description": "CSS length, e.g. 15mm, 0.5in, 20px. Default 15mm (18mm with header/footer/page numbers)."
          },
          "marginRight": {
            "title": "Right margin",
            "type": "string",
            "description": "CSS length, e.g. 15mm, 0.5in, 20px. Default 15mm."
          },
          "marginBottom": {
            "title": "Bottom margin",
            "type": "string",
            "description": "CSS length, e.g. 15mm, 0.5in, 20px. Default 15mm (18mm with header/footer/page numbers)."
          },
          "marginLeft": {
            "title": "Left margin",
            "type": "string",
            "description": "CSS length, e.g. 15mm, 0.5in, 20px. Default 15mm."
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Include background colors and images (table stripes, code block shading, colored banners).",
            "default": true
          },
          "headerTemplate": {
            "title": "Header template (HTML)",
            "type": "string",
            "description": "Optional HTML shown at the top of every page. Use classes pageNumber, totalPages, title, date and url to insert values, e.g. <div style=\"font-size:8px;width:100%;text-align:right;padding-right:15mm\"><span class=\"title\"></span></div>. Set an explicit font-size (Chromium defaults to a tiny size)."
          },
          "footerTemplate": {
            "title": "Footer template (HTML)",
            "type": "string",
            "description": "Optional HTML shown at the bottom of every page (same placeholders as the header). Replaces the default page-number footer."
          },
          "customCss": {
            "title": "Custom CSS",
            "type": "string",
            "description": "Extra CSS applied to every document (after the default stylesheet), e.g. body { font-family: Georgia, serif; } h1 { color: #0b5394; }. For URL documents it is injected after the page loads."
          },
          "useDefaultStyles": {
            "title": "Clean default stylesheet for Markdown",
            "type": "boolean",
            "description": "Style Markdown like GitHub: readable fonts, bordered/striped tables, shaded code blocks with syntax highlighting. Turn off to start from a blank page and use only your Custom CSS.",
            "default": true
          },
          "htmlUseDefaultStyles": {
            "title": "Apply default stylesheet to HTML too",
            "type": "boolean",
            "description": "Also apply the clean stylesheet to HTML documents (off by default so your HTML looks exactly as written).",
            "default": false
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Zoom factor for the content, 0.1–2 (default 1). Use 0.8 to fit wide content.",
            "default": 1
          },
          "preferCSSPageSize": {
            "title": "Use CSS @page size",
            "type": "boolean",
            "description": "If your HTML/CSS declares @page { size: ... }, use it instead of Paper size.",
            "default": false
          },
          "firstPagePng": {
            "title": "PNG preview of page 1",
            "type": "boolean",
            "description": "Also save a PNG image of the first page (handy for thumbnails, chat previews and AI agents that can see images). Included in the same price.",
            "default": false
          },
          "pngDpi": {
            "title": "PNG preview resolution",
            "minimum": 36,
            "maximum": 200,
            "type": "integer",
            "description": "Resolution of the page-1 PNG in DPI (36–200). 110 ≈ 910 px wide for A4.",
            "default": 110
          },
          "mediaType": {
            "title": "CSS media type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "print uses the page's print styles (default); screen makes web pages look like they do in a browser window.",
            "default": "print"
          },
          "waitUntil": {
            "title": "Wait until (URL mode)",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When a web page counts as loaded before printing. networkidle is best for JavaScript-heavy pages but slower.",
            "default": "load"
          },
          "waitForMillis": {
            "title": "Extra wait (URL mode)",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Extra time to wait after loading, for animations or lazy content (0–15000 ms).",
            "default": 0
          },
          "timeoutSecs": {
            "title": "Timeout per document",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "How long to wait for a page or its images to load before giving up (failed documents are not charged).",
            "default": 45
          },
          "urlJavaScript": {
            "title": "Run page JavaScript (URL mode)",
            "type": "boolean",
            "description": "Allow web pages to run their own JavaScript (needed by most modern sites). JavaScript never runs for Markdown/HTML input.",
            "default": true
          },
          "allowRemoteResources": {
            "title": "Load remote images/fonts for Markdown/HTML",
            "type": "boolean",
            "description": "Let Markdown/HTML documents load public images, fonts and stylesheets by URL. Private and internal addresses are always blocked.",
            "default": true
          },
          "maxPdfSizeMb": {
            "title": "Max PDF size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "PDFs larger than this are discarded with an OUTPUT_TOO_LARGE error (not charged). Max 100.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}