{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown + RAG Chunks: LLM-Ready PDF Text",
    "description": "Convert PDF URLs to clean Markdown and page-aware RAG chunks. Detects headings and tables, strips repeated headers and footers, adds a SHA-256 per document and chunk. Text-layer PDFs only: scanned PDFs get a clear free warning instead of a guess.",
    "version": "1.1",
    "x-build-id": "DBVdJaVwIhnes3Tye"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/atesen-software~pdf-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-atesen-software-pdf-to-markdown-rag",
        "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/atesen-software~pdf-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-atesen-software-pdf-to-markdown-rag",
        "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/atesen-software~pdf-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-atesen-software-pdf-to-markdown-rag",
        "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": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct public links to PDFs you have permission to process, one per line (up to 500 per run). Do not include access tokens or other secrets in the URL. The example is a public US government form.",
            "default": [
              "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output",
            "enum": [
              "markdown",
              "chunks",
              "both"
            ],
            "type": "string",
            "description": "Markdown: one dataset row per PDF with the full Markdown. Chunks: one summary row per PDF plus one row per RAG chunk. Both: the Markdown and the chunk rows. The price is the same for all three.",
            "default": "both"
          },
          "shareMarkdownLinks": {
            "title": "Create shareable Markdown links",
            "type": "boolean",
            "description": "When enabled, anyone with a generated link can open that Markdown file. Leave off to retrieve the file by its record key in your run's Key-value Store.",
            "default": false
          },
          "pageRange": {
            "title": "Page range (optional)",
            "type": "string",
            "description": "Only convert some pages, for example 1-5, 8, 10- (page numbers start at 1, 10- means page 10 to the end). Empty = all pages. Only the selected pages are processed and charged."
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 8000,
            "type": "integer",
            "description": "Maximum characters per RAG chunk, including the repeated overlap. About 4 characters are 1 token, so 1500 is roughly 375 tokens. Chunks end at headings, paragraphs and sentences where possible.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "How many characters of the end of the previous chunk are repeated at the start of the next chunk of the same section. Never more than half the chunk size. 0 = no overlap.",
            "default": 200
          },
          "headingAware": {
            "title": "Detect headings",
            "type": "boolean",
            "description": "Find headings from the font size (larger than the body text) and write them as Markdown headings. Every heading also starts a new chunk, and each chunk gets its heading path. Headings that are bold but not larger are not detected.",
            "default": true
          },
          "detectTables": {
            "title": "Detect tables",
            "type": "boolean",
            "description": "Turn 3 or more lines of cleanly aligned columns into Markdown tables. Tables without aligned columns, merged cells and drawn grid lines are not detected; their text stays as plain lines.",
            "default": true
          },
          "stripHeadersFooters": {
            "title": "Remove repeated headers and footers",
            "type": "boolean",
            "description": "Remove text that repeats in the top or bottom margin of at least half of the pages (running titles, page numbers). Needs 3 or more pages.",
            "default": true
          },
          "includePageMarkers": {
            "title": "Page markers in the Markdown",
            "type": "boolean",
            "description": "Insert an HTML comment like <!-- page 3 --> before the first text of every page. Chunks always carry their page numbers, with or without this option.",
            "default": false
          },
          "maxPdfMb": {
            "title": "Max PDF size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "PDF files larger than this are not downloaded (free error row). The upper limit is 50 MB.",
            "default": 50
          },
          "maxPagesPerDocument": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "A PDF with more selected pages than this gets a free error row instead of a conversion. Use the page range to convert part of a long document. The upper limit is 500.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}