{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Image, Split, Merge, Rotate & Images to PDF",
    "description": "PDF to image converter and toolkit: convert PDF pages to PNG, JPEG or WebP at any DPI, make thumbnails, split PDFs by page ranges, merge PDFs, rotate pages, and turn images into a PDF. Files from URLs or your key-value stores. Also reads PDF metadata.",
    "version": "0.1",
    "x-build-id": "gZPcjBcDfLXoWBHnB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maliksaid~pdf-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maliksaid-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/maliksaid~pdf-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-maliksaid-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/maliksaid~pdf-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-maliksaid-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",
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "pdfToImages",
              "split",
              "merge",
              "rotate",
              "organize",
              "imagesToPdf",
              "compress",
              "info"
            ],
            "type": "string",
            "description": "What to do with the files. Pages to images renders each chosen page as PNG, JPEG or WebP. Split makes smaller PDFs. Merge joins all PDFs into one, in input order. Rotate turns pages. Remove or reorder pages makes one PDF per input with the pages you keep, in the order you set. Images to PDF makes one PDF with one image per page. Compress makes a smaller PDF by re-encoding its photos and scans. PDF info returns metadata and page sizes.",
            "default": "pdfToImages"
          },
          "startUrls": {
            "title": "File URLs",
            "type": "array",
            "description": "Links to your PDF files, or to images for Images to PDF. Each link must point straight to a file. The Actor checks robots.txt before it downloads a file and skips files that robots.txt blocks. Private network addresses are refused.",
            "default": [
              {
                "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStores": {
            "title": "Files in your Apify key-value stores",
            "type": "array",
            "description": "Pick key-value stores that hold your files. The run gets read access to these stores only. Use this for files you uploaded to Apify or saved from another Actor."
          },
          "keyValueStoreKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Keys of the records to read from the chosen stores, for example report.pdf. Leave empty to use every PDF (or every image, for Images to PDF) in the stores, in key order.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Pages to use, for example 1-3, 5, 8-. 'last' is the last page and 'last-1' the one before it. Leave empty for every page. Used by Pages to images, Rotate, Split (every page, every N pages and chosen pages) and Remove or reorder pages (the pages to keep, in document order, when Page order is empty).",
            "default": ""
          },
          "imageFormat": {
            "title": "Image format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Format of the page images. PNG keeps text sharpest. JPEG and WebP make smaller files.",
            "default": "png"
          },
          "dpi": {
            "title": "Resolution (DPI)",
            "minimum": 36,
            "maximum": 300,
            "type": "integer",
            "description": "Dots per inch. 72 is screen size, 150 suits reading and OCR, 300 suits print. A US Letter page at 150 DPI is 1275 x 1650 pixels. Very large pages are scaled down to 25 million pixels.",
            "default": 150
          },
          "maxImageWidth": {
            "title": "Maximum image width (pixels)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Scale images down to at most this width, for thumbnails or previews. For example 300. 0 keeps the size from the DPI.",
            "default": 0
          },
          "imageQuality": {
            "title": "JPEG and WebP quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Higher means sharper and larger files. PNG ignores this.",
            "default": 85
          },
          "singleImage": {
            "title": "All pages in one image",
            "type": "boolean",
            "description": "Pages to images: join the chosen pages top to bottom in one tall image. Up to 20 pages, 30,000 pixels high and 20 million pixels (about 20 A4 or Letter pages at 100 DPI, or 9 at 150 DPI); above that, one image per page is saved. Each page still counts as one page image.",
            "default": false
          },
          "splitMode": {
            "title": "Split mode",
            "enum": [
              "everyPage",
              "everyN",
              "ranges",
              "selected"
            ],
            "type": "string",
            "description": "How to split each PDF. Every page and every N pages use only the pages in Pages.",
            "default": "everyPage"
          },
          "splitEvery": {
            "title": "Pages per part (every N pages)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Number of pages in each part when Split mode is every N pages. The last part can be shorter.",
            "default": 2
          },
          "splitRanges": {
            "title": "Split ranges",
            "type": "array",
            "description": "One output PDF per range, when Split mode is one PDF per range. For example 1-2 and 3-last.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "rotateDegrees": {
            "title": "Rotation",
            "enum": [
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "How far to turn the pages in Pages. Other pages stay as they are.",
            "default": "90"
          },
          "pageOrder": {
            "title": "Page order",
            "type": "string",
            "description": "For Remove or reorder pages. The new page order, for example 3, 1, 2, 5-. Pages not listed are left out. A page can appear twice. 6-1 counts down, so 6-1 reverses a 6-page PDF. A page past the end fails that PDF with a clear error. Leave empty to keep the pages in Pages, in document order.",
            "default": ""
          },
          "removePages": {
            "title": "Remove pages",
            "type": "string",
            "description": "For Remove or reorder pages. Pages to drop, for example 2, 7-9, last. Applied after Page order or Pages. Leave empty to drop nothing.",
            "default": ""
          },
          "compressLevel": {
            "title": "Compression level",
            "enum": [
              "light",
              "balanced",
              "strong"
            ],
            "type": "string",
            "description": "Compress only. Light keeps image size at JPEG quality 80. Balanced (default) caps images at 2,000 pixels on the long side, quality 70, about 170 DPI on A4. Strong caps at 1,400 pixels, quality 55. Text and drawings are never changed.",
            "default": "balanced"
          },
          "watermarkText": {
            "title": "Watermark text",
            "type": "string",
            "description": "Optional. Draws this text diagonally on every page of every output PDF (split, merge, rotate, remove or reorder, compress and images to PDF). Latin letters, digits and common symbols only, up to 100 characters.",
            "default": ""
          },
          "watermarkOpacity": {
            "title": "Watermark opacity",
            "minimum": 0.05,
            "maximum": 1,
            "type": "number",
            "description": "0.05 (faint) to 1 (solid). Default 0.15.",
            "default": 0.15
          },
          "outputFileName": {
            "title": "Output file name",
            "type": "string",
            "description": "Name of the PDF that Merge or Images to PDF makes, for example contract-pack.pdf. Leave empty for merged.pdf or images.pdf.",
            "default": ""
          },
          "pageSize": {
            "title": "Page size (Images to PDF)",
            "enum": [
              "image",
              "A4",
              "Letter"
            ],
            "type": "string",
            "description": "Same as the image makes each page the size of its picture at 96 pixels per inch. A4 and US Letter fit each picture on the page and turn the page to landscape for wide pictures.",
            "default": "image"
          },
          "marginPt": {
            "title": "Margin (points)",
            "minimum": 0,
            "maximum": 144,
            "type": "integer",
            "description": "White border around each image in Images to PDF. 72 points is one inch.",
            "default": 0
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password to open protected PDFs for Pages to images and PDF info. Split, merge and rotate need unencrypted PDFs."
          },
          "maxItems": {
            "title": "Maximum output files",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after saving this many output files (images, PDFs or info records). The default keeps test runs short and cheap. Set 0 for no limit.",
            "default": 100
          },
          "maxPagesPerPdf": {
            "title": "Maximum pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Use at most this many pages of each PDF. Larger PDFs are refused by Rotate and Merge. Set 0 for no limit.",
            "default": 500
          },
          "maxPagesPerRun": {
            "title": "Maximum pages per run",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the run after this many pages rendered, split, rotated or merged in total. Set 0 for no limit.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip files larger than this. The hard limit is 100 MB. Larger files need more memory.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}