{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Downloader: 22-Field Metadata, SHA-256 & ZIP",
    "description": "Download every image from any webpage or direct image URL. Smart srcset picks the highest-resolution variant. 22 metadata fields per image: width, height, format, SHA-256, dedup flag, EXIF, provenance. ZIP and S3 outputs, webhooks, MCP-ready. $2.00 per 1k.",
    "version": "0.1",
    "x-build-id": "Va0iPAKefLSr4KEdm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~bulk-image-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-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/getascraper~bulk-image-downloader/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-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/getascraper~bulk-image-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs to Process",
            "type": "array",
            "description": "List of URLs. Each can be a webpage (the Actor discovers all images on the page via HTML/srcset/og:image/twitter:image) or a direct image URL. Mixed lists allowed.",
            "default": [
              {
                "url": "https://apify.com"
              },
              {
                "url": "https://picsum.photos/800/600.jpg"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "mode": {
            "title": "URL Mode",
            "enum": [
              "auto",
              "page",
              "direct"
            ],
            "type": "string",
            "description": "'auto' detects by URL extension, 'page' forces HTML parsing, 'direct' treats every URL as an image.",
            "default": "auto"
          },
          "includeSrcset": {
            "title": "Include srcset / picture",
            "type": "boolean",
            "description": "Discover images from <img srcset>, <picture><source>, and lazy-loaded data-src/data-srcset attributes. Picks the highest-resolution variant by default.",
            "default": true
          },
          "includeOgTags": {
            "title": "Include og:image / twitter:image",
            "type": "boolean",
            "description": "Discover Open Graph and Twitter Card images from page <meta> tags. Often the best cover image.",
            "default": true
          },
          "minWidth": {
            "title": "Min Width (px)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Skip images narrower than this. 0 = no minimum. Filters tracking pixels and thumbnails.",
            "default": 0
          },
          "minHeight": {
            "title": "Min Height (px)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Skip images shorter than this. 0 = no minimum.",
            "default": 0
          },
          "minSizeBytes": {
            "title": "Min Size (bytes)",
            "minimum": 0,
            "maximum": 10485760,
            "type": "integer",
            "description": "Skip images smaller than this. Filters tracking pixels and 1x1 placeholders. 0 = no minimum.",
            "default": 0
          },
          "maxImagesPerUrl": {
            "title": "Max Images per URL",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety cap on images discovered per source URL. Prevents runaway runs on heavy pages.",
            "default": 1000
          },
          "maxUrls": {
            "title": "Max URLs to Process",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on total URLs processed.",
            "default": 10000
          },
          "dedupByHash": {
            "title": "Deduplicate by Content Hash",
            "type": "boolean",
            "description": "Compute SHA-256 of each image body and skip duplicates. Reports is_duplicate=true on the dataset.",
            "default": true
          },
          "stripExif": {
            "title": "Strip EXIF Metadata (JPEG)",
            "type": "boolean",
            "description": "Re-encode JPEGs without EXIF (camera model, GPS, timestamps). Privacy-friendly. Slightly lossy.",
            "default": false
          },
          "convertFormat": {
            "title": "Format Conversion",
            "enum": [
              "none",
              "webp-to-png",
              "png-to-jpg"
            ],
            "type": "string",
            "description": "Optional format conversion. webp-to-png is the most common (broader compatibility).",
            "default": "none"
          },
          "filenamePattern": {
            "title": "Filename Pattern",
            "type": "string",
            "description": "Templated filename. Tokens: {slug} (sanitized URL slug), {hash} (SHA-256 prefix), {ext} (extension), {idx} (index), {source} (source domain).",
            "default": "{slug}-{hash}.{ext}"
          },
          "outputFormat": {
            "title": "Output Format",
            "type": "array",
            "description": "Always emits the structured dataset. Optionally also: ZIP archive (single or per-URL), KV store binaries, S3 upload, or webhook on completion. Valid values: dataset, kv-store, zip, zipPerUrl, s3, webhook.",
            "default": [
              "dataset",
              "kv-store"
            ],
            "items": {
              "type": "string"
            }
          },
          "s3Bucket": {
            "title": "S3 Bucket Name",
            "type": "string",
            "description": "Required when outputFormat includes 's3'. Use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION env vars (set via Apify Secrets).",
            "default": ""
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "POST a completion event with the run summary to this URL on run completion.",
            "default": ""
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Max parallel image downloads. Default 10.",
            "default": 10
          },
          "downloadTimeoutMs": {
            "title": "Download Timeout (ms)",
            "minimum": 1000,
            "maximum": 120000,
            "type": "integer",
            "description": "Per-image fetch timeout in milliseconds.",
            "default": 15000
          },
          "imageCheckMaxRetries": {
            "title": "Max Retries per Image",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for failed image downloads (5xx, timeouts, transient network errors).",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "OPTIONAL. Default is no proxy. Set residential proxy if source sites are hotlink-protected or geo-fenced.",
            "default": {
              "useApifyProxy": false
            }
          },
          "failFast": {
            "title": "Fail Fast",
            "type": "boolean",
            "description": "Stop the run on the first error. Default false (continue and report per-image errors).",
            "default": false
          },
          "debugLogging": {
            "title": "Verbose Debug Logs",
            "type": "boolean",
            "description": "Print per-image tracing tags (FETCH, PARSE, HASH, WRITE) to run logs.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}