{
  "openapi": "3.0.1",
  "info": {
    "title": "Scanned PDF & Image OCR - Tables to JSON",
    "description": "OCR scanned PDFs, images and photos of documents into text, Markdown and cell-level JSON tables. Per-page status, English, Latin-script, Japanese and Cyrillic models, no external OCR account. Failed and blank pages are not charged.",
    "version": "0.1",
    "x-build-id": "zsRLIep6Lckfzzhfr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~scanned-document-ocr-table-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-scanned-document-ocr-table-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/automa-flow~scanned-document-ocr-table-extractor/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-scanned-document-ocr-table-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/automa-flow~scanned-document-ocr-table-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-scanned-document-ocr-table-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",
        "properties": {
          "urls": {
            "title": "Document URLs",
            "minItems": 0,
            "maxItems": 200,
            "type": "array",
            "description": "Public http:// or https:// links to PDF, PNG, JPEG, TIFF or WebP files, up to 200. The prefill uses the bundled samples sample:invoice-scan, sample:employee-roster-scan and sample:receipt-photo. Ignored when Source Dataset is set.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^(?:https?://\\S+|sample:[a-z-]+)$"
            },
            "default": [
              "sample:invoice-scan",
              "sample:employee-roster-scan",
              "sample:receipt-photo"
            ]
          },
          "datasetId": {
            "title": "Source Dataset",
            "pattern": "^(?:[A-Za-z0-9]{17})?$",
            "type": "string",
            "description": "The Dataset of a finished crawler, downloader or PDF Text Extractor run whose rows hold document links. Takes priority over Document URLs. Reads up to 200 rows per run. Cannot be combined with base64 files or an upload."
          },
          "urlField": {
            "title": "URL field in Dataset",
            "pattern": "^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$",
            "maxLength": 200,
            "type": "string",
            "description": "The column that holds the document link, for example url, fileUrl or document.url. Rows without a value are skipped and not charged.",
            "default": "url"
          },
          "datasetOffset": {
            "title": "Dataset start row",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Zero-based row to start from. For a Dataset over 200 rows, run again with nextDatasetOffset from RUN_SUMMARY.",
            "default": 0
          },
          "base64Files": {
            "title": "Base64 files",
            "maxItems": 20,
            "type": "array",
            "description": "Files as standard base64 or as data URLs, for agents and scripts that send bytes. Each item needs a filename and the base64 payload. At most 20 files of up to 10 MB each; larger files should be URLs.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "filename",
                "base64"
              ],
              "properties": {
                "filename": {
                  "type": "string",
                  "title": "File name",
                  "description": "Name stored on the result row. Path segments are removed.",
                  "editor": "textfield",
                  "minLength": 1,
                  "maxLength": 255
                },
                "base64": {
                  "type": "string",
                  "title": "Base64 data",
                  "description": "Base64 of the file bytes. A data URL prefix such as data:application/pdf;base64, is accepted.",
                  "editor": "textarea",
                  "minLength": 1,
                  "maxLength": 14000000
                }
              }
            }
          },
          "fileUpload": {
            "title": "File upload",
            "maxLength": 2048,
            "type": "string",
            "description": "One PDF or image file uploaded in Console. Omit it when you are not uploading."
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "en",
              "latin",
              "cyrillic",
              "japan"
            ],
            "type": "string",
            "description": "Script of the documents. en, latin (German, French, Spanish, Polish and other Latin-script languages) and japan share one multilingual model; cyrillic uses a Cyrillic model and is tested on one Russian sample only.",
            "default": "en"
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Detect tables and return them cell by cell. Turn it off for text only; no table-extracted events are then charged.",
            "default": true
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Add each page's text to the pages array. Page status and confidence are always returned.",
            "default": true
          },
          "renderDpi": {
            "title": "Render DPI",
            "minimum": 150,
            "maximum": 300,
            "type": "integer",
            "description": "Resolution for rendering PDF pages before OCR. 200 suits most scans. Images are read at their own resolution.",
            "default": 200
          },
          "adaptiveDpi": {
            "title": "Adaptive DPI",
            "type": "boolean",
            "description": "Render low-resolution scans (under 150 dpi) and pages with very small text again at 300 dpi.",
            "default": true
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Pages after this limit are not processed or charged; the document is then PARTIAL with PAGE_CAP_REACHED.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are not downloaded and end TOO_LARGE, free of charge.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Max parallel documents",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Upper bound for documents processed at the same time. The Actor uses fewer when the run's memory or CPU share is smaller (OCR is CPU-bound).",
            "default": 2
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Added by an Apify Actor-to-Actor integration. It is accepted so the run can start and is not read. Set datasetId to {{resource.defaultDatasetId}} in the integration input."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}