{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Image to Text (OCR) for AI agents",
    "description": "Turn PDFs, scans and images into clean per-page text and Markdown for AI agents and RAG. Reads the PDF text layer first, local Tesseract OCR for scans (EN, NL, DE, FR). No external APIs.",
    "version": "1.0",
    "x-build-id": "HEegWPR3V9jpHgHs7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/benelux-signals~pdf-image-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-benelux-signals-pdf-image-to-text-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/benelux-signals~pdf-image-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-benelux-signals-pdf-image-to-text-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/benelux-signals~pdf-image-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-benelux-signals-pdf-image-to-text-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",
        "properties": {
          "urls": {
            "title": "PDF or image URLs",
            "type": "array",
            "description": "One public link per line to a PDF, PNG, JPG, TIFF, WebP, GIF or BMP file. Scanned PDFs, photos of documents and screenshots are OCR'd; PDFs with a text layer are read directly (fast, exact). The example PDF is skipped automatically when you also upload files.",
            "default": [
              "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload PDFs or images from your computer (stored in your Apify account and read only by this run). Combined with the URLs above.",
            "default": []
          },
          "keyValueStore": {
            "title": "Key-value store (optional)",
            "type": "string",
            "description": "Pick one of your Apify key-value stores that holds PDFs or images (e.g. saved by another Actor or an AI agent). The Actor only gets read access to this store. Leave the keys below empty to process every record whose key ends in .pdf, .png, .jpg, .tif, .webp, .gif or .bmp."
          },
          "keyValueStoreKeys": {
            "title": "Record keys in that store",
            "type": "array",
            "description": "Only process these record keys from the picked key-value store (one per line). Empty = all PDF/image records.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ocrMode": {
            "title": "Extraction mode",
            "enum": [
              "auto",
              "text-layer-only",
              "ocr-only"
            ],
            "type": "string",
            "description": "Auto uses the embedded PDF text when a page has enough real text and runs Tesseract OCR only on scanned or image pages. Images are always OCR'd.",
            "default": "auto"
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "auto",
              "eng",
              "nld",
              "deu",
              "fra",
              "eng+nld",
              "eng+deu",
              "eng+fra",
              "eng+nld+deu+fra"
            ],
            "type": "string",
            "description": "Language model for OCR. Auto reads the first OCR page with all four models, detects the language and uses only that model for the rest of the document. Pick one language for the fastest, most accurate result.",
            "default": "auto"
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "Resolution used to render scanned PDF pages for OCR. 150 is fast and accurate for normal documents; use 200 or 300 for very small print or poor scans. Images are OCR'd at their own resolution.",
            "default": 150
          },
          "minTextLayerChars": {
            "title": "Minimum text-layer characters",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "In auto mode a page that contains images is OCR'd when its text layer has fewer letters/digits than this. Pages without any image always use their text layer.",
            "default": 50
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Which text fields to fill per page. Markdown adds headings and lists, ideal for LLMs and RAG pipelines.",
            "default": "both"
          },
          "saveDocumentMarkdown": {
            "title": "Save one Markdown file per document",
            "type": "boolean",
            "description": "Also store the whole document as a single .md file in the run's key-value store (link in the run summary).",
            "default": true
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Only process these pages of every document, e.g. 1-5,8,10- . Leave empty for all pages (up to the per-document limit).",
            "default": ""
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many pages of each document. Protects you from unexpectedly long files.",
            "default": 50
          },
          "maxPages": {
            "title": "Max pages per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Total page limit for the whole run (all documents together). You never pay for more pages than this.",
            "default": 200
          },
          "maxFileSizeMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this are skipped with a free error row.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum time to download one file.",
            "default": 60
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs (used for every PDF in this run). Stored encrypted; leave empty for normal PDFs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}