{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown Converter – PDF Parser for LLM & RAG",
    "description": "Convert PDF links or uploaded PDFs into clean Markdown: headings, lists, tables, page numbers, metadata and RAG chunks. Fast text extraction, no OCR (scanned and failed files are free). $3 per 1,000 PDFs, first 20 pages included.",
    "version": "0.1",
    "x-build-id": "qclx7VSo6PKkycbkh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleandata-labs~pdf-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleandata-labs-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/cleandata-labs~pdf-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-cleandata-labs-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/cleandata-labs~pdf-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-cleandata-labs-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",
        "properties": {
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Public links to PDF files, e.g. [\"https://arxiv.org/pdf/1706.03762\"]. 'https://' is added if missing. One converted PDF costs one result. Always pass your own URLs: the default is only a demo.",
            "default": [
              "https://bitcoin.org/bitcoin.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Upload PDFs",
            "type": "array",
            "description": "Upload PDF files from your computer (they are stored in an Apify key-value store), or paste a PDF URL or a key-value store record URL (https://api.apify.com/v2/key-value-stores/<storeId>/records/<key>, signed links included)."
          },
          "keyValueStoreId": {
            "title": "Convert all PDFs in a key-value store",
            "type": "string",
            "description": "Optional: pick one of your Apify key-value stores (or enter its ID). Every PDF record in it is converted; records that are not PDFs come back as free error rows. The Actor gets read-only access to this store only."
          },
          "keyValueStoreKeyPrefix": {
            "title": "Key prefix (key-value store)",
            "type": "string",
            "description": "Only convert records whose key starts with this text, e.g. \"invoices-\". Used only with keyValueStoreId."
          },
          "pageRange": {
            "title": "Pages to convert",
            "type": "string",
            "description": "Optional page selection, e.g. \"1-5\", \"1,3,10-12\", \"20-\" (page 20 to the end) or \"-1\" (last page). Empty = all pages (up to Max pages)."
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Convert at most this many pages per PDF, 0 = no limit. Default 200. The first 20 pages are included in the per-PDF price; each page above 20 adds a small per-page charge.",
            "default": 200
          },
          "perPageOutput": {
            "title": "Per-page output",
            "type": "boolean",
            "description": "true = also return a 'pages' array with the Markdown of every page separately (page number, characters, tables, whether it has a text layer). Useful for citations. Default false.",
            "default": false
          },
          "pageMarkers": {
            "title": "Page markers",
            "type": "boolean",
            "description": "true (default) = insert an HTML comment <!-- page N --> before each page in the Markdown, so you can cite pages. Invisible when the Markdown is rendered.",
            "default": true
          },
          "includeTables": {
            "title": "Detect tables",
            "type": "boolean",
            "description": "true (default) = tables drawn with cell borders become Markdown tables. Tables without borders stay as text lines.",
            "default": true
          },
          "removeHeadersFooters": {
            "title": "Remove repeated headers and footers",
            "type": "boolean",
            "description": "true (default) = drop text repeated at the top or bottom of most pages (running titles, page numbers). Needs at least 3 pages.",
            "default": true
          },
          "chunkSizeTokens": {
            "title": "Chunk size (approx. tokens)",
            "minimum": 0,
            "maximum": 32000,
            "type": "integer",
            "description": "If > 0, also return 'chunks' split on paragraph boundaries for RAG, about this many tokens each (1 token ~ 4 characters), each with the page it starts on. Default 0 = no chunks.",
            "default": 0
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (approx. tokens)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Overlap between consecutive chunks in tokens, 0-2000. Default 50. Used only when chunkSizeTokens > 0.",
            "default": 50
          },
          "maxCharacters": {
            "title": "Max characters per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Cut each PDF's Markdown to this many characters, 0 = no limit (default). For AI agents a value such as 20000 (~5k tokens) keeps results small.",
            "default": 0
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Optional password for encrypted PDFs (the same password is tried for every file). Stored encrypted."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip files larger than this (free error row). Default 50 MB.",
            "default": 50
          },
          "perPdfTimeoutSecs": {
            "title": "Time limit per PDF (s)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop converting a PDF after this many seconds and return the pages done so far, with a warning. Default 300.",
            "default": 300
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "true (default) = skip URLs that the site's robots.txt disallows. Skipped URLs are reported and not charged.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (s)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout per download attempt in seconds. Default 60.",
            "default": 60
          },
          "maxRetries": {
            "title": "Max retries per file",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on network errors and HTTP 5xx, 0-5. Default 2.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel downloads, 1-10. Default 4. Conversion uses the available CPU cores.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy for sites that block datacenter IPs, e.g. {\"useApifyProxy\": true}. Default: no proxy.",
            "default": {
              "useApifyProxy": false
            }
          },
          "userAgent": {
            "title": "Custom User-Agent",
            "type": "string",
            "description": "Optional custom User-Agent header. By default the Actor uses an identifiable bot User-Agent."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}