{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File & Image Downloader: Links, Pages, ZIP",
    "description": "Download files from a list of links, or the images and linked PDFs, CSVs or ZIPs on web pages, into Apify storage. One row per file with a download link, type, size, SHA-256 and image size. Optional ZIP. Failed files are free.",
    "version": "0.1",
    "x-build-id": "GClGlvAz0eSyDKxv7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subtleasianmerch~bulk-file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subtleasianmerch-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/subtleasianmerch~bulk-file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-subtleasianmerch-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/subtleasianmerch~bulk-file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-subtleasianmerch-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": {
          "fileUrls": {
            "title": "File links",
            "type": "array",
            "description": "Direct links to files: images, PDFs, CSVs, spreadsheets, ZIPs, audio, video, anything. Each is downloaded as it is and stored in the run's key-value store. Up to 10,000 links. robots.txt isn't consulted for links you give yourself (they aren't crawled).",
            "items": {
              "type": "string"
            }
          },
          "pageUrls": {
            "title": "Pages to collect files from",
            "type": "array",
            "description": "Web pages whose images (and, if you choose below, linked files) are downloaded. Only the pages you list are read; links to other pages aren't followed. Each page's robots.txt is respected, and so is the robots.txt of every host the files come from. Up to 1,000 pages.",
            "items": {
              "type": "string"
            }
          },
          "collectImages": {
            "title": "Images on the pages",
            "type": "boolean",
            "description": "Download the pages' images: <img> (with srcset and the usual lazy-load attributes such as data-src), <picture> sources and the og:image. Images that a page adds with JavaScript, or sets in CSS, aren't seen.",
            "default": true
          },
          "imageSize": {
            "title": "Image size",
            "enum": [
              "largest",
              "src"
            ],
            "type": "string",
            "description": "Which version of a responsive image to download. Largest: the biggest candidate in srcset and <picture> (by width, or by pixel density). As shown: the plain src the page shows by default.",
            "default": "largest"
          },
          "includeOgImage": {
            "title": "Include the og:image",
            "type": "boolean",
            "description": "Also download the page's sharing image (og:image), often a large version of the main picture.",
            "default": true
          },
          "linkExtensions": {
            "title": "Linked files to collect (extensions)",
            "type": "array",
            "description": "Also download files the pages link to, by extension: for example pdf, csv, xlsx, zip, docx or mp3. Links (<a href>), embedded files (<iframe>, <embed>, <object>) and <video>/<audio> sources are checked. Add jpg or png to get full-size images that thumbnails link to. Empty: no linked files.",
            "items": {
              "type": "string"
            }
          },
          "sameSiteOnly": {
            "title": "Only files on the page's own site",
            "type": "boolean",
            "description": "Skip files hosted on other sites than the page (for example on a CDN with another domain). The site is the registered domain, so www.example.com and cdn.example.com count as one site.",
            "default": false
          },
          "fileTypes": {
            "title": "File types",
            "type": "array",
            "description": "Keep only these kinds of file. The kind is read from the file's first bytes where they say (images, PDF, archives, audio, video), else from its name or Content-Type. Others are listed as skipped, free. Empty: every kind.",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "pdf",
                "document",
                "spreadsheet",
                "archive",
                "audio",
                "video",
                "other"
              ],
              "enumTitles": [
                "Images",
                "PDFs",
                "Documents (Word, text, slides, EPUB)",
                "Spreadsheets and data (Excel, CSV, JSON, XML)",
                "Archives (ZIP, gzip, 7z, RAR, tar)",
                "Audio",
                "Video",
                "Other"
              ]
            }
          },
          "extensions": {
            "title": "Only these extensions",
            "type": "array",
            "description": "Keep only files with these extensions, e.g. jpg, png, pdf (jpg and jpeg count as one). The extension comes from the file's bytes where they say, else from its name. Add html to save web pages as files too. Empty: every extension.",
            "items": {
              "type": "string"
            }
          },
          "minFileSizeKb": {
            "title": "Minimum file size (KB)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Skip files smaller than this, e.g. tracking pixels and icons. 0: no minimum.",
            "default": 0
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Skip files larger than this. When the server gives the size, a larger file isn't downloaded at all. Files are written to the run's disk first, so very large files need more memory (more memory gives more disk).",
            "default": 100
          },
          "minImageWidth": {
            "title": "Minimum image width (pixels)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Skip images narrower than this (read from the image's header). 0: no minimum.",
            "default": 0
          },
          "minImageHeight": {
            "title": "Minimum image height (pixels)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Skip images lower than this. 0: no minimum.",
            "default": 0
          },
          "maxFiles": {
            "title": "Maximum files",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after storing this many files. Skipped, duplicate and failed files don't count.",
            "default": 1000
          },
          "maxTotalMb": {
            "title": "Maximum total size (MB)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The run never stores more than this many megabytes of files in all. A file that would pass it isn't stored. With the ZIP on, the ZIP is a second copy of the same files.",
            "default": 1000
          },
          "dedupeByUrl": {
            "title": "Skip repeated links",
            "type": "boolean",
            "description": "Download each address once per run, even if several pages show it (utm_ tracking parameters are ignored when comparing).",
            "default": true
          },
          "dedupeByHash": {
            "title": "Skip duplicate files (same SHA-256)",
            "type": "boolean",
            "description": "Store each distinct file once: a file with the same content as one already stored is listed as a duplicate, with the stored copy's key, and not charged.",
            "default": true
          },
          "fileNamePattern": {
            "title": "File name pattern",
            "type": "string",
            "description": "The key of each file in the key-value store. Placeholders: {index} (the file's number, 00001…), {name} (its name from the server or the link, without extension), {ext}, {host} (where it was downloaded from), {page} (the page's host and path, or 'links'), {hash} (the first 12 characters of its SHA-256) and {date} (the run's date). The extension is added when the pattern has no {ext}. Keys may use only letters, digits and ! - _ . ' ( ); other characters become '-', and a repeated key gets -2, -3.",
            "default": "{index}-{name}"
          },
          "zip": {
            "title": "Also save one ZIP of all files",
            "type": "boolean",
            "description": "At the end, also save files.zip with every stored file (named by its key, not compressed again). Charged per started MB of the ZIP. At most 4 GB and 65,534 files.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Downloads at a time",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many files are downloaded side by side, across all sites.",
            "default": 10
          },
          "maxConnectionsPerHost": {
            "title": "Connections per site",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "At most this many requests at a time to one host. 2 is the most Wikimedia's robot policy allows for its media servers. A robots.txt Crawl-delay (up to 60 s) sets one connection with that pause, for pages and the files found on them.",
            "default": 2
          },
          "maxSpeedMbpsPerHost": {
            "title": "Speed per site (Mbit/s)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most this Actor downloads per second from one host, in megabits (25 Mbit/s is about 3 MB a second, Wikimedia's limit for its media servers). Raise it for your own servers.",
            "default": 25
          },
          "downloadTimeoutSecs": {
            "title": "Time limit per file (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "A file that takes longer is given up (free). A server that sends nothing for 30 s is given up too. HTTP 429 and 503 answers are retried after the pause the server asks for (Retry-After, up to 120 s).",
            "default": 300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}