{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader for Images, PDFs, Video and Audio",
    "description": "Bulk file downloader: download images, PDFs, video and audio from a list of links or from any scraper's results. Each file gets a download link, size, real type, SHA-256 and image size; optional ZIP archives. Failed downloads are free. No login. Maintained by CleanScrape.",
    "version": "0.1",
    "x-build-id": "MnDRtj42YILODzGvw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanscrape~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanscrape-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/cleanscrape~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-cleanscrape-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/cleanscrape~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-cleanscrape-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 links",
            "type": "array",
            "description": "One link per line to a file: images, PDFs, documents, video, audio, archives. You can also paste a block of text, a numbered list, Markdown or HTML: every web link in it is used. Each repeated link is downloaded once.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Links from a dataset (optional)",
            "type": "string",
            "description": "A dataset whose rows hold file links, for example the results of a scraper run. Its links are added to the ones above (remove the sample links there)."
          },
          "datasetFields": {
            "title": "Fields with links (optional)",
            "type": "array",
            "description": "The fields that hold the file links, such as image or images or media.url (a dot goes into a list or object). Leave empty to take every link that points to a file (.jpg, .pdf, .mp4 and the like) or sits in a field named like image, photo, thumbnail, video, audio, file, download or media.",
            "items": {
              "type": "string"
            }
          },
          "fileTypes": {
            "title": "File types to keep",
            "type": "array",
            "description": "The type is read from the file's first bytes, not only from the link. A file of another type is listed in the \"failed\" table and not charged. A link that opens a web page instead of a file is skipped unless you choose Documents.",
            "items": {
              "type": "string",
              "enum": [
                "any",
                "images",
                "videos",
                "audio",
                "documents",
                "archives"
              ],
              "enumTitles": [
                "Any file",
                "Images",
                "Videos",
                "Audio",
                "Documents (PDF, Office, text, CSV)",
                "Archives (ZIP, RAR, 7z, gz)"
              ]
            },
            "default": [
              "any"
            ]
          },
          "maxFiles": {
            "title": "Maximum files",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most links to download in one run, counted after repeated links are removed.",
            "default": 1000
          },
          "maxFileMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "A larger file is stopped while it downloads, listed in the \"failed\" table and not charged.",
            "default": 500
          },
          "fileNames": {
            "title": "File names",
            "enum": [
              "original",
              "hash"
            ],
            "type": "string",
            "description": "How each file is named in the key-value store and the ZIP archive. The right extension is added from the file's real type.",
            "default": "original"
          },
          "fileNameField": {
            "title": "Name files by a dataset field (optional)",
            "type": "string",
            "description": "For links from a dataset: name each file after a field of its row, such as title, name, sku or appId (product.name reaches inside an object). A row with several files gets name, name-2, name-3. Empty: the name comes from the link."
          },
          "zip": {
            "title": "Also make ZIP archives",
            "type": "boolean",
            "description": "Puts every downloaded file into ZIP archives (files-001.zip, files-002.zip...) in the key-value store, for downloading everything in one go. Archives cost a small extra amount per 10 MB of files in them (see Pricing); the files are also saved one by one either way.",
            "default": false
          },
          "zipMaxMb": {
            "title": "ZIP archive size (MB)",
            "minimum": 10,
            "maximum": 4000,
            "type": "integer",
            "description": "A new archive is started when one reaches this size.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Downloads at a time",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "At most 4 at a time go to one website, so a site is not overloaded.",
            "default": 8
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Download through Apify's datacenter proxy, for sites that block the cloud server's address. Most file hosts and CDNs do not need it.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}