{
  "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": "bPdmSiI8lFXyYuBaE"
  },
  "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 (one per line)",
            "type": "array",
            "description": "Direct links to images (JPEG, PNG, WebP, GIF, AVIF, TIFF, SVG, up to 30 MB each). Example: https://example.com/photo.jpg. Each valid image becomes one result row.",
            "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": "Or: read image URLs from an earlier run (optional)",
            "type": "string",
            "description": "Optional. Pick the dataset of a previous run whose items contain image URLs. When set, the sample images above are skipped."
          },
          "imageUrlField": {
            "title": "Field that holds the image URL (only with a dataset)",
            "type": "string",
            "description": "Only used with a dataset. Name of the field holding the URL, for example imageUrl or images.0.url.",
            "default": "imageUrl"
          },
          "maxItems": {
            "title": "Max images to analyze",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "How many images to analyze, for example 100. Failed downloads do not count. Free plan: capped at 10 per run.",
            "default": 10
          },
          "detectFaces": {
            "title": "Detect faces",
            "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 (0 = all)",
            "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": "Blur and exposure check",
            "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",
            "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": "Number of colors in the palette",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many dominant colors to extract per image (k in k-means).",
            "default": 5
          },
          "perceptualHash": {
            "title": "Image fingerprints (perceptual hashes)",
            "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 images of this run and mark copies with duplicateGroupId and isDuplicate. Needs image fingerprints on.",
            "default": false
          },
          "duplicateThreshold": {
            "title": "Duplicate sensitivity (bits that may differ, 0-64)",
            "minimum": 0,
            "maximum": 32,
            "type": "integer",
            "description": "Two images count as duplicates when their fingerprints differ in at most this many bits. 6 is a good start, 0 means identical only. Used with 'Group near-duplicate images'.",
            "default": 6
          },
          "includeExif": {
            "title": "Read photo metadata (camera, date, GPS, 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 copies with 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 one cropped image per face",
            "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",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}