# Supplier Product Data Normalizer – Excel, CSV, BMEcat to JSON (`cellwright/supplier-normalizer`) Actor

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.

- **URL**: https://apify.com/cellwright/supplier-normalizer.md
- **Developed by:** [Cellwright](https://apify.com/cellwright) (community)
- **Categories:** E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Supplier Product Data Normalizer – Excel, CSV, XML, BMEcat to JSON

Every supplier sends product data differently: an Excel price list with title rows, a semicolon CSV in Windows-1252, an XML feed, a BMEcat catalogue. This Actor turns all of them into **one clean, documented product schema** – ready for your shop, PIM, ERP or the next Actor in your pipeline.

**Try it for free:** start the Actor with an empty input – it normalises a built-in sample supplier file (not charged).

### What it does

- **Reads** XLSX, XLS, CSV/TSV (delimiter and encoding detected, title rows above the header skipped), XML (product element detected), **BMEcat 1.2 / 2005**, JSON and JSON Lines. Google Sheets, Google Drive and Dropbox share links work.
- **Maps columns automatically** – German, French, Italian and English headers (`Artikelnr`, `Bezeichnung FR`, `Réf.`, `EK netto`, `UVP`, `Gewicht (kg)`, `Prezzo` …), BMEcat tags, and by content (GTIN and image URL columns are recognised by their values).
- **Reusable mapping profile per supplier:** every run writes the mapping it used to `OUTPUT`. Give a key-value store as `profileStoreId` and the profile is saved there (one key per supplier) and loaded automatically on every later run – deterministic, no AI, no surprises.
- **Optional AI mapping with your own Anthropic key:** for odd headers (`Text1`, `VK`, `Gew`) Claude suggests the mapping once; the suggestion is validated against the real columns and saved in the profile, so later runs need no AI at all.
- **Normalises values:** GTIN/EAN check digit and 14-digit form (flags Excel scientific notation and lost leading zeros), prices with currency and tax flag (`1.234,50`, `1'234.50`, `CHF 12.50`), price tiers, weight in g and dimensions in mm (unit from value, header or profile), stock quantity and availability words (`auf Lager`, `épuisé` …), country of origin (ISO), customs tariff numbers, image URLs (split, de-duplicated, relative URLs with `imageBaseUrl`).
- **Validation report:** per product `_issues` (code, severity, message), per run coverage per field, issue counts, duplicate SKUs and GTINs.
- **Delta to the last import:** give the dataset of an earlier run as `previousDatasetId` → every product gets `_delta` (`new`, `changed` with the changed fields and previous values, `unchanged`); products missing in the new file come as `removed`. With `emit: changes` you only get (and pay for) what changed.
- **Never guesses:** unknown values stay empty and get an issue; every value carries its source column in `_provenance`.

### Input

| Field | Default | Description |
|---|---|---|
| `sources` | – | File URLs. Empty = free demo |
| `mapping` | `{}` | Mapping profile (see below) |
| `autoMap` | `true` | Map remaining columns by header and content |
| `profileStoreId` | – | Key-value store that keeps the mapping profile (load + save) |
| `profileKey` | `MAPPING_PROFILE` | Record key, e.g. one per supplier (`SUPPLIER-ACME`) |
| `saveProfile` | `true` | Save the profile used back to the store (only when changed) |
| `anthropicApiKey` | – | Your Anthropic API key for the AI mapping suggestion (secret) |
| `aiModel` | `claude-haiku-4-5` | Anthropic model for the suggestion |
| `language` | – | Language of untagged text columns (`de`, `fr`, `it`, `en`) |
| `currency` | – | Default currency if the file has none |
| `supplier` | – | Written to `_source.supplier` |
| `previousDatasetId` | – | Dataset of an earlier run → delta |
| `emit` | `all` | `all` or `changes` (new/changed/removed only) |
| `requiredFields` | `["sku","name","price"]` | Missing → error issue |
| `format`, `sheet`, `delimiter`, `encoding`, `recordPath` | auto | Overrides for unusual files |
| `keepUnmapped` | `true` | Unmapped columns are passed through in `extra` |
| `authHeader` | – | Authorization header for protected supplier URLs (secret) |
| `maxRecords` | – | Limit rows |

#### Mapping profile

```json
{
  "fields": {"sku": "Artikelnr", "name.de": "Bezeichnung", "name.fr": "Désignation",
             "price": "EK netto", "images": ["Bild 1", "Bild 2"]},
  "units": {"weight": "kg", "length": "cm"},
  "currency": "CHF",
  "language": "de",
  "priceIncludesTax": false,
  "imageBaseUrl": "https://media.supplier.com/"
}
```

Target fields: `sku, gtin, mpn, brand, manufacturer, name.<lang>, description.<lang>, shortDescription.<lang>, color.<lang>, material.<lang>, category, categoryPath, parentSku, size, condition, price, listPrice, currency, vatRate, priceTiers, stockQuantity, stockStatus, deliveryDays, orderUnit, contentUnit, unitsPerPack, minOrderQuantity, weight, netWeight, length, width, height, countryOfOrigin, hsCode, images, documents, attributes`.

### Output (product.v1)

```json
{
  "schemaVersion": "product.v1",
  "sku": "A-100",
  "gtin": "04006381333931",
  "name": {"de": "Kugelschreiber blau", "fr": "Stylo bille bleu"},
  "price": {"amount": 1.2, "currency": "CHF"},
  "listPrice": {"amount": 2.9, "currency": "CHF", "taxIncluded": true},
  "stock": {"quantity": 250, "status": "inStock"},
  "weightGrams": 12,
  "countryOfOrigin": "DE",
  "images": [{"url": "https://cdn.example.com/a100.jpg", "position": 1}],
  "_source": {"file": "pricelist.csv", "locator": "4"},
  "_provenance": {"sku": {"from": "Artikelnr", "method": "mapped", "confidence": 0.95}},
  "_issues": [],
  "_delta": {"status": "changed", "changedFields": ["price"], "previous": {"price": {"amount": 1.1, "currency": "CHF"}}}
}
```

Precedence: `mapping` from the input > stored profile > AI suggestion > automatic mapping. A stored profile is applied leniently: columns the supplier dropped are reported in `files[].profileColumnsMissing`, new columns are auto-mapped and the updated profile is saved.

#### Workflow for recurring supplier files

1. Create an empty key-value store once (Storage → Key-value stores), e.g. `suppliers`.
2. First run: `sources` + `profileStoreId: suppliers` + `profileKey: SUPPLIER-ACME` (optionally `anthropicApiKey`). Check the mapping in `OUTPUT`; correct it in the stored record if needed.
3. Schedule the same input with `previousDatasetId` and `emit: changes` → every update of the supplier file gives you only new, changed and removed products, mapped exactly the same way.

You can also pick the default store of an earlier run with `profileKey: OUTPUT` – its summary contains the profile.

Fixed units: weight in grams, dimensions in millimetres, GTIN with 14 digits (`gtinOriginal` keeps the delivered form). Texts are language objects. The `OUTPUT` record holds the validation report and the mapping profile.

### Pricing

Pay per event: **USD 0.20 per 1,000 product records** written (plus the standard Actor start). Files that cannot be read, demo runs and – with `emit: changes` – unchanged products are free.

### Data and privacy

Your files are processed only during the run and are not stored by the developer beyond your own run storage. No external data sources are queried. Only if you enter your own Anthropic API key, the column headers and up to 5 short sample values per column (not the file) are sent to Anthropic under your key and your agreement with Anthropic; without a key nothing leaves the run. The AI suggestion is free on our side – Anthropic bills your key (typically well under one cent per file with the default model).

### Limits

Up to 50 files and 200 MB per file per run. XML is parsed safely (no external entities). Only public http(s) addresses are fetched.

# Actor input Schema

## `sources` (type: `array`):

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.

## `mapping` (type: `object`):

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.

## `autoMap` (type: `boolean`):

Map columns not in the profile by their header (DE/FR/IT/EN synonyms, BMEcat tags) and by their values (GTINs, image URLs).

## `profileStoreId` (type: `string`):

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` (type: `string`):

Record key of the profile in the store, e.g. one key per supplier (SUPPLIER-ACME). Allowed: letters, digits and !-\_.'()

## `saveProfile` (type: `boolean`):

Write the mapping profile used in this run back to the store (only when it changed).

## `anthropicApiKey` (type: `string`):

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` (type: `string`):

Anthropic model id for the mapping suggestion.

## `language` (type: `string`):

2-letter code (de, fr, it, en) for name/description columns without a language tag. Empty = 'und' (unknown).

## `currency` (type: `string`):

ISO code (CHF, EUR, …) used when the file has no currency column or symbol.

## `supplier` (type: `string`):

Written to \_source.supplier of every product (BMEcat files fill it automatically).

## `previousDatasetId` (type: `string`):

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` (type: `string`):

'changes' writes (and charges) only new, changed and removed products.

## `requiredFields` (type: `array`):

Products missing one of these fields get an error in \_issues (they are still written).

## `format` (type: `string`):

auto = detect from content and file name.

## `sheet` (type: `string`):

Sheet name or number (1 = first). Empty = first sheet.

## `delimiter` (type: `string`):

Empty = detect (; , tab |).

## `encoding` (type: `string`):

Empty = detect (UTF-8, Windows-1252, …).

## `recordPath` (type: `string`):

JSON: dot path to the product list (e.g. data.products). XML: name of the product element (e.g. item). Empty = detect.

## `keepUnmapped` (type: `boolean`):

Pass unmapped source columns through in 'extra'.

## `authHeader` (type: `string`):

Optional value of the Authorization header for protected supplier URLs (e.g. 'Bearer …' or 'Basic …'). Stored encrypted.

## `maxRecords` (type: `integer`):

Stop after this many source rows. Empty = no limit.

## Actor input object example

```json
{
  "mapping": {},
  "autoMap": true,
  "profileKey": "MAPPING_PROFILE",
  "saveProfile": true,
  "aiModel": "claude-haiku-4-5",
  "emit": "all",
  "requiredFields": [
    "sku",
    "name",
    "price"
  ],
  "format": "auto",
  "keepUnmapped": true
}
```

# Actor output Schema

## `results` (type: `string`):

One normalised product per source row (product.v1 schema) in the default dataset (JSON, CSV, Excel via the dataset export).

## `summary` (type: `string`):

Files read, field coverage, issue counts, duplicates, delta counts and the reusable mapping profile (OUTPUT record).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("cellwright/supplier-normalizer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("cellwright/supplier-normalizer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call cellwright/supplier-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cellwright/supplier-normalizer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/nkuq9m0SYII6MSflQ/builds/mnTozAm0Zr4uk1pmy/openapi.json
