{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader - URL List, Images, Video & Audio",
    "description": "Download a list of file URLs in bulk, or save every image, video and audio file found on a list of pages, straight into the run's key-value store. Each file is stored the moment it lands, with a dataset row of its metadata. Priced per file and per 10 MB moved, zipped on request, resumable.",
    "version": "0.1",
    "x-build-id": "xngZ1ajHWizlt2rDB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rationalistic_candle_ucn~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rationalistic_candle_ucn-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/rationalistic_candle_ucn~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-rationalistic_candle_ucn-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/rationalistic_candle_ucn~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-rationalistic_candle_ucn-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "File URLs to download, one per line, or page URLs when Crawl pages is on. You are responsible for having the right to download and store what you point this Actor at. URLs on refused hosts (major social and media platforms, and sites whose terms forbid automated access) are rejected here, before any request is made, and get a dataset row saying so.",
            "items": {
              "type": "string"
            }
          },
          "crawlPages": {
            "title": "Crawl pages",
            "type": "boolean",
            "description": "When a URL returns an HTML page, collect the files it shows (img and source src and srcset, video and audio src, and links to files) on the same host, and download those. Pages found on pages are not crawled.",
            "default": false
          },
          "fileTypes": {
            "title": "File types",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Which kinds of file to keep, matched on Content-Type first and the URL's extension second: image, video, audio, document, archive, or any.",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "audio",
                "document",
                "archive",
                "any"
              ],
              "enumTitles": [
                "Images",
                "Video",
                "Audio",
                "Documents",
                "Archives",
                "Any file"
              ]
            },
            "default": [
              "image"
            ]
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many files have been stored. The run ends cleanly and says how many URLs were left.",
            "default": 1000
          },
          "maxFileBytes": {
            "title": "Max file size (bytes)",
            "minimum": 1,
            "maximum": 1073741824,
            "type": "integer",
            "description": "A file larger than this is skipped with a dataset row and is not charged. Default 104857600 (100 MB).",
            "default": 104857600
          },
          "maxTotalBytes": {
            "title": "Max total bytes",
            "minimum": 1,
            "maximum": 107374182400,
            "type": "integer",
            "description": "Stop when the files stored add up to this. Default 2147483648 (2 GB). The run ends cleanly and says how many URLs were left.",
            "default": 2147483648
          },
          "zip": {
            "title": "Zip",
            "enum": [
              "none",
              "single",
              "perHost"
            ],
            "type": "string",
            "description": "After downloading, also store the files as zip archives: none, one zip for the whole run (single), or one per host (perHost). Zips are split into parts of at most 500 MB, stored as zip-part-001.zip and so on.",
            "default": "none"
          },
          "uniqueFileNames": {
            "title": "Unique file names",
            "type": "boolean",
            "description": "Store each file as files-<short hash of the URL>-<original name>, so two files with the same name never collide. Off, the name stands alone and a second file of the same name gets a numeric suffix.",
            "default": true
          },
          "resumeFromRunId": {
            "title": "Resume from run",
            "type": "string",
            "description": "The ID of an earlier run of this Actor. Files already present in that run's key-value store are skipped (and not charged), so a run that stopped part-way can be picked up without paying twice.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}