{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenCV Image Analyzer: Faces, Quality & Colors",
    "description": "Analyze image URLs with OpenCV: YuNet face detection with 5 landmarks, blur and exposure scores, k-means dominant colors and aHash/dHash duplicate hashes. 22 fields per image. Export CSV, Excel, JSON or XML. No AI API key, no login, images never leave the run.",
    "version": "0.1",
    "x-build-id": "6YDO3PiRhdIveOvaS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~opencv-image-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-opencv-image-analyzer",
        "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/recordsdata~opencv-image-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-opencv-image-analyzer",
        "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/recordsdata~opencv-image-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-opencv-image-analyzer",
        "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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct image URLs to analyze with OpenCV, one per line or imported from a file. Supports JPEG, PNG, WebP, GIF (first frame), AVIF, TIFF and SVG up to 30 MB each. Each valid image becomes one dataset row with faces, quality, colors and hashes. Optional when you give a Dataset ID below.",
            "default": [
              {
                "url": "https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/lena.jpg"
              },
              {
                "url": "https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/messi5.jpg"
              },
              {
                "url": "https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/fruits.jpg"
              },
              {
                "url": "https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/starry_night.jpg"
              },
              {
                "url": "https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/baboon.jpg"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "datasetId": {
            "title": "Dataset ID (read image URLs from another run)",
            "type": "string",
            "description": "Optional. Pick (or paste the ID of) an Apify dataset, for example the default dataset of a previous Actor run, whose items hold image URLs. The URLs are analyzed after the ones in 'Image URLs'. When this is set, the five prefilled sample URLs above are skipped. Read page by page, so very large datasets are fine. The Actor only gets read access to the dataset you choose."
          },
          "imageUrlField": {
            "title": "Image URL field in the dataset",
            "type": "string",
            "description": "Name of the dataset field that holds the image URL. Dot paths work (for example images.0.url) and fields that hold a list of URLs are expanded. Only used with a Dataset ID.",
            "default": "imageUrl"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of images to analyze and bill per run (failed downloads do not count). Free users: limited to 10 images (preview). Paid users: up to 1,000,000.",
            "default": 10
          },
          "detectFaces": {
            "title": "Detect faces (YuNet DNN)",
            "type": "boolean",
            "description": "Detect faces with OpenCV's YuNet deep-learning detector: bounding box, confidence score and 5 facial landmarks (eyes, nose, mouth corners) per face, in pixels of the original image. Faces are detected, not identified: no recognition or matching of people.",
            "default": true
          },
          "minFaceConfidence": {
            "title": "Min face confidence (%)",
            "minimum": 10,
            "maximum": 99,
            "type": "integer",
            "description": "Faces below this confidence score are discarded. 60 is a good default; lower it to catch small/partial faces, raise it to keep only frontal, clear faces.",
            "default": 60
          },
          "maxFacesPerImage": {
            "title": "Max faces per image",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Return only the N most confident faces per image in the faces list (0 = all faces). The faceCount field still counts every face found above the confidence threshold. Also limits how many faces are cropped or drawn.",
            "default": 0
          },
          "qualityMetrics": {
            "title": "Quality metrics (blur, exposure)",
            "type": "boolean",
            "description": "Sharpness score (variance of Laplacian), blurry yes/no, brightness, contrast, exposure verdict and clipped shadows/highlights percentages.",
            "default": true
          },
          "extractColors": {
            "title": "Dominant colors (k-means)",
            "type": "boolean",
            "description": "Extract the dominant color palette via k-means clustering: hex code and coverage percentage per color, plus the average color.",
            "default": true
          },
          "colorCount": {
            "title": "Palette size",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many dominant colors to extract per image (k in k-means).",
            "default": 5
          },
          "perceptualHash": {
            "title": "Perceptual hashes (aHash + dHash)",
            "type": "boolean",
            "description": "64-bit average hash and difference hash for near-duplicate detection. Images with a small Hamming distance between hashes are visually similar.",
            "default": true
          },
          "groupDuplicates": {
            "title": "Group near-duplicate images",
            "type": "boolean",
            "description": "Compare the perceptual hashes of the images in this run and add duplicateGroupId, isDuplicate, keptUrl and duplicateDistance to every row. The first image of a group is the kept one; later copies point to it. Needs the hashes: they are computed, returned and billed as the perceptual hashes module even if that toggle is off. Group sizes and members are written to the SUMMARY record.",
            "default": false
          },
          "duplicateThreshold": {
            "title": "Duplicate threshold (Hamming distance)",
            "minimum": 0,
            "maximum": 32,
            "type": "integer",
            "description": "Two images are duplicates when both their 64-bit hashes differ in at most this many bits. 0 = identical hashes only; 5 to 10 catches resized or re-compressed copies; above 12 starts to match different images. Only used when 'Group near-duplicate images' is on.",
            "default": 6
          },
          "includeExif": {
            "title": "Read EXIF, XMP and IPTC metadata (camera, date, GPS, title, copyright)",
            "type": "boolean",
            "description": "Read the metadata already embedded in the downloaded file: camera make and model, lens make and model, software, dates (taken, digitized, modified), orientation, ISO, aperture, shutter speed, exposure bias, exposure program, metering mode, white balance, focal length, flash and GPS position (latitude, longitude, altitude, UTC time) when the photo has them. Also the embedded title, description, keywords, creator, artist, copyright and rights text (EXIF, XMP and IPTC). Camera fields work on JPEG, PNG, WebP and TIFF; title, keywords and rights text work on JPEG, PNG and TIFF. Images without EXIF get hasExif false. Only fields the file actually carries are returned. GPS data and author names can point to private places or people: use them in line with the privacy rules that apply to you.",
            "default": false
          },
          "saveAnnotatedImages": {
            "title": "Save annotated images (faces drawn)",
            "type": "boolean",
            "description": "Save a JPEG (longest side up to 1600 px) per image with a box, the five landmarks and the confidence of every detected face drawn with OpenCV. The link goes in annotatedImageUrl. Images without faces are not saved. Needs 'Detect faces'.",
            "default": false
          },
          "saveFaceCrops": {
            "title": "Save face crops",
            "type": "boolean",
            "description": "Save one JPEG per detected face (padded 25 percent around the box, up to 512 px, at most 50 faces per image). The link goes in cropUrl inside each entry of faces. Needs 'Detect faces'. The crops are plain image files; the Actor does not identify or match people.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Most image CDNs are open, so no proxy is needed by default. Enable Apify Proxy only if the image host blocks datacenter IPs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}