{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to PDF & PDF to Image Converter – JPG, PNG, WebP",
    "description": "Convert images to PDF (JPG, PNG, WebP, HEIC, TIFF, GIF; one combined PDF, one per image or named groups; A4, Letter or fit-to-image; margins; compression) and PDF to images (PNG, JPG, WebP at any DPI, page ranges, ZIP, thumbnails). $2 per 1,000 pages.",
    "version": "0.1",
    "x-build-id": "iYYbKQM0yZ7VZymIh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~pdf-image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-pdf-image-converter",
        "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/gazidev~pdf-image-converter/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-pdf-image-converter",
        "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/gazidev~pdf-image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-pdf-image-converter",
        "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": "What do you want to do?",
            "enum": [
              "images-to-pdf",
              "pdf-to-images"
            ],
            "type": "string",
            "description": "Images to PDF uses the 'Images to PDF' section below; PDF to images uses the 'PDF to images' section.",
            "default": "images-to-pdf"
          },
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to JPG, PNG, WebP, HEIC/HEIF, AVIF, TIFF, BMP or GIF (first frame) files, in page order. Google Drive, Dropbox and GitHub share links work. Failed images are skipped and reported for free.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pdfMode": {
            "title": "Output",
            "enum": [
              "combine",
              "per-image"
            ],
            "type": "string",
            "description": "Ignored when 'PDF groups' is used (each group becomes one PDF).",
            "default": "combine"
          },
          "pdfGroups": {
            "title": "PDF groups (optional)",
            "type": "array",
            "description": "Make several named PDFs in one run, e.g. [{\"name\": \"invoice-1042\", \"imageUrls\": [\"https://…/p1.jpg\", \"https://…/p2.jpg\"]}, {\"name\": \"receipts-may\", \"imageUrls\": [\"…\"]}]. When set, 'Image URLs' is ignored.",
            "default": []
          },
          "outputFileName": {
            "title": "PDF file name (combined mode)",
            "type": "string",
            "description": "Without .pdf. Letters, digits, '-', '_' and '.' are kept.",
            "default": "images"
          },
          "pageSize": {
            "title": "Page size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5",
              "fit"
            ],
            "type": "string",
            "description": "Images are scaled to fit inside the page margins and centered, keeping their aspect ratio.",
            "default": "A4"
          },
          "orientation": {
            "title": "Orientation",
            "enum": [
              "auto",
              "portrait",
              "landscape"
            ],
            "type": "string",
            "description": "Not used with 'Fit to image'.",
            "default": "auto"
          },
          "marginMm": {
            "title": "Margin (mm)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "White border around each image. 0 = edge to edge.",
            "default": 10
          },
          "imageCompression": {
            "title": "Image compression",
            "enum": [
              "auto",
              "jpeg",
              "lossless"
            ],
            "type": "string",
            "description": "Auto never re-compresses JPG photos, so there is no quality loss and the PDF is about the size of the photos.",
            "default": "auto"
          },
          "maxImageSize": {
            "title": "Downscale images to max side (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "E.g. 2000 makes 12-megapixel phone photos about 4× smaller in the PDF (still sharp on A4 at 170+ DPI). 0 = keep original size.",
            "default": 0
          },
          "backgroundColor": {
            "title": "Background for transparent images",
            "type": "string",
            "description": "Hex colour used under transparent PNG/WebP areas.",
            "default": "#ffffff"
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 0,
            "type": "integer",
            "description": "Use only the first N image URLs. 0 = no limit.",
            "default": 0
          },
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files. Google Drive, Dropbox, GitHub and arXiv links work. Used when 'What do you want to do?' is 'PDF to images'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "imageFormat": {
            "title": "Image format",
            "enum": [
              "png",
              "jpg",
              "webp"
            ],
            "type": "string",
            "description": "Output format for pdf-to-images. PNG keeps text sharpest, JPG is smaller for photos, WebP is the smallest.",
            "default": "png"
          },
          "dpi": {
            "title": "Resolution (DPI)",
            "minimum": 36,
            "maximum": 600,
            "type": "integer",
            "description": "72 = screen preview, 150 = good default (1275×1650 px for a Letter page), 300 = print/OCR quality. Pages above 10 megapixels (e.g. 600 DPI) count as one page per started 10 MP.",
            "default": 150
          },
          "pageRange": {
            "title": "Pages",
            "type": "string",
            "description": "Empty = all pages. Examples: '1-5', '1,3,10-', '-3--1' (last 3 pages)."
          },
          "thumbnailsOnly": {
            "title": "Thumbnails only (first page)",
            "type": "boolean",
            "description": "Render only page 1 of each PDF at 'Thumbnail width' – for previews and catalogues.",
            "default": false
          },
          "thumbnailWidth": {
            "title": "Thumbnail width (px)",
            "minimum": 50,
            "maximum": 2000,
            "type": "integer",
            "description": "Width in pixels of the first-page thumbnail when thumbnail mode is on. Height keeps the page aspect ratio.",
            "default": 400
          },
          "createZip": {
            "title": "Also create a ZIP per PDF",
            "type": "boolean",
            "description": "All page images of a PDF in one ZIP (free). Every page row gets a zipUrl.",
            "default": false
          },
          "grayscale": {
            "title": "Grayscale",
            "type": "boolean",
            "description": "Render pages (pdf-to-images) in grayscale. Smaller files for scanned documents.",
            "default": false
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "For password-protected PDFs (the same password is tried for every PDF)."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 0
          },
          "maxPdfs": {
            "title": "Max PDFs",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 0
          },
          "quality": {
            "title": "JPG / WebP quality (1–100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Used for JPG/WebP page images and for images re-encoded into PDFs.",
            "default": 85
          },
          "maxFileSizeMb": {
            "title": "Max download size per file (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped for free.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many files are downloaded and processed in parallel. Lower it for very large files or low memory.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Only needed if a file host blocks datacenter IPs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}