{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown: Column-Aware Reading Order",
    "description": "Convert PDFs to clean text and Markdown in the order a human reads them. Two-column pages are un-interleaved instead of read row by row, repeated running heads and page numbers are dropped, and words broken across line breaks are rejoined.",
    "version": "0.1",
    "x-build-id": "qM95wQSLAJFLtvyaJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aiqlabs~pdf-to-text-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aiqlabs-pdf-to-text-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/aiqlabs~pdf-to-text-markdown/runs": {
      "post": {
        "operationId": "runs-sync-aiqlabs-pdf-to-text-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/aiqlabs~pdf-to-text-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-aiqlabs-pdf-to-text-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": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. Redirects are followed and the URL that actually answered is reported back.",
            "default": [
              "https://www.irs.gov/pub/irs-pdf/f1040.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "What to return",
            "enum": [
              "both",
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Markdown keeps headings and lists. Text is one paragraph per block with no markup. Both returns the two side by side so you can compare them.",
            "default": "both"
          },
          "detectMultiColumn": {
            "title": "Detect columns and fix the reading order",
            "type": "boolean",
            "description": "Look for the gutter between columns and read each column top to bottom instead of reading straight across the page. Turn it off only to reproduce what a column-blind extractor returns.",
            "default": true
          },
          "removeBoilerplate": {
            "title": "Drop repeated running heads and page numbers",
            "type": "boolean",
            "description": "A line that appears at the top or bottom of at least half the pages is furniture, not content. Removing it keeps page numbers out of every paragraph you later index or feed to a model.",
            "default": true
          },
          "joinHyphens": {
            "title": "Rejoin words split across line breaks",
            "type": "boolean",
            "description": "Turns \"inter-\" plus \"national\" back into one word. Without this, justified text produces tokens that match nothing.",
            "default": true
          },
          "includePageTexts": {
            "title": "Also return the text page by page",
            "type": "boolean",
            "description": "Adds a per-page array alongside the whole-document output. Useful when you need to cite a page number; it makes rows much larger, so it is off by default.",
            "default": false
          },
          "maxPages": {
            "title": "Pages to read per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Reading stops after this many pages. The reported page count is still the real one, and the row says the budget was reached.",
            "default": 300
          },
          "maxOutputChars": {
            "title": "Characters of output per document",
            "minimum": 1000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Upper bound on the text and Markdown kept per file. Anything beyond it is cut and the row says so.",
            "default": 400000
          },
          "maxFileMb": {
            "title": "Maximum file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Downloading stops at this size and the file is reported as too large instead of taking the run down.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "How long to wait for each PDF before giving up on it.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Files in flight",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to download and parse at the same time.",
            "default": 5
          },
          "maxPdfs": {
            "title": "Maximum number of files",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety limit on how many URLs one run will accept.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}