{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Product Intelligence Engine",
    "version": "0.0",
    "x-build-id": "bdAlQH6n3UYbf71eT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tomko5peter~ai-product-intelligence-engine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tomko5peter-ai-product-intelligence-engine",
        "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/tomko5peter~ai-product-intelligence-engine/runs": {
      "post": {
        "operationId": "runs-sync-tomko5peter-ai-product-intelligence-engine",
        "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/tomko5peter~ai-product-intelligence-engine/run-sync": {
      "post": {
        "operationId": "run-sync-tomko5peter-ai-product-intelligence-engine",
        "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": {
          "feedUrl": {
            "title": "Feed URL",
            "type": "string",
            "description": "URL of the product feed to download (CSV, JSON array, or Google Merchant XML). Leave empty if using 'Upload a file' or 'Products' below instead."
          },
          "feedFile": {
            "title": "Upload a feed file",
            "type": "string",
            "description": "Upload a CSV/JSON/XML feed file directly instead of pointing at a URL. If your file's column headers don't match our field names, also set 'Column mapping' below. Leave empty if using 'Feed URL' or 'Products' instead."
          },
          "columnMapping": {
            "title": "Column mapping (optional)",
            "type": "object",
            "description": "Map your feed's own column/field names to our schema when they don't already match — e.g. {\"Product Name\": \"title\", \"Item SKU\": \"sku\"}. Valid target fields: sku, title, description, brand, category, price, currency, availability, group_id, gtin, image_url. An unrecognized target field is ignored, not an error."
          },
          "feedFormat": {
            "title": "Feed format",
            "enum": [
              "csv",
              "json",
              "google_merchant_xml"
            ],
            "type": "string",
            "description": "Format of the feed at feedUrl. Ignored if 'Products' is used instead.",
            "default": "csv"
          },
          "products": {
            "title": "Products (inline)",
            "type": "array",
            "description": "Inline product records instead of feedUrl — useful for MCP tool calls and testing. Each item: {sku, title, description, brand, category, price, currency, availability, group_id, image_url, attributes: {...}}."
          },
          "checks": {
            "title": "Enabled checks",
            "type": "array",
            "description": "Which checks to run on your feed. Add or remove any combination.",
            "items": {
              "type": "string",
              "enum": [
                "missing_attributes",
                "title_description_contradiction",
                "duplicate_detection",
                "variant_consistency",
                "image_technical_qa",
                "gtin_checksum_validator",
                "thin_content_description",
                "price_outlier_detector",
                "semantic_cannibalization",
                "image_description_alignment",
                "seo_keyword_gap",
                "visual_brand_consistency",
                "category_voice_consistency",
                "translation_consistency",
                "semantic_duplicate_detection"
              ],
              "enumTitles": [
                "Missing required attributes",
                "Title/description contradictions",
                "Duplicate products",
                "Inconsistent product variants",
                "Image technical QA",
                "GTIN/EAN checksum validator",
                "Thin content description",
                "Price outlier detector",
                "Semantic cannibalization",
                "Image-to-description alignment",
                "SEO keyword gap",
                "Visual brand consistency",
                "Category voice consistency",
                "Translation consistency",
                "Semantic duplicate detection"
              ]
            },
            "default": [
              "missing_attributes",
              "title_description_contradiction",
              "duplicate_detection",
              "variant_consistency",
              "image_technical_qa",
              "gtin_checksum_validator",
              "thin_content_description",
              "price_outlier_detector"
            ]
          },
          "requiredAttributes": {
            "title": "Required attributes",
            "type": "array",
            "description": "Attribute keys that must be present and non-empty on every product for the 'missing_attributes' check.",
            "default": [
              "brand",
              "category",
              "price"
            ],
            "items": {
              "type": "string"
            }
          },
          "targetLanguages": {
            "title": "Target languages (optional)",
            "type": "array",
            "description": "Required for the 'translation_consistency' check. ISO language codes to translate into and check for number drift, e.g. [\"cs\", \"pl\", \"sk\", \"de\"]. Empty = check skipped entirely.",
            "items": {
              "type": "string"
            }
          },
          "categoryVoiceBriefs": {
            "title": "Category voice briefs (optional)",
            "type": "object",
            "description": "Required for the 'category_voice_consistency' check. Map category names to a tone/positioning brief, e.g. {\"Baby & Mom\": \"warm, reassuring, speaks to a caring parent\"}. A category with no brief is skipped entirely."
          },
          "searchQueries": {
            "title": "Search queries (optional)",
            "type": "array",
            "description": "Real search queries from your site, for catalog-gap analysis. Each item: {\"query\": \"red running shoes\"}. Persisted across runs — a gap is only flagged once it's shown up repeatedly, not from one run's snapshot.",
            "items": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string",
                  "title": "Query text",
                  "description": "The search query text as entered by a shopper."
                }
              },
              "required": [
                "query"
              ]
            }
          },
          "minDescriptionWords": {
            "title": "Minimum description word count (optional)",
            "minimum": 2,
            "type": "integer",
            "description": "Descriptions shorter than this are flagged by 'thin_content_description'. Default 10 — calibrated against real feed data, not a generic SEO-content figure.",
            "default": 10
          },
          "minCategorySize": {
            "title": "Minimum category size for price outlier detection (optional)",
            "minimum": 2,
            "type": "integer",
            "description": "'price_outlier_detector' only runs on categories with at least this many priced products — too few samples make a median/outlier calculation meaningless. Default 5.",
            "default": 5
          },
          "priceOutlierZThreshold": {
            "title": "Price outlier sensitivity (optional)",
            "minimum": 0.01,
            "type": "number",
            "description": "Modified z-score threshold for 'price_outlier_detector' — lower is more sensitive (flags more), must be greater than 0 or every priced product gets flagged. Default 3.5 (a standard statistical convention).",
            "default": 3.5
          },
          "maxProducts": {
            "title": "Max products to process",
            "minimum": 0,
            "type": "integer",
            "description": "Safety limit on feed size per run. 0 = unlimited.",
            "default": 5000
          },
          "maxVisionProducts": {
            "title": "Max products per vision check",
            "minimum": 0,
            "type": "integer",
            "description": "Separate, smaller safety limit for opt-in 'vision' checks (e.g. image_description_alignment, seo_keyword_gap, visual_brand_consistency) that cost one real inference call per product. Applies per check, independent of maxProducts above. 0 = unlimited.",
            "default": 50
          },
          "brandStyleBrief": {
            "title": "Brand visual style brief (optional)",
            "type": "string",
            "description": "Describe your expected product image style (e.g. 'white background, studio lighting, centered product shot'). Required for the 'visual_brand_consistency' check — leave empty to skip it entirely."
          },
          "maxEstimatedCostUsd": {
            "title": "Max estimated cost per run (USD)",
            "minimum": 0,
            "type": "number",
            "description": "A hard ceiling on this run's projected billing, checked before any check runs. If the projected cost would exceed it, 'semantic_cannibalization' (the one check whose cost grows with the square of catalog size) has its input trimmed to fit the budget, and a warning is logged. Other checks are not auto-trimmed by this — bound their cost with maxVisionProducts, or by disabling them. 0 = unlimited.",
            "default": 0
          },
          "maxFindingsPerCheck": {
            "title": "Max findings per check",
            "minimum": 0,
            "type": "integer",
            "description": "Keeps only the highest-severity (then highest-confidence) findings from each check, up to this many — applied separately to every check, so this never hides one check's findings behind another's (e.g. a pairwise check that fires often won't crowd out a check that fires rarely). This does not reduce cost — the check still does the same work — it just keeps the output focused on what matters most on a large or noisy catalog. A nonzero value below 10 is treated as 10. 0 = unlimited.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}