{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Toolkit: Merge, Split, Compress, Images to/from PDF",
    "description": "Merge PDFs, split by page ranges, compress (re-encode and downscale images), convert JPG/PNG images to PDF, and render PDF pages to PNG or JPEG. Upload files or give URLs; download links in the results. Pay per output.",
    "version": "0.1",
    "x-build-id": "b8zuWYc3D3ft1etuP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quicktools~pdf-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quicktools-pdf-toolkit",
        "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/quicktools~pdf-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-quicktools-pdf-toolkit",
        "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/quicktools~pdf-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-quicktools-pdf-toolkit",
        "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",
              "imagesToPdf",
              "pdfToImages"
            ],
            "type": "string",
            "description": "Merge: all files into one PDF (in the order given). Split: page ranges into separate PDFs. Compress: smaller PDFs. Images to PDF: one PDF, one image per page. PDF to images: render pages to PNG/JPEG.",
            "default": "merge"
          },
          "files": {
            "title": "Files (upload or URL)",
            "type": "array",
            "description": "Upload files or paste public URLs. PDFs for merge/split/compress/PDF to images; JPEG, PNG, WebP, TIFF, GIF or BMP for Images to PDF."
          },
          "fileUrls": {
            "title": "File URLs (bulk list)",
            "type": "array",
            "description": "Public file URLs, one per line, combined with the field above (in order). Up to 200 files.",
            "items": {
              "type": "string"
            }
          },
          "pageRanges": {
            "title": "Page ranges (split / PDF to images)",
            "type": "string",
            "description": "e.g. 1-3,5,8- or last. Empty = all pages."
          },
          "splitMode": {
            "title": "Split mode",
            "enum": [
              "eachPage",
              "ranges"
            ],
            "type": "string",
            "description": "Each page: one PDF per page. Ranges: one PDF per comma-separated range (1-3,4-6 gives two files).",
            "default": "eachPage"
          },
          "imageFormat": {
            "title": "Image format (PDF to images)",
            "enum": [
              "png",
              "jpeg"
            ],
            "type": "string",
            "description": "PNG is lossless; JPEG is smaller for photos and scans.",
            "default": "png"
          },
          "dpi": {
            "title": "Resolution in DPI (PDF to images)",
            "minimum": 36,
            "maximum": 300,
            "type": "integer",
            "description": "150 is good for screens, 300 for print/OCR. Very large pages are capped at about 40 megapixels.",
            "default": 150
          },
          "jpegQuality": {
            "title": "JPEG quality",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Used for JPEG page images and for Images to PDF.",
            "default": 85
          },
          "pageSize": {
            "title": "Page size (Images to PDF)",
            "enum": [
              "A4",
              "Letter",
              "image"
            ],
            "type": "string",
            "description": "Images are scaled to fit with a small margin and never cropped.",
            "default": "A4"
          },
          "outputFileName": {
            "title": "Output file name (merge / Images to PDF)",
            "type": "string",
            "description": "Without extension. Default: merged / images."
          },
          "compressImageQuality": {
            "title": "Image quality when compressing",
            "minimum": 10,
            "maximum": 95,
            "type": "integer",
            "description": "JPEG quality for re-encoded images inside the PDF. Lower = smaller.",
            "default": 60
          },
          "compressMaxImagePx": {
            "title": "Max image size when compressing (px)",
            "minimum": 256,
            "maximum": 10000,
            "type": "integer",
            "description": "Images inside the PDF larger than this (longest side) are downscaled. 1600 px is about 200 DPI on a letter page.",
            "default": 1600
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "For password-protected PDFs you are allowed to open. Outputs are not encrypted."
          },
          "maxPagesPerRun": {
            "title": "Max pages per run",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Safety cap on the total pages processed in one run.",
            "default": 500
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped and not billed.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}