{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader - URLs to Files and ZIP",
    "description": "Download files from a list of URLs, web pages or another Actor's dataset: images, PDFs, video, audio. Fast and resumable, with SHA-256, image size, duplicates removed and optional ZIP. You pay only for files stored.",
    "version": "0.1",
    "x-build-id": "eCbBEeGrspIHYdCUO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~bulk-file-downloader-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-bulk-file-downloader-scraper",
        "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/pshivam~bulk-file-downloader-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-bulk-file-downloader-scraper",
        "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/pshivam~bulk-file-downloader-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-bulk-file-downloader-scraper",
        "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 (images, PDFs, video, audio, archives). Add them one by one, paste a list (one per line) or load a text file. Repeated addresses are downloaded once.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "pageUrls": {
            "title": "Or web pages to scan for files",
            "type": "array",
            "description": "Web pages whose images, videos, audio, documents and archives you want. Each page is read once (no further crawling); pages that load their images with JavaScript need a browser scraper first.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or a dataset of another Actor",
            "type": "string",
            "description": "The id of an Apify dataset (from another Actor's run). Every file link in its rows is downloaded: image, video, pdf and similar fields are found on their own."
          },
          "urlFields": {
            "title": "Dataset fields with the links",
            "type": "array",
            "description": "Only for a dataset: the fields that hold file links (imageUrl, images, media.main). Empty: find them on their own.",
            "items": {
              "type": "string"
            }
          },
          "fileTypes": {
            "title": "Only these kinds of files",
            "type": "array",
            "description": "Keep only these kinds. For web pages, only matching links are taken. A file of another kind is skipped and not charged. Empty: every kind.",
            "items": {
              "type": "string",
              "enum": [
                "any",
                "image",
                "document",
                "video",
                "audio",
                "archive",
                "other"
              ],
              "enumTitles": [
                "Any",
                "Images",
                "Documents",
                "Video",
                "Audio",
                "Archives",
                "Other"
              ]
            }
          },
          "sameHostOnly": {
            "title": "Only files from the same site as the page",
            "type": "boolean",
            "description": "For web pages: skip files hosted elsewhere (CDNs, other sites).",
            "default": false
          },
          "maxFilesPerPage": {
            "title": "Maximum files per page",
            "minimum": 0,
            "type": "integer",
            "description": "For web pages: take at most this many files from each page. 0 means all.",
            "default": 0
          },
          "saveFiles": {
            "title": "Store each file",
            "type": "boolean",
            "description": "Save every file as a record in the key-value store. Turn off to get only the ZIP (fewer API calls, faster).",
            "default": true
          },
          "zip": {
            "title": "Pack into ZIP",
            "enum": [
              "none",
              "single",
              "byHost"
            ],
            "type": "string",
            "description": "Also pack the files into ZIP parts in the key-value store (files-part-001.zip, ...).",
            "default": "none"
          },
          "zipPartMb": {
            "title": "ZIP part size (MB)",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "A ZIP part is closed and uploaded when it reaches this size.",
            "default": 200
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "The record key of each file. Placeholders: {filename} {name} {ext} {host} {urlhash} {sha} {type} {index}. Example: {type}_{host}_{filename}",
            "default": "{filename}"
          },
          "uniqueFileNames": {
            "title": "Make file names unique",
            "type": "boolean",
            "description": "Put a short code of the address in front of each key, so two files with the same name never overwrite each other.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Larger files are skipped and not charged. The size is checked before the download when the server says it.",
            "default": 100
          },
          "maxRetries": {
            "title": "Retries per file",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries after a timeout, a dropped connection, HTTP 429 or a server error. A broken download continues where it stopped when the server allows.",
            "default": 3
          },
          "timeoutSeconds": {
            "title": "Timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "How long to wait for the server's next bytes.",
            "default": 60
          },
          "maxPerHost": {
            "title": "Connections per site",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Downloads at the same time from one site. Lower it for sites that block fast downloads.",
            "default": 8
          },
          "headers": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Headers sent with every request, e.g. {\"Authorization\": \"Bearer ...\", \"Cookie\": \"...\"} for files you are allowed to download."
          },
          "userAgent": {
            "title": "User agent",
            "type": "string",
            "description": "Overrides the User-Agent header."
          },
          "referer": {
            "title": "Referer",
            "type": "string",
            "description": "Sent as the Referer header. Files found on a page get that page as the Referer on their own."
          },
          "acceptHtml": {
            "title": "Accept web pages as files",
            "type": "boolean",
            "description": "By default an address that returns a web page is a failure (an expired link often shows a page). Turn on to save pages as files.",
            "default": false
          },
          "keyValueStoreName": {
            "title": "Key-value store name",
            "type": "string",
            "description": "Save into this named key-value store instead of the run's own one. Named stores do not expire."
          },
          "onlyNew": {
            "title": "Only new files",
            "type": "boolean",
            "description": "Skip addresses that earlier runs of this same input already returned, so you never pay twice. The first run works as usual and remembers what it returned, in your key-value store 'bulk-file-downloader-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum files",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many stored files. You are charged per stored file; failed downloads are free and do not count.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max parallel downloads",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files downloaded at the same time.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}