{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader - URL List or Dataset to Files & ZIP",
    "description": "Download files in bulk from a URL list, CSV/JSON file, Google Sheet or Apify dataset field. Saves PDFs, images, audio and video with public links, SHA-256 and MIME type, or packs them into ZIP files. Filters, dedupe, retries. Pay only per file.",
    "version": "0.1",
    "x-build-id": "5cPZuwspTR7Wo61Id"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-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/gazidev~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-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/gazidev~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-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 of any type: PDF, images, audio, video, ZIP, Office documents, CSV... One URL per line. Social media and video platforms (YouTube, TikTok, Instagram, Facebook, X, Vimeo...) are blocked.",
            "items": {
              "type": "string"
            }
          },
          "bulkText": {
            "title": "Bulk paste (any text containing URLs)",
            "type": "string",
            "description": "Paste a column from a spreadsheet, a list, HTML or any text: every http(s) URL in it is downloaded."
          },
          "urlListFile": {
            "title": "URL list file (CSV, TSV, TXT, JSON, JSONL)",
            "type": "string",
            "description": "Upload a file or paste a link to one. CSV/TSV: URLs are taken from the columns named in `fieldPaths` (or from every cell). JSON: an array of URLs, or an array of objects read with `fieldPaths`. TXT: one URL per line."
          },
          "googleSheetUrl": {
            "title": "Google Sheet link",
            "type": "string",
            "description": "Normal share link (the sheet must be shared as 'Anyone with the link can view') or a 'Publish to web' CSV link. Add `#gid=...` to pick a tab. Columns are selected with `fieldPaths`."
          },
          "datasetId": {
            "title": "Apify dataset ID (chain with another Actor)",
            "type": "string",
            "description": "Download the files referenced in another run's dataset, e.g. a product, real-estate or document scraper. Use `fieldPaths` to say where the URLs are. Several IDs can be comma-separated."
          },
          "fieldPaths": {
            "title": "Field paths / column names with URLs",
            "type": "string",
            "description": "Comma-separated. For datasets and JSON: `pdfUrl`, `images[*]`, `files[*].url`, `media.0.src`. For CSV / Google Sheets: column names. Empty = every URL found in the row."
          },
          "maxFiles": {
            "title": "Max files to download",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many files are saved (0 = no limit). Failed, filtered and duplicate URLs don't count.",
            "default": 0
          },
          "allowedExtensions": {
            "title": "Allowed extensions",
            "type": "array",
            "description": "Keep only these file types, e.g. `pdf`, `jpg`, `png`, `mp4`. The extension is detected from the file content, headers and URL. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "allowedContentTypes": {
            "title": "Allowed content types",
            "type": "array",
            "description": "Keep only these MIME types or prefixes, e.g. `image/`, `application/pdf`, `video/`. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "minFileSizeKb": {
            "title": "Minimum file size (KB)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip smaller files (icons, placeholders). 0 = no minimum.",
            "default": 0
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Larger files are skipped (download aborted as soon as the limit is passed, not charged).",
            "default": 500
          },
          "skipHtmlPages": {
            "title": "Skip HTML pages",
            "type": "boolean",
            "description": "If a 'file' link returns a web page instead (login wall, landing page, expired link), skip it for free instead of saving the HTML.",
            "default": true
          },
          "dedupe": {
            "title": "Remove duplicate files (SHA-256)",
            "type": "boolean",
            "description": "Byte-identical files under different URLs are saved once. Duplicates are never charged.",
            "default": true
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Placeholders: {index} (input position, 00001), {n} (saved count), {name} (original file name), {host}, {sha256}, {sha256_8}, {date}, {field:<column or path>} (value from the CSV/JSON/dataset row, e.g. {field:title}). Use `/` to create folders inside the ZIP. The extension is added automatically.",
            "default": "{index}_{name}"
          },
          "saveToKeyValueStore": {
            "title": "Save each file with a public link",
            "type": "boolean",
            "description": "Store every file in the key-value store and return a direct download link (`storedUrl`). Turn off to get only the ZIP.",
            "default": true
          },
          "createZip": {
            "title": "Create ZIP archive",
            "type": "boolean",
            "description": "Bundle all files into `files.zip` (ZIP64, no 4 GB limit). Charged once per ZIP file.",
            "default": false
          },
          "zipPartSizeMb": {
            "title": "Split ZIP every N MB",
            "minimum": 0,
            "type": "integer",
            "description": "0 = one ZIP. Otherwise ZIPs are split into parts `files-001.zip`, `files-002.zip`... of about this size (handy for email or slow connections).",
            "default": 0
          },
          "zipName": {
            "title": "ZIP file name",
            "type": "string",
            "description": "Base name of the ZIP file(s).",
            "default": "files"
          },
          "zipCompress": {
            "title": "Compress ZIP (deflate)",
            "type": "boolean",
            "description": "Off = store files as-is (fast; best for images, video, PDF, which are already compressed). On = smaller ZIP for text, CSV, JSON, XML.",
            "default": false
          },
          "keyValueStoreName": {
            "title": "Named key-value store (optional)",
            "type": "string",
            "description": "Save files and ZIPs into this named store, which is kept forever (default run storage expires with your plan's retention)."
          },
          "includeSkipped": {
            "title": "List skipped files and duplicates in the dataset",
            "type": "boolean",
            "description": "Free rows for filtered and duplicate files. Failed and blocked URLs are always listed (free).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max parallel downloads",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Total number of downloads running at the same time.",
            "default": 10
          },
          "maxConcurrencyPerHost": {
            "title": "Max parallel downloads per host",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Politeness limit per website, so a single server isn't overloaded.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Connection / read inactivity timeout per request.",
            "default": 60
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for timeouts, connection errors, 429 and 5xx responses, with exponential backoff (Retry-After respected).",
            "default": 3
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "Custom User-Agent. Empty = a default that identifies this Actor (some sites, like Wikimedia, require that)."
          },
          "headers": {
            "title": "Extra HTTP headers",
            "type": "object",
            "description": "Optional headers sent with every request, e.g. {\"Authorization\": \"Bearer ...\"} for your own server or bucket."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}