{
  "openapi": "3.0.1",
  "info": {
    "title": "Scanned PDF OCR to Text & Tables - Columns Preserved",
    "description": "Read scanned PDFs with OCR and get clean per-page text plus the actual tables, as rows and columns. Empty cells stay null so nothing shifts, and cells the OCR could not read are flagged instead of being passed off as blank. 10 languages, no API key.",
    "version": "0.0",
    "x-build-id": "UrAOaulEarEZjewgK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/practical_ophthalmologist_iuq~scanned-pdf-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-practical_ophthalmologist_iuq-scanned-pdf-ocr",
        "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/practical_ophthalmologist_iuq~scanned-pdf-ocr/runs": {
      "post": {
        "operationId": "runs-sync-practical_ophthalmologist_iuq-scanned-pdf-ocr",
        "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/practical_ophthalmologist_iuq~scanned-pdf-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-practical_ophthalmologist_iuq-scanned-pdf-ocr",
        "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 the PDFs you want read. Scanned or photographed pages are the point here; if a PDF already has a text layer the Actor reads it directly instead of running OCR. The example is a scanned 1960s government memo, so the first run shows real OCR.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Tesseract language codes, most likely first. Installed: eng, deu, fra, spa, ita, por, nld, kor, jpn, chi_sim.",
            "default": [
              "eng"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "What to return",
            "enum": [
              "both",
              "tables",
              "text"
            ],
            "type": "string",
            "description": "Tables only, page text only, or both.",
            "default": "both"
          },
          "dpi": {
            "title": "Render resolution (DPI)",
            "minimum": 150,
            "maximum": 600,
            "type": "integer",
            "description": "Higher is more accurate and slower. 300 suits most scans; try 400 for small print, 200 for clean large type.",
            "default": 300
          },
          "minConfidence": {
            "title": "Minimum word confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "0-100. Words OCR is less sure about than this are reported as unreadable rather than as text. Raise it for cleaner text, lower it if characters go missing.",
            "default": 40
          },
          "minRows": {
            "title": "Minimum rows",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Ignore tables with fewer rows.",
            "default": 2
          },
          "minColumns": {
            "title": "Minimum columns",
            "minimum": 2,
            "maximum": 50,
            "type": "integer",
            "description": "Ignore tables with fewer columns. Keep this at 2 or more so paragraphs are not mistaken for tables.",
            "default": 2
          },
          "minFilledPercent": {
            "title": "Minimum filled cells (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "A real table is mostly full. Grids emptier than this are treated as a false detection - usually a page of prose the column finder carved up - and are not returned. Lower it for sparse forms, raise it if prose is slipping through.",
            "default": 35
          },
          "joinAcrossPages": {
            "title": "Join tables across page breaks",
            "type": "boolean",
            "description": "A table that runs over a page break comes back as one table, with a header the document repeats on every page removed. The record's 'pageSpan' lists the pages it came from. Turn this off to keep one record per page.",
            "default": true
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "How many pages to read per PDF. 0 means every page. OCR is charged per page and takes roughly 20 seconds per page, so this stops at 3 by default instead of running up a bill on a long document - and it tells you in the output whenever it had to stop early.",
            "default": 3
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger PDFs are skipped with an explanatory record.",
            "default": 50
          },
          "forceOcr": {
            "title": "Always run OCR",
            "type": "boolean",
            "description": "Off by default: a PDF that already has a text layer is read directly, which is faster, free of OCR errors and cheaper for you. Turn this on if the existing text layer is itself bad.",
            "default": false
          },
          "includeMarkdown": {
            "title": "Include Markdown output",
            "type": "boolean",
            "description": "Adds a Markdown table to every table record.",
            "default": true
          },
          "includeCsv": {
            "title": "Include CSV output",
            "type": "boolean",
            "description": "Adds a CSV string to every table record.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}