{
  "openapi": "3.0.1",
  "info": {
    "title": "Pdf Power Tools",
    "description": "Split, merge, compress, convert & OCR PDFs via API. Extract text from scanned documents in 14 languages. Compress files for email, convert pages to PNG/JPEG/WebP, split by pages or ranges, merge multiple PDFs. Perfect for document automation & data extraction workflows.",
    "version": "1.0",
    "x-build-id": "q7gWhkfIbeXh2VLMS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agenscrape~pdf-power-tools/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agenscrape-pdf-power-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/agenscrape~pdf-power-tools/runs": {
      "post": {
        "operationId": "runs-sync-agenscrape-pdf-power-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/agenscrape~pdf-power-tools/run-sync": {
      "post": {
        "operationId": "run-sync-agenscrape-pdf-power-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": [
              "info",
              "enhance",
              "split",
              "merge",
              "compress",
              "convert",
              "ocr",
              "thumbnail"
            ],
            "type": "string",
            "description": "What operation to perform on the PDF(s)",
            "default": "info"
          },
          "pdfUrl": {
            "title": "PDF URL",
            "type": "string",
            "description": "URL to a PDF file to process"
          },
          "pdfUrls": {
            "title": "PDF URLs (for merge)",
            "type": "array",
            "description": "List of PDF URLs to merge together",
            "items": {
              "type": "string"
            }
          },
          "pdfBase64": {
            "title": "PDF Base64",
            "type": "string",
            "description": "Base64 encoded PDF content (alternative to URL)"
          },
          "sharpen": {
            "title": "Sharpen Images",
            "type": "boolean",
            "description": "Apply sharpening to enhance clarity (for enhance operation)",
            "default": true
          },
          "denoise": {
            "title": "Reduce Noise",
            "type": "boolean",
            "description": "Apply noise reduction filter (for enhance operation)",
            "default": true
          },
          "contrast": {
            "title": "Contrast Level",
            "minimum": 0.5,
            "maximum": 3,
            "type": "number",
            "description": "Contrast adjustment (1.0 = normal, 1.2 = 20% more contrast)",
            "default": 1.2
          },
          "brightness": {
            "title": "Brightness Level",
            "minimum": 0.5,
            "maximum": 2,
            "type": "number",
            "description": "Brightness adjustment (1.0 = normal)",
            "default": 1
          },
          "splitMode": {
            "title": "Split Mode",
            "enum": [
              "each_page",
              "ranges",
              "half",
              "extract",
              "by_size"
            ],
            "type": "string",
            "description": "How to split the PDF",
            "default": "each_page"
          },
          "ranges": {
            "title": "Page Ranges",
            "type": "array",
            "description": "Page ranges to split by (e.g., 1-5, 6-10, 11-15)",
            "items": {
              "type": "string"
            }
          },
          "pages": {
            "title": "Specific Pages",
            "type": "array",
            "description": "Specific pages to extract or convert (e.g., 1, 3, 5, 7)",
            "items": {
              "type": "string"
            }
          },
          "compressionPreset": {
            "title": "Compression Preset",
            "enum": [
              "low",
              "medium",
              "high",
              "screen",
              "print"
            ],
            "type": "string",
            "description": "Compression quality level",
            "default": "medium"
          },
          "imageQuality": {
            "title": "Image Quality",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "JPEG quality for images (10-100)"
          },
          "targetSizeKB": {
            "title": "Target Size (KB)",
            "minimum": 100,
            "type": "integer",
            "description": "Try to compress to this file size in KB"
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "png",
              "jpeg",
              "webp",
              "tiff"
            ],
            "type": "string",
            "description": "Image format for conversion",
            "default": "png"
          },
          "dpi": {
            "title": "DPI Resolution",
            "minimum": 72,
            "maximum": 600,
            "type": "integer",
            "description": "Output resolution in DPI",
            "default": 150
          },
          "quality": {
            "title": "Output Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Output image quality (1-100)",
            "default": 90
          },
          "singleImage": {
            "title": "Combine as Single Image",
            "type": "boolean",
            "description": "Combine all pages into one tall image",
            "default": false
          },
          "language": {
            "title": "OCR Language",
            "enum": [
              "eng",
              "fra",
              "deu",
              "spa",
              "ita",
              "por",
              "nld",
              "pol",
              "rus",
              "chi_sim",
              "chi_tra",
              "jpn",
              "kor",
              "ara"
            ],
            "type": "string",
            "description": "Language for text recognition",
            "default": "eng"
          },
          "preprocess": {
            "title": "Preprocess Images",
            "type": "boolean",
            "description": "Apply image preprocessing for better OCR results",
            "default": true
          },
          "order": {
            "title": "Merge Order",
            "type": "array",
            "description": "Custom order for merging PDFs (e.g., [2, 0, 1] to put 3rd PDF first)"
          },
          "interleave": {
            "title": "Interleave Pages",
            "type": "boolean",
            "description": "Interleave pages from all PDFs instead of sequential merge",
            "default": false
          },
          "pagesToRemove": {
            "title": "Pages to Remove",
            "type": "array",
            "description": "Page numbers to remove from the PDF",
            "items": {
              "type": "string"
            }
          },
          "newPageOrder": {
            "title": "New Page Order",
            "type": "array",
            "description": "Reorder pages (e.g., [3, 1, 2, 4] to put page 3 first)"
          },
          "thumbnailWidth": {
            "title": "Thumbnail Width",
            "minimum": 50,
            "maximum": 500,
            "type": "integer",
            "description": "Width of thumbnail in pixels",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}