{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File & Image Downloader: URLs or Datasets to ZIP",
    "description": "Download images, PDFs, documents, audio and video from URL lists, Apify dataset fields or web pages into one ZIP and/or storage with direct links. Type and size checks, retries, duplicate skipping, optional resize and WebP/JPEG/AVIF conversion. $1 per 1,000 files.",
    "version": "1.0",
    "x-build-id": "08UTykaymBJgTbizv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/4b47~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-4b47-bulk-file-downloader",
        "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/4b47~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-4b47-bulk-file-downloader",
        "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/4b47~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-4b47-bulk-file-downloader",
        "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": {
          "urls": {
            "title": "File URLs",
            "type": "array",
            "description": "Direct links to files, one per line (up to 100,000): images, PDFs, documents, audio, video, archives. base64 data: URLs work too. Links to web pages are refused unless \"Find files on web pages\" is on.",
            "items": {
              "type": "string"
            }
          },
          "datasetIds": {
            "title": "Datasets",
            "type": "array",
            "description": "Apify datasets whose rows contain file URLs (e.g. the output of a product or real-estate scraper). Name the fields in \"URL fields\". Picking a dataset gives this actor read access to it only."
          },
          "urlFields": {
            "title": "URL fields (for datasets)",
            "type": "array",
            "description": "Dataset fields that hold file URLs: a URL, a list of URLs, or objects with a url/src field (e.g. images: [{\"url\": ...}]). Nested paths: media.images. Example: imageUrl, images, pdfLink.",
            "items": {
              "type": "string"
            }
          },
          "fileTypes": {
            "title": "File types",
            "type": "array",
            "description": "Keep only these types (checked from the file's first bytes, not just its extension). Other files are refused before they download and are free.",
            "items": {
              "type": "string",
              "enum": [
                "any",
                "image",
                "pdf",
                "document",
                "audio",
                "video",
                "archive",
                "text"
              ],
              "enumTitles": [
                "Any file",
                "Images",
                "PDFs",
                "Documents (Word, Excel, PowerPoint, ODF, EPUB)",
                "Audio",
                "Video",
                "Archives (ZIP, 7z, RAR, gzip)",
                "Text (TXT, CSV, JSON, XML)"
              ]
            },
            "default": [
              "any"
            ]
          },
          "createZip": {
            "title": "Create a ZIP",
            "type": "boolean",
            "description": "Put all files into files.zip (more parts if it grows past the part size). Download it from the run's Output tab.",
            "default": true
          },
          "saveToKeyValueStore": {
            "title": "Save each file with a direct link",
            "type": "boolean",
            "description": "Store every file as its own record in the run's key-value store; each dataset item gets a fileUrl you can open or pass on.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Larger files are skipped (free); when the server announces the size they are not even downloaded. Keep (parallel downloads x this size + ZIP part size) under the run's disk, which is 2x its memory.",
            "default": 100
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "{name} = original name (from Content-Disposition or the URL), {ext} = extension of the stored file, {index} = position in the input (00001), {hash} = first 12 characters of the SHA-256, {host} = website. \"/\" makes folders in the ZIP, e.g. {host}/{index}-{name}.{ext}. Repeated names get -2, -3.",
            "default": "{name}.{ext}"
          },
          "dedupeByContent": {
            "title": "Skip identical files",
            "type": "boolean",
            "description": "Files with the same content (SHA-256) as an earlier one are not stored again and not charged; the item says which file it duplicates.",
            "default": true
          },
          "imageFormat": {
            "title": "Convert images to",
            "enum": [
              "original",
              "jpeg",
              "png",
              "webp",
              "avif"
            ],
            "type": "string",
            "description": "Convert JPEG, PNG, WebP, GIF, AVIF and TIFF images. Other files (and SVG) stay as they are.",
            "default": "original"
          },
          "imageMaxWidth": {
            "title": "Max image width (px)",
            "minimum": 16,
            "maximum": 16000,
            "type": "integer",
            "description": "Shrink larger images to this width, keeping the aspect ratio (never enlarges). Empty = no resize."
          },
          "imageMaxHeight": {
            "title": "Max image height (px)",
            "minimum": 16,
            "maximum": 16000,
            "type": "integer",
            "description": "Shrink larger images to this height, keeping the aspect ratio. Empty = no resize."
          },
          "imageQuality": {
            "title": "Image quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1-100 for JPEG, WebP and AVIF output.",
            "default": 82
          },
          "scanPages": {
            "title": "Find files on web pages",
            "type": "boolean",
            "description": "When a URL is a web page, download the images (img, srcset, og:image), video/audio sources and linked files (PDF, ZIP, DOCX, ...) it contains, filtered by File types. One level deep; robots.txt is respected.",
            "default": false
          },
          "maxFilesPerPage": {
            "title": "Max files per page",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit of files taken from one web page.",
            "default": 200
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many downloaded files. Empty = all."
          },
          "zipPartSizeMb": {
            "title": "ZIP part size (MB)",
            "minimum": 50,
            "maximum": 3900,
            "type": "integer",
            "description": "A new ZIP part starts when the current one would pass this size (also keeps disk use bounded: the run's disk is 2x its memory).",
            "default": 500
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "Files downloaded at the same time. Requests to one website are spaced at least 250 ms apart.",
            "default": 8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}