{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown with Page Numbers – Tables, RAG Chunks",
    "description": "Convert PDF URLs to clean Markdown with page numbers for citations. Headings, lists, real Markdown tables, 2-column reading order, metadata and RAG chunks that keep their page range. Scanned pages are flagged \"needs OCR\" and never charged. $0.50 per 1,000 pages.",
    "version": "0.0",
    "x-build-id": "I8OcKjdpyGLuRl9yQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryumoon-data~pdf-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryumoon-data-pdf-to-markdown",
        "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/ryumoon-data~pdf-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ryumoon-data-pdf-to-markdown",
        "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/ryumoon-data~pdf-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ryumoon-data-pdf-to-markdown",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files (redirects are followed). arXiv /abs/ pages, Google Drive file links and Dropbox share links are converted to their download links automatically.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "document",
              "pages",
              "chunks"
            ],
            "type": "string",
            "description": "'document' = one row per PDF with the full Markdown (page markers like <!-- page 3 --> included). 'pages' = one row per page. 'chunks' = RAG-ready chunks, each carrying its page range, section headings and a ready-made citation.",
            "default": "document"
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Only for 'chunks' output. Target maximum characters per chunk (about 4 characters = 1 token, so 1500 is roughly 375 tokens). Chunks break at headings, paragraphs and sentences, never mid-word; tables are split by rows with the header repeated.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Only for 'chunks' output. Characters of trailing context (whole sentences) repeated at the start of the next chunk. No overlap is added across a new section heading. Max half the chunk size.",
            "default": 150
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Convert (and pay for) only these pages, e.g. '1-5, 8, 12-' ('12-' means page 12 to the end). Leave empty for all pages. Page numbers are the PDF's physical page order, starting at 1."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap. Larger PDFs are converted up to this many pages and the row is marked 'partial' with a warning. Also caps what one PDF can cost you.",
            "default": 20
          },
          "maxPdfSizeMb": {
            "title": "Max PDF size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this are skipped with a TOO_LARGE error row and are not charged.",
            "default": 100
          },
          "timeoutPerPdfSecs": {
            "title": "Timeout per PDF (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Conversion of a single PDF is stopped after this many seconds and reported as a TIMEOUT error row (not charged). Raise it for very long documents on low memory.",
            "default": 300
          },
          "pageMarkers": {
            "title": "Page markers in Markdown",
            "type": "boolean",
            "description": "Insert an HTML comment like <!-- page 3 --> before each page's content, so every passage can be cited to its page. Comments are invisible when the Markdown is rendered.",
            "default": true
          },
          "detectTables": {
            "title": "Convert tables to Markdown tables",
            "type": "boolean",
            "description": "Detect ruled tables and aligned number columns (for example financial statements) and output them as Markdown tables instead of jumbled text lines.",
            "default": true
          },
          "detectColumns": {
            "title": "Fix 2-column reading order",
            "type": "boolean",
            "description": "Detect two-column pages (research papers, journals, newsletters) and read the left column before the right column instead of mixing lines across columns.",
            "default": true
          },
          "removeHeadersFooters": {
            "title": "Remove repeating headers and footers",
            "type": "boolean",
            "description": "Drop running headers, footers and page numbers that repeat on many pages, so they don't pollute paragraphs and chunks.",
            "default": true
          },
          "includePages": {
            "title": "Add per-page array to document rows",
            "type": "boolean",
            "description": "Only for 'document' output. Adds a 'pages' array with each page's Markdown, status (text / needs_ocr / empty), headings and table count.",
            "default": false
          },
          "includePlainText": {
            "title": "Add plain text",
            "type": "boolean",
            "description": "Only for 'document' output. Adds a 'text' field with the Markdown symbols and page markers stripped.",
            "default": false
          },
          "saveMarkdownFiles": {
            "title": "Save .md files",
            "type": "boolean",
            "description": "Also save each PDF's Markdown as a downloadable .md file in the run's key-value store; its link is in 'markdownFileUrl'. Very large documents are always saved as files.",
            "default": true
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for protected PDFs, used for every PDF in the run. Only for documents you are allowed to open."
          },
          "maxConcurrency": {
            "title": "Parallel PDFs",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many PDFs are converted at the same time. Keep 1 at the default 1 GB memory (a long scanned PDF can use about 400 MB); use 2-4 with 4 GB for big batches.",
            "default": 1
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Only needed when a site blocks direct downloads. Leave off for normal public PDF links.",
            "default": {
              "useApifyProxy": false
            }
          },
          "compactOutput": {
            "title": "Compact output",
            "type": "boolean",
            "description": "Return essential content, source identifiers and errors only; omit bulky optional metadata.",
            "default": false
          },
          "timeBudgetSecs": {
            "title": "Time budget (seconds)",
            "minimum": 10,
            "maximum": 86400,
            "type": "integer",
            "description": "Stop early and keep completed results before this budget or the platform deadline, whichever comes first.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}