{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Toolkit API – Merge, Split, Compress, PDF to Image",
    "description": "Merge, split, compress, rotate and extract pages from PDFs by URL, convert PDF to PNG/JPG images or read PDF info (pages, metadata, encryption, text layer). Download links for every file. No API key, no uploads to third parties. Pay per output file.",
    "version": "1.0",
    "x-build-id": "KwTLjTHgjmkDnRaV8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fast_data_asap~pdf-toolkit-merge-split-compress/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fast_data_asap-pdf-toolkit-merge-split-compress",
        "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/fast_data_asap~pdf-toolkit-merge-split-compress/runs": {
      "post": {
        "operationId": "runs-sync-fast_data_asap-pdf-toolkit-merge-split-compress",
        "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/fast_data_asap~pdf-toolkit-merge-split-compress/run-sync": {
      "post": {
        "operationId": "run-sync-fast_data_asap-pdf-toolkit-merge-split-compress",
        "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": {
          "operation": {
            "title": "Operation",
            "enum": [
              "merge",
              "split",
              "extract",
              "compress",
              "rotate",
              "toImages",
              "info"
            ],
            "type": "string",
            "description": "What to do with the PDFs. merge = combine all PDFs into one file (in the given order). split = one file per N pages or per range. extract = one new PDF with the selected pages. compress = make PDFs smaller. rotate = turn pages. toImages = one PNG/JPG per page. info = page count, size, encryption, metadata and text layer check (no file output).",
            "default": "merge"
          },
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files (public URLs, signed S3/Drive download links, Apify key-value store records...). For merge, the order here is the page order of the result.",
            "items": {
              "type": "string"
            }
          },
          "outputName": {
            "title": "Output file name",
            "type": "string",
            "description": "Optional base name of the result file(s), without .pdf. Default: 'merged' for merge, otherwise the source file name."
          },
          "everyNPages": {
            "title": "Split: every N pages",
            "minimum": 1,
            "type": "integer",
            "description": "split: create one file every N pages (1 = one PDF per page). Ignored when 'Split: ranges' is set.",
            "default": 1
          },
          "ranges": {
            "title": "Split: ranges",
            "type": "string",
            "description": "split: comma-separated page ranges, one output file per range, e.g. \"1-3,4-6,7-\" (7- = page 7 to the end, 'last' = last page)."
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "extract: pages to keep in one new PDF, e.g. \"1-3,5,last\". rotate: pages to rotate (empty = all pages). toImages: pages to render (empty = all, up to Max pages)."
          },
          "degrees": {
            "title": "Rotate: degrees",
            "minimum": -270,
            "maximum": 270,
            "type": "integer",
            "description": "rotate: clockwise rotation, 90, 180 or 270 (-90 = counter-clockwise).",
            "default": 90
          },
          "compressionLevel": {
            "title": "Compress: quality",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "compress: low = smallest file (images downsampled to 72 dpi, JPEG quality 45), medium = balanced for e-mail (110 dpi, quality 65), high = light compression, print-friendly (150 dpi, quality 80). All levels also remove unused objects, duplicate resources, thumbnails and XMP metadata, subset fonts and pack objects into compressed object streams.",
            "default": "medium"
          },
          "dpi": {
            "title": "Images: DPI",
            "minimum": 36,
            "maximum": 400,
            "type": "integer",
            "description": "toImages: resolution. 72 = screen thumbnail, 150 = sharp preview, 300 = print / OCR.",
            "default": 150
          },
          "imageFormat": {
            "title": "Images: format",
            "enum": [
              "png",
              "jpg"
            ],
            "type": "string",
            "description": "toImages: PNG (lossless, best for text) or JPG (smaller, best for photos/scans).",
            "default": "png"
          },
          "maxPages": {
            "title": "Images: max pages per PDF",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "toImages: maximum number of pages rendered per PDF (each image is one billed file).",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Larger PDFs are skipped with status too_large (not charged). Raise memory for very large files.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}