{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & OCR – PDF & Image Text Extraction (Erdnal)",
    "description": "PDF to text and OCR: extract text from PDFs, scanned PDFs and JPEG/PNG images (image to text) by URL, page by page, as JSON, text or Markdown. Optional invoice to JSON. EU-hosted, documents not kept. Pay per page.",
    "version": "0.1",
    "x-build-id": "kbAuYtz5OGDLdfjZZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/erdnal_api~erdnal-documents-text-extraction/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-erdnal_api-erdnal-documents-text-extraction",
        "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/erdnal_api~erdnal-documents-text-extraction/runs": {
      "post": {
        "operationId": "runs-sync-erdnal_api-erdnal-documents-text-extraction",
        "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/erdnal_api~erdnal-documents-text-extraction/run-sync": {
      "post": {
        "operationId": "run-sync-erdnal_api-erdnal-documents-text-extraction",
        "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": [
          "documentUrls"
        ],
        "properties": {
          "documentUrls": {
            "title": "Document URLs",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "Public https:// URLs of the PDF, JPEG or PNG files to read, one per line (1 to 500 per run, 20 MB per file, up to 3 redirects, e.g. download links). Each file becomes one row of the output.",
            "items": {
              "type": "string"
            }
          },
          "extract": {
            "title": "What to extract",
            "enum": [
              "text",
              "invoice"
            ],
            "type": "string",
            "description": "Text (default): the text of every page, read from the PDF text layer or by OCR for scans. Invoice data: invoice or receipt fields as JSON (number, dates, supplier and VAT number, customer, currency, subtotal, tax lines, total, line items); costs 5 extra credits per page and sends the extracted text to an AI model (Anthropic).",
            "default": "text"
          },
          "mode": {
            "title": "Extraction mode",
            "enum": [
              "auto",
              "text",
              "ocr"
            ],
            "type": "string",
            "description": "Auto (default, cheapest and most accurate): pages with a text layer are read directly, only scanned pages go through OCR. Text: never use OCR (scanned pages come back empty). OCR: run OCR on every page, even when a text layer exists (useful if the text layer is broken).",
            "default": "auto"
          },
          "languages": {
            "title": "OCR languages",
            "minItems": 1,
            "maxItems": 3,
            "type": "array",
            "description": "Languages of your documents, used by OCR only (1 to 3). Choose only the languages actually present: each extra language makes OCR slower. Default English and French.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "fra",
                "deu",
                "spa",
                "ita",
                "por",
                "nld"
              ],
              "enumTitles": [
                "English",
                "French",
                "German",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch"
              ]
            },
            "default": [
              "eng",
              "fra"
            ]
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Pages to extract, e.g. 1-3,7 (numbers start at 1). Leave empty for all pages (200 at most). A document can have at most 5 pages read by OCR per run: split long scanned documents with page ranges."
          },
          "includePages": {
            "title": "Include page details",
            "type": "boolean",
            "description": "On (default): add the text, method (text layer or OCR) and OCR confidence of each page, besides the full text. Off: only the full text, for smaller output.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}