{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader - PDFs, Images & Files from URL Lists",
    "description": "Download lists of file URLs (PDF, images, CSV, XLSX, ZIP, audio) into storage with direct download links. Read URLs from any scraper's dataset, filter by type/size, sha256 dedupe, optional ZIP, only-new mode. First 10 MB per file included; failed files are free.",
    "version": "0.1",
    "x-build-id": "rAbjnA5tTusvyDxvg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rjmacarthy~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rjmacarthy-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/rjmacarthy~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-rjmacarthy-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/rjmacarthy~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-rjmacarthy-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: PDFs, images, CSV/XLSX, ZIP, audio, video or anything else. Only public http(s) files (no login). Required unless you set a Dataset ID below.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Download files listed in another Actor's dataset, e.g. image or PDF links found by a scraper. Give the dataset ID (or username~dataset-name) and the field holding the links below. Combined with File URLs."
          },
          "urlField": {
            "title": "URL field in dataset",
            "type": "string",
            "description": "Field of each dataset item that holds the file link, e.g. imageUrl, pdfUrl or images. Dotted paths work (product.image). Arrays of URLs (or of objects with a url field) are flattened.",
            "default": "url"
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of URLs to process in this run (0 = no limit).",
            "default": 1000
          },
          "allowedContentTypes": {
            "title": "Allowed content types",
            "type": "array",
            "description": "Only keep files with these Content-Types, e.g. application/pdf or image/*. Leave empty to keep everything. A file passes if it matches ANY allowed content type OR extension. Checked from the response headers, so filtered files are not downloaded and are free.",
            "items": {
              "type": "string"
            }
          },
          "allowedExtensions": {
            "title": "Allowed file extensions",
            "type": "array",
            "description": "Only keep files with these extensions, e.g. pdf, jpg, png, csv, xlsx (taken from the file name in the URL or Content-Disposition, or from the content type). Leave empty to keep everything.",
            "items": {
              "type": "string"
            }
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are skipped (reason too-large, not charged). The download is stopped as soon as the size is exceeded. Default 25 MB, hard maximum 200 MB. Each stored file includes its first 2 MB; extra MBs are charged per MB (data-mb).",
            "default": 25
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Key of each stored file. Placeholders: {name} = file name from the URL or Content-Disposition (without extension), {ext} = extension, {index} = zero-padded position in the list, {hash} = first 16 characters of the file's sha256. Example: {index}-{name}.{ext}. Characters not allowed in Apify keys are replaced with _; duplicates get -2, -3, ...",
            "default": "{name}.{ext}"
          },
          "createZip": {
            "title": "Also create files.zip",
            "type": "boolean",
            "description": "Also store all downloaded files in one files.zip in the key-value store (uncompressed, up to 500 MB in total; above that the ZIP is skipped with a warning). The ZIP is not charged.",
            "default": false
          },
          "deduplicate": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Download each URL only once per run, and store files with identical content (same sha256) only once: later copies get a free row pointing to the first file (duplicateOf).",
            "default": true
          },
          "onlyNew": {
            "title": "Only new files",
            "type": "boolean",
            "description": "Skip URLs already downloaded by earlier runs of this Actor in your account (remembered in the named key-value store bulk-file-downloader-state). Ideal for scheduled runs over a growing dataset. Skipped URLs are not requested, output or charged.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Files downloaded in parallel. At most 3 at a time go to the same website, to stay polite.",
            "default": 5
          },
          "timeoutSecs": {
            "title": "Timeout per file (seconds)",
            "minimum": 5,
            "maximum": 900,
            "type": "integer",
            "description": "Maximum time for one download attempt. Raise it for big files on slow servers.",
            "default": 60
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Retries (with backoff) after HTTP 429/5xx, timeouts and network errors. 404/403 are not retried.",
            "default": 2
          },
          "headers": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers sent with every download, e.g. {\"Referer\": \"https://example.com/\"} for sites that check where a file is linked from. Meant for public files: do not paste login cookies or tokens."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for most files. Enable Apify Proxy (datacenter) if a site blocks downloads from Apify's servers (HTTP 403/429), or add your own proxy URLs. Residential and SERP proxy groups are not supported: the run falls back to Apify datacenter proxy.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}