{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Downloader",
    "description": "Download every image from a list of public web pages or direct image URLs, with size and type filters, optional ZIP output and per-image links in the dataset.",
    "version": "1.0",
    "x-build-id": "NtyPBY3gN1kQVPKRM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/busy_courtyard~bulk-image-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-busy_courtyard-bulk-image-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/busy_courtyard~bulk-image-downloader/runs": {
      "post": {
        "operationId": "runs-sync-busy_courtyard-bulk-image-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/busy_courtyard~bulk-image-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-busy_courtyard-bulk-image-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Pages or image URLs",
            "type": "array",
            "description": "Web pages to collect images from, or direct links to image files. Pages are not crawled further: only the images on each listed page are downloaded.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxImagesPerPage": {
            "title": "Max images per page",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many images from one page (filtered-out images don't count).",
            "default": 100
          },
          "maxTotalImages": {
            "title": "Max images in total",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "A hard cap for the whole run, so cost stays predictable.",
            "default": 1000
          },
          "minWidth": {
            "title": "Min width (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Skip smaller images such as icons and tracking pixels. Skipped images are not charged.",
            "default": 50
          },
          "minHeight": {
            "title": "Min height (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Skip images shorter than this.",
            "default": 50
          },
          "imageTypes": {
            "title": "Image types",
            "type": "array",
            "description": "Which formats to keep. The type is detected from the file contents, not just the extension.",
            "items": {
              "type": "string",
              "enum": [
                "jpeg",
                "png",
                "gif",
                "webp",
                "avif",
                "svg",
                "bmp",
                "ico"
              ],
              "enumTitles": [
                "JPEG",
                "PNG",
                "GIF",
                "WebP",
                "AVIF",
                "SVG",
                "BMP",
                "ICO"
              ]
            },
            "default": [
              "jpeg",
              "png",
              "gif",
              "webp",
              "avif",
              "svg",
              "bmp",
              "ico"
            ]
          },
          "maxImageMb": {
            "title": "Max size per image (MB)",
            "minimum": 0.1,
            "maximum": 200,
            "type": "number",
            "description": "Larger files are skipped mid-download.",
            "default": 25
          },
          "includeSrcset": {
            "title": "Use the largest srcset version",
            "type": "boolean",
            "description": "For responsive images (srcset and picture), download the largest version offered.",
            "default": true
          },
          "includeBackgroundImages": {
            "title": "Include CSS background images",
            "type": "boolean",
            "description": "Images in inline style attributes and style blocks. External CSS files are not fetched.",
            "default": true
          },
          "includeMetaImages": {
            "title": "Include social preview images",
            "type": "boolean",
            "description": "og:image, twitter:image and touch icons.",
            "default": true
          },
          "includeLinksToImages": {
            "title": "Follow links to image files",
            "type": "boolean",
            "description": "Also download <a href> links that point straight at an image file. Galleries often link thumbnails to the full-size file this way. Off by default, because many sites (wikis, for example) link to HTML pages whose URLs end in .jpg.",
            "default": false
          },
          "sameDomainOnly": {
            "title": "Same site only",
            "type": "boolean",
            "description": "Only keep images hosted on the same site as the page.",
            "default": false
          },
          "urlIncludeRegex": {
            "title": "Only image URLs matching (regex)",
            "type": "string",
            "description": "Optional, case-insensitive. Example: upload\\.wikimedia\\.org"
          },
          "urlExcludeRegex": {
            "title": "Skip image URLs matching (regex)",
            "type": "string",
            "description": "Optional, case-insensitive. Example: logo|sprite|icon"
          },
          "createZip": {
            "title": "Create images.zip",
            "type": "boolean",
            "description": "Bundle all saved images into one ZIP in the key-value store. Its link is in the OUTPUT record.",
            "default": true
          },
          "maxZipMb": {
            "title": "Max ZIP size (MB)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Images beyond this stay in the key-value store but are left out of the ZIP. Raise the run memory if you increase it.",
            "default": 100
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip pages and images that the site's robots.txt disallows. Turn it off only for sites you own or have permission to download from.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of images downloaded at the same time.",
            "default": 5
          },
          "minDelayBetweenRequestsSecs": {
            "title": "Min delay per site (s)",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Minimum time between two requests to the same host. A robots.txt Crawl-delay overrides it if it is longer.",
            "default": 0.25
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (s)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time for one download.",
            "default": 30
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for timeouts, 429 and 5xx errors. Retries use exponential backoff.",
            "default": 2
          },
          "selfTest": {
            "title": "Self-test mode",
            "type": "boolean",
            "description": "Ignore the other fields (startUrls is still required by the form, any URL will do) and download 2 images from a Wikipedia page, then fail the run if no image was saved or key fields are empty. Meant for a daily health-check schedule.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}