{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader: URL List to Storage & ZIP",
    "description": "Download files from a list of URLs or a dataset field into Apify storage: one row per file with a download link, content type, size and SHA-256, plus an optional ZIP of everything. Filter by extension or type, set size limits. Failed downloads are free. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "Hih8dA3nwLqzzpdAf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-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/ucchiii~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-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/ucchiii~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-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 the files to download, one per line, e.g. 'https://example.com/report.pdf'. Without a scheme, https:// is used. Duplicates are removed; up to 5,000 URLs per run (the rest are skipped). Leave empty (and no dataset) for a free demo (not charged).",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with URLs",
            "type": "string",
            "description": "Optional. ID of a dataset (for example a finished run's 'defaultDatasetId') whose items contain file URLs, such as the output of a scraper. The URLs are added after the list above; the 5,000-URL cap applies to the total."
          },
          "urlField": {
            "title": "URL field in dataset",
            "type": "string",
            "description": "Field of each dataset item that holds the URL. Use dots for nested fields, e.g. 'product.image' or 'images.0'. The field may also hold a list of URLs (e.g. 'imageUrls'): every URL in it is downloaded. Default 'url'.",
            "default": "url"
          },
          "createZip": {
            "title": "Create ZIP",
            "type": "boolean",
            "description": "Also put all saved files into one ZIP archive (key 'files.zip' in the key-value store; its link is in the SUMMARY record and the run's output tab). Same file names get -2, -3... Images, PDFs and archives are stored without recompression. No extra charge.",
            "default": false
          },
          "zipMaxSizeMb": {
            "title": "ZIP size limit (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Largest total size of the files that go into the ZIP (1 to 500 MB, default 200). Files that no longer fit are still saved one by one, only left out of the ZIP (inZip: false). For a ZIP over 200 MB, give the run 2 GB of memory or more.",
            "default": 200
          },
          "allowedExtensions": {
            "title": "Allowed extensions",
            "type": "array",
            "description": "Optional. Save only files whose name ends in one of these extensions, e.g. 'pdf', 'jpg', 'png' (without dot, case does not matter). The name comes from the server's Content-Disposition header or the URL path; when it has no extension, one is taken from the content type. Others become filtered_out rows (free). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "allowedContentTypes": {
            "title": "Allowed content types",
            "type": "array",
            "description": "Optional. Save only files whose Content-Type matches, e.g. 'application/pdf' (exact) or 'image/*' (all images). Use it to skip HTML error pages served instead of a file. Others become filtered_out rows (free). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this are not saved (status too_large, free). Checked from the Content-Length header before downloading, and again while reading. 1 to 500 MB, default 50. For files over 100 MB, raise the run's memory.",
            "default": 50
          },
          "maxTotalSizeMb": {
            "title": "Total size limit (MB)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop downloading once the files saved in this run reach this total (1 to 20,000 MB, default 1,000). The remaining URLs get status skipped_total_limit and are free. Keeps the cost of a run predictable.",
            "default": 1000
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many files are downloaded in parallel in total (1 to 20, default 5). Per-host limits below still apply.",
            "default": 5
          },
          "maxConnectionsPerHost": {
            "title": "Max connections per host",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many downloads may run at the same time against one host name (1 to 10, default 2). Keep it low for small websites.",
            "default": 2
          },
          "delayPerHostSecs": {
            "title": "Delay per host (seconds)",
            "minimum": 0.1,
            "maximum": 30,
            "type": "number",
            "description": "Minimum time between the start of two requests to the same host (0.1 to 30 seconds, default 0.5). Requests to different hosts are not delayed.",
            "default": 0.5
          },
          "timeoutSecs": {
            "title": "Timeout (seconds)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout for connecting and for each read while downloading, in seconds (1 to 300, default 60). A large file may take longer in total as long as data keeps coming.",
            "default": 60
          },
          "maxRedirects": {
            "title": "Max redirects",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many redirects are followed per file (0 to 10, default 5). Every hop is checked: redirects to internal network addresses are refused.",
            "default": 5
          },
          "retries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "How many times a download is retried after a timeout, a connection error or HTTP 429/500/502/503/504 (0 to 5, default 2), with a short wait in between. Retries are not charged.",
            "default": 2
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "Optional custom User-Agent header. By default the requests identify this Actor."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}