{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Image to Text API: OCR, Markdown, Tables, RAG Chunks",
    "description": "Extract text from PDFs, scanned PDFs, images (PNG, JPG, TIFF) and DOCX by URL: full text, Markdown, per-page text, OCR confidence, tables, metadata, RAG chunks. Auto-OCR in 20 languages. $1.50/1K docs, $4/1K OCR pages.",
    "version": "1.0",
    "x-build-id": "9sS98legtVNfPxeN7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magnova~pdf-ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magnova-pdf-ocr-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/magnova~pdf-ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-magnova-pdf-ocr-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/magnova~pdf-ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-magnova-pdf-ocr-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": "File URLs (PDF, image or DOCX)",
            "type": "array",
            "description": "Direct links to the files to extract text from: PDF (digital or scanned), PNG, JPG, TIFF (multi-page), WebP, GIF, BMP or DOCX. The link must return the file itself, not a viewer page. Example: https://www.irs.gov/pub/irs-pdf/fw9.pdf",
            "items": {
              "type": "string"
            }
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "auto = use the PDF text layer and run OCR only on pages that have no text but contain an image (scanned pages). always = OCR every page (use for PDFs with broken text layers). never = never OCR; images then return no text. Example: auto",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages Tesseract should recognise. Pick every language that appears in the documents (more languages = slower). Example: [\"eng\", \"spa\"]",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "spa",
                "fra",
                "deu",
                "por",
                "ita",
                "nld",
                "pol",
                "rus",
                "ukr",
                "tur",
                "ara",
                "hin",
                "urd",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "vie",
                "ind"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "French",
                "German",
                "Portuguese",
                "Italian",
                "Dutch",
                "Polish",
                "Russian",
                "Ukrainian",
                "Turkish",
                "Arabic",
                "Hindi",
                "Urdu",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean",
                "Vietnamese",
                "Indonesian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Only process these pages of each PDF (1-based). Leave empty for all pages. Examples: \"1-5\", \"1,3,8-10\", \"2-\"."
          },
          "includeMarkdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Add a Markdown version of each document (page sections, detected tables as Markdown tables, DOCX headings and lists). Example: true",
            "default": true
          },
          "extractTables": {
            "title": "Detect tables (PDF)",
            "type": "boolean",
            "description": "Detect ruled (bordered) tables on digital PDF pages and return them as rows and Markdown. Adds processing time. Example: false",
            "default": false
          },
          "chunkSize": {
            "title": "RAG chunk size (characters)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "If set (e.g. 1000), also return page-safe text chunks for vector databases: chunks never cross a page boundary and keep their page number for citations. 0 = off. Example: 1000",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters of overlap between consecutive chunks on the same page. Example: 100",
            "default": 0
          },
          "includePages": {
            "title": "Include per-page results",
            "type": "boolean",
            "description": "Return a pages array with each page's text, extraction method (text_layer or ocr), OCR confidence, word count and tables. Example: true",
            "default": true
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Return the whole document text in one field. Turn off to save space when you only need pages or chunks. Example: true",
            "default": true
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many pages of each document. Example: 500",
            "default": 500
          },
          "maxOcrPagesPerDocument": {
            "title": "Max OCR pages per document",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Cost guard: at most this many pages per document are OCRed (each OCR page is charged). Example: 100",
            "default": 100
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs, if all your PDFs share one. Leave empty otherwise."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Skip files larger than this (an error row is returned). Example: 50",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many files to download at once. Parsing and OCR run one file at a time to keep memory low. Example: 4",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}