{
  "openapi": "3.0.1",
  "info": {
    "title": "Supplier Product Data Normalizer – Excel, CSV, BMEcat to JSON",
    "description": "Turns supplier price lists and product files (Excel, CSV, XML, BMEcat, JSON) into one clean product schema: auto column mapping in DE/FR/IT/EN, GTIN check, prices, units, stock, images, validation report and delta to the last import.",
    "version": "0.2",
    "x-build-id": "mnTozAm0Zr4uk1pmy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cellwright~supplier-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cellwright-supplier-normalizer",
        "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/cellwright~supplier-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-cellwright-supplier-normalizer",
        "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/cellwright~supplier-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-cellwright-supplier-normalizer",
        "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": {
          "sources": {
            "title": "Supplier files",
            "type": "array",
            "description": "URLs of supplier files: Excel (XLSX/XLS), CSV/TSV, XML, BMEcat 1.2/2005, JSON or JSON Lines. Google Sheets, Google Drive and Dropbox share links work. Leave empty for a free demo run on a built-in sample file.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "mapping": {
            "title": "Mapping profile",
            "type": "object",
            "description": "Optional. Column → field mapping, e.g. {\"fields\": {\"sku\": \"Artikelnr\", \"name.de\": \"Bezeichnung\", \"images\": [\"Bild 1\", \"Bild 2\"]}, \"units\": {\"weight\": \"kg\"}, \"currency\": \"CHF\"}. Every run writes the profile it used to OUTPUT – copy it here to fix the mapping for all later files of this supplier.",
            "default": {}
          },
          "autoMap": {
            "title": "Auto-map remaining columns",
            "type": "boolean",
            "description": "Map columns not in the profile by their header (DE/FR/IT/EN synonyms, BMEcat tags) and by their values (GTINs, image URLs).",
            "default": true
          },
          "profileStoreId": {
            "title": "Mapping profile store",
            "type": "string",
            "description": "Optional key-value store that keeps the mapping profile of this supplier. The first run saves the profile it used; every later run loads it and maps deterministically (no AI, same result). You can also pick the default store of an earlier run – its OUTPUT summary works as a profile (set key to OUTPUT)."
          },
          "profileKey": {
            "title": "Profile key",
            "type": "string",
            "description": "Record key of the profile in the store, e.g. one key per supplier (SUPPLIER-ACME). Allowed: letters, digits and !-_.'()",
            "default": "MAPPING_PROFILE"
          },
          "saveProfile": {
            "title": "Save profile to the store",
            "type": "boolean",
            "description": "Write the mapping profile used in this run back to the store (only when it changed).",
            "default": true
          },
          "anthropicApiKey": {
            "title": "Anthropic API key (AI mapping)",
            "type": "string",
            "description": "Optional: your own Anthropic API key. When columns stay unmapped or uncertain, Claude suggests the mapping once (only headers and 5 sample values per column are sent). Not needed when a stored profile exists. Billed by Anthropic to your key; this Actor charges nothing extra for it."
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Anthropic model id for the mapping suggestion.",
            "default": "claude-haiku-4-5"
          },
          "language": {
            "title": "Language of untagged texts",
            "type": "string",
            "description": "2-letter code (de, fr, it, en) for name/description columns without a language tag. Empty = 'und' (unknown)."
          },
          "currency": {
            "title": "Default currency",
            "type": "string",
            "description": "ISO code (CHF, EUR, …) used when the file has no currency column or symbol."
          },
          "supplier": {
            "title": "Supplier name",
            "type": "string",
            "description": "Written to _source.supplier of every product (BMEcat files fill it automatically)."
          },
          "previousDatasetId": {
            "title": "Previous import (delta)",
            "type": "string",
            "description": "Dataset of an earlier run of this Actor. Every product then gets _delta (new / changed with the changed fields / unchanged) and products missing in the new file are reported as removed."
          },
          "emit": {
            "title": "Output",
            "enum": [
              "all",
              "changes"
            ],
            "type": "string",
            "description": "'changes' writes (and charges) only new, changed and removed products.",
            "default": "all"
          },
          "requiredFields": {
            "title": "Required fields",
            "type": "array",
            "description": "Products missing one of these fields get an error in _issues (they are still written).",
            "default": [
              "sku",
              "name",
              "price"
            ],
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Format",
            "enum": [
              "auto",
              "csv",
              "xlsx",
              "xls",
              "json",
              "jsonl",
              "xml",
              "bmecat"
            ],
            "type": "string",
            "description": "auto = detect from content and file name.",
            "default": "auto"
          },
          "sheet": {
            "title": "Excel sheet",
            "type": "string",
            "description": "Sheet name or number (1 = first). Empty = first sheet."
          },
          "delimiter": {
            "title": "CSV delimiter",
            "type": "string",
            "description": "Empty = detect (; , tab |)."
          },
          "encoding": {
            "title": "Text encoding",
            "type": "string",
            "description": "Empty = detect (UTF-8, Windows-1252, …)."
          },
          "recordPath": {
            "title": "Record path (JSON/XML)",
            "type": "string",
            "description": "JSON: dot path to the product list (e.g. data.products). XML: name of the product element (e.g. item). Empty = detect."
          },
          "keepUnmapped": {
            "title": "Keep unmapped columns",
            "type": "boolean",
            "description": "Pass unmapped source columns through in 'extra'.",
            "default": true
          },
          "authHeader": {
            "title": "Authorization header",
            "type": "string",
            "description": "Optional value of the Authorization header for protected supplier URLs (e.g. 'Bearer …' or 'Basic …'). Stored encrypted."
          },
          "maxRecords": {
            "title": "Max products",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many source rows. Empty = no limit."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}