{
  "openapi": "3.0.1",
  "info": {
    "title": "Searchable PDF OCR — Add a Text Layer to Scanned PDFs",
    "description": "Turn scanned or image-only PDFs into fully searchable, selectable, copy-pasteable PDFs. Keeps the original page image untouched and adds an invisible OCR text layer underneath.",
    "version": "0.1",
    "x-build-id": "qfj3EhH26C8wHraRY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/northbound_works~searchable-pdf-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-northbound_works-searchable-pdf-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/northbound_works~searchable-pdf-ocr/runs": {
      "post": {
        "operationId": "runs-sync-northbound_works-searchable-pdf-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/northbound_works~searchable-pdf-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-northbound_works-searchable-pdf-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",
        "required": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF URLs",
            "minItems": 1,
            "type": "array",
            "description": "Direct links to the PDFs you want to make searchable. Each must be a publicly reachable URL ending in a PDF file — not a viewer page. The original page images are preserved exactly; an invisible text layer is added underneath.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Document language",
            "enum": [
              "eng",
              "spa",
              "fra",
              "deu",
              "ita",
              "por",
              "nld",
              "pol",
              "rus",
              "ukr",
              "tur",
              "ara",
              "hin",
              "jpn",
              "kor",
              "chi_sim",
              "chi_tra",
              "vie",
              "ind",
              "swe",
              "dan",
              "nor",
              "fin",
              "ces",
              "ell",
              "heb"
            ],
            "type": "string",
            "description": "Language of the text in the scans. Picking the right one materially improves accuracy — English OCR on a German document produces garbage.",
            "default": "eng"
          },
          "mode": {
            "title": "How to handle pages that already have text",
            "enum": [
              "skip-text",
              "force-ocr",
              "redo-ocr"
            ],
            "type": "string",
            "description": "Most PDFs are a mix. 'Skip' is the safe default and the cheapest — it only OCRs pages that genuinely have no text, and you are only charged for those. Use 'Force' when a PDF has a bad existing text layer you want replaced.",
            "default": "skip-text"
          },
          "deskew": {
            "title": "Straighten crooked scans",
            "type": "boolean",
            "description": "Rotates slightly tilted pages back to level before reading them. Improves accuracy on photographed or hand-fed scans. Leave on unless your scans are already perfectly square.",
            "default": true
          },
          "rotatePages": {
            "title": "Auto-correct page orientation",
            "type": "boolean",
            "description": "Detects sideways or upside-down pages and rotates them upright.",
            "default": true
          },
          "cleanBeforeOcr": {
            "title": "Clean up speckle before reading",
            "type": "boolean",
            "description": "Removes scanner noise and speckle to help the reader. The cleaning is used only for recognition — the page you get back is still your original image, untouched.",
            "default": false
          },
          "optimize": {
            "title": "Output file size optimisation",
            "enum": [
              "0",
              "1",
              "2",
              "3"
            ],
            "type": "string",
            "description": "How hard to compress the resulting PDF. Levels above 1 can visibly soften images, so leave it at 1 unless file size matters more than fidelity.",
            "default": "1"
          },
          "includeTextInDataset": {
            "title": "Also return the extracted text",
            "type": "boolean",
            "description": "Puts the full recognised text of each document into the dataset alongside the download link, so you can search or process it without opening the PDF.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}