{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Image to Text - OCR Text Extractor",
    "description": "Extract text from PDFs and images by link: the text layer of a PDF, OCR for scanned pages and pictures in 27 languages. Per-page text, metadata, word count and OCR confidence. Passwords, page ranges, many files. Export to Excel, CSV or API.",
    "version": "0.1",
    "x-build-id": "kHOdeswaW52k3T6lT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~pdf-ocr-text-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-pdf-ocr-text-scraper",
        "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/pshivam~pdf-ocr-text-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-pdf-ocr-text-scraper",
        "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/pshivam~pdf-ocr-text-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-pdf-ocr-text-scraper",
        "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": "Links to PDFs and images",
            "type": "array",
            "description": "The files to read, one link per line: PDF, PNG, JPEG, TIFF, WEBP, GIF or BMP. The file's type is known from its first bytes, so a link without an extension works. Leave empty to read two example files.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "OCR languages",
            "type": "array",
            "description": "The languages of the text in scanned pages and images. Choose all the languages the text has (up to 4). OCR is exact only for the languages chosen. PDF text layers need no language.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "por",
                "ita",
                "nld",
                "rus",
                "ara",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "hin",
                "tur",
                "pol",
                "ukr",
                "vie",
                "ind",
                "swe",
                "dan",
                "fin",
                "nor",
                "ces",
                "ell",
                "heb",
                "tha"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Portuguese",
                "Italian",
                "Dutch",
                "Russian",
                "Arabic",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Japanese",
                "Korean",
                "Hindi",
                "Turkish",
                "Polish",
                "Ukrainian",
                "Vietnamese",
                "Indonesian",
                "Swedish",
                "Danish",
                "Finnish",
                "Norwegian",
                "Czech",
                "Greek",
                "Hebrew",
                "Thai"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrMode": {
            "title": "When to use OCR",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Automatic reads a PDF page's own text and uses OCR only when the page has none. 'OCR every page' ignores the text layer: use it for PDFs whose text layer is wrong. 'Text layer only' never runs OCR.",
            "default": "auto"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Read only these pages of each document: 1-3, 5 or 4- (page 4 to the end). Leave empty to read all pages."
          },
          "maxPagesPerDocument": {
            "title": "Maximum pages per document",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Read at most this many pages of each document. OCR takes about 1 to 3 seconds a page.",
            "default": 50
          },
          "dpi": {
            "title": "OCR resolution (dpi)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "The resolution at which PDF pages are drawn before OCR. 200 is right for normal print; 300 for small text; 100 is faster and less exact.",
            "default": 200
          },
          "includePages": {
            "title": "Include the text of each page",
            "type": "boolean",
            "description": "Add the text, method and OCR confidence of every page in `pages`. Turn it off for smaller records: `text` always has everything.",
            "default": true
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "The password of protected PDFs. The same password is tried on every protected file."
          },
          "requestTimeoutSeconds": {
            "title": "Seconds to wait for a download",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Give up on a file that has not downloaded after this many seconds.",
            "default": 60
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip documents that earlier runs of this same input already returned, so you get and pay for new ones only. The first run works as usual and remembers what it returned, in your key-value store 'pdf-ocr-text-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many documents. You are charged per document returned.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Files at the same time",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many files are read at the same time. OCR uses a lot of processor: raise it only with more memory and CPU in the run's settings.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed to start. Turn it on only if a server refuses the Actor's address; the proxy then takes over while the address rests.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}