{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Tools (Merge / Split / Compress / OCR / Watermark)",
    "description": "All-in-one PDF processor: merge multiple PDFs, split by page ranges, compress file size, extract text, OCR scanned documents (Tesseract), add text watermarks, rotate pages, and read metadata. Accepts PDF URLs or Key-Value Store keys.",
    "version": "0.1",
    "x-build-id": "djimrF61TQiGFKcMz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrkrokko~pdf-tools/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrkrokko-pdf-tools",
        "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/mrkrokko~pdf-tools/runs": {
      "post": {
        "operationId": "runs-sync-mrkrokko-pdf-tools",
        "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/mrkrokko~pdf-tools/run-sync": {
      "post": {
        "operationId": "run-sync-mrkrokko-pdf-tools",
        "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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "merge",
              "split",
              "compress",
              "extractText",
              "ocr",
              "watermark",
              "rotate",
              "metadata",
              "pageCount"
            ],
            "type": "string",
            "description": "Which PDF operation to perform.",
            "default": "pageCount"
          },
          "pdfUrls": {
            "title": "PDF file URLs",
            "minItems": 1,
            "type": "array",
            "description": "Direct-download URLs to PDF files. For merge, order matters. API callers may also send a single 'pdfUrl' or Apify-style 'startUrls'.",
            "items": {
              "type": "string"
            }
          },
          "pdfKeys": {
            "title": "PDF Key-Value Store keys",
            "type": "array",
            "description": "Optional keys of PDF records stored in the run's default Key-Value Store. Useful for API workflows that upload files before running the Actor.",
            "items": {
              "type": "string"
            }
          },
          "pageRanges": {
            "title": "Page ranges (split/extract)",
            "type": "string",
            "description": "Comma-separated page ranges, e.g. '1-3,5,8-10'. 1-indexed. Used by split and extractText."
          },
          "watermarkText": {
            "title": "Watermark text",
            "type": "string",
            "description": "Text to overlay as watermark (operation=watermark)."
          },
          "watermarkOpacity": {
            "title": "Watermark opacity",
            "minimum": 0.01,
            "maximum": 1,
            "type": "number",
            "description": "Opacity of the watermark (0.0 = invisible, 1.0 = fully opaque).",
            "default": 0.15
          },
          "watermarkFontSize": {
            "title": "Watermark font size",
            "minimum": 10,
            "maximum": 200,
            "type": "integer",
            "description": "Font size in points for the watermark text.",
            "default": 60
          },
          "watermarkAngle": {
            "title": "Watermark rotation angle (degrees)",
            "minimum": 0,
            "maximum": 360,
            "type": "integer",
            "description": "Angle in degrees to rotate the watermark text.",
            "default": 45
          },
          "rotateAngle": {
            "title": "Rotation angle (degrees)",
            "enum": [
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "Clockwise rotation angle for pages. Must be a multiple of 90.",
            "default": "90"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "string",
            "description": "Tesseract language codes, e.g. 'eng', 'deu', 'eng+deu'. Pre-installed: eng, deu, fra, spa, ita, por.",
            "default": "eng"
          },
          "compressionLevel": {
            "title": "Compression level",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "How aggressively to compress.",
            "default": "medium"
          },
          "outputFileName": {
            "title": "Output file name",
            "type": "string",
            "description": "Base name for the output file in Key-Value Store (without .pdf extension). Auto-generated if empty."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}