{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text & Table Extractor — Markdown, OCR",
    "description": "Text, markdown, ruled tables and RAG chunks from PDF URLs, one item per page or per document, with optional Tesseract OCR for scanned pages. Built on PDFium: 140 pages in about a second. Charged per page delivered; document summaries, errors and skipped pages are free.",
    "version": "0.1",
    "x-build-id": "7egeqtqAC4W1I1cW7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/acotr_moonie~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-acotr_moonie-pdf-text-extractor",
        "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/acotr_moonie~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-acotr_moonie-pdf-text-extractor",
        "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/acotr_moonie~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-acotr_moonie-pdf-text-extractor",
        "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",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Direct links to PDF files (http or https), one per line. Must be the PDF itself, not a viewer page such as Google Docs or a browser preview. Each URL is fetched once with a plain GET, no proxy, no login; requests to the same host are spaced at least one second apart. You are responsible for the hosting site's terms and robots rules.",
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "page",
              "document",
              "chunk"
            ],
            "type": "string",
            "description": "page = one item per page (CSV and Google Sheets friendly). document = one item per PDF with full text, markdown and a pages array. chunk = RAG chunks of chunkSize characters with page and character offsets. A free document summary row is always written.",
            "default": "page"
          },
          "includeMarkdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Add a markdown field: headings inferred from font-size rank, paragraphs from line gaps, tables as GitHub tables when extractTables is on. Heuristic, not a layout model.",
            "default": true
          },
          "extractTables": {
            "title": "Extract ruled tables",
            "type": "boolean",
            "description": "Detect tables drawn with ruling lines and return them as arrays of rows. Borderless tables stay in the text. Adds about 0.3-0.5 s per page. No extra charge.",
            "default": false
          },
          "pageRange": {
            "title": "Page range",
            "pattern": "^[0-9,\\- ]*$",
            "type": "string",
            "description": "Pages to extract, 1-based, e.g. 1-5, 8, 12- (12 to end). Empty = all pages. Pages outside the range are never charged."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages beyond this are not extracted or charged; the document row gets status partial with errorCode pages_capped. Raise it deliberately for long documents.",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages (total, charged)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard stop for the whole run. Your main cost control: at $0.0003 per page, 5000 pages = $1.50. Documents not reached are reported with errorCode budget_exhausted and are free. 0 = no limit.",
            "default": 5000
          },
          "maxPdfMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files larger than this are refused before download (Content-Length) and aborted during download. Free error row too_large. The effective cap is also bounded by the run's memory (memory MB / 4).",
            "default": 50
          },
          "ocr": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Run Tesseract (English) on pages that have no text layer but contain an image. Such pages are charged as OCR page ($0.003) instead of page. Off = those pages are delivered empty with needsOcr true, free.",
            "default": false
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "eng"
            ],
            "type": "string",
            "description": "Tesseract language pack. Only packs shipped in the image are listed.",
            "default": "eng"
          },
          "maxOcrPagesPerPdf": {
            "title": "Max OCR pages per PDF",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "OCR cost control. Remaining image-only pages are delivered empty with needsOcr true and are not charged.",
            "default": 50
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Used only in chunk mode. 1500 characters is roughly 375 tokens. Split at paragraph, then sentence, then hard cut.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Tail of the previous chunk repeated at the start of the next. Clamped to half of chunkSize.",
            "default": 200
          },
          "pdfPassword": {
            "title": "PDF password (optional)",
            "type": "string",
            "description": "Applied to every password-protected PDF in this run. Wrong or missing password = free error row password_required. PDFs whose owner disabled text copying are always skipped (free error row permissions_restricted); there is no override."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}