# Supplier Catalogue Unit-Price Normalizer (CSV) (`rose_dwelling/supplier-catalogue-unit-price-normalizer`) Actor

Validate supplier CSVs and compare case sizes per kg, litre or item. Download cleaned rows and an explicit review report. No currency guessing or external URL fetching.

- **URL**: https://apify.com/rose_dwelling/supplier-catalogue-unit-price-normalizer.md
- **Developed by:** [sebastian raffaele](https://apify.com/rose_dwelling) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.05 / completed catalogue report

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 Catalogue Unit-Price Normalizer

Turn mixed supplier pack prices into comparable prices per **kilogram, litre or item**, with a separate exception report for rows that cannot be normalized safely.

For example, **12 x 250g at AUD 36.00** becomes **3 kg at AUD 12.0000 per kg**. A 750ml pack at AUD 3.00 becomes AUD 4.0000 per litre.

Use this Actor as a repeatable preprocessing step in a catalogue or purchasing workflow. It processes the CSV you supply; it does not scrape websites or change your store.

### Quick start

1. Prepare a UTF-8 CSV with one column each for SKU, name, pack size, pack price and currency.
2. Paste the CSV into **CSV text** in the Input tab, or send it as the `csv_text` property through the API.
3. Run the Actor and open **Quality report JSON** first.
4. Download **Clean catalogue CSV** and **Rows requiring review CSV**. Check the exceptions before using the accepted rows downstream.

Example API input:

```json
{
  "csv_text": "sku,name,pack_size,price,currency\nDEMO-COFFEE,Coffee beans,12 x 250g,36.00,AUD\nDEMO-JUICE,Juice,750ml,3.00,AUD\nDEMO-REVIEW,Unknown pack,one box,9.00,AUD\n"
}
```

This example produces two accepted products and one review row. Coffee normalizes to 3 kg at 12.0000 AUD/kg; juice normalizes to 0.75 litre at 4.0000 AUD/litre. The unknown pack is excluded and explained in the review file.

Only `csv_text` is accepted. Do not pass a file path, URL, command or additional options. Inline text avoids needing a public download URL for your supplier file.

### Required columns and aliases

Include exactly one matching column for each field. Header matching ignores case and normalizes spaces and punctuation to underscores, so `Pack size` matches `pack_size`.

| Field | Accepted column names |
| --- | --- |
| SKU | `sku`, `product_code`, `item_code`, `stock_code`, `code` |
| Product name | `name`, `title`, `description`, `product_name`, `item_description` |
| Pack size | `pack_size`, `pack`, `size`, `quantity`, `unit_size` |
| Pack price | `price`, `cost`, `unit_cost`, `pack_price`, `wholesale_price` |
| Currency | `currency`, `currency_code` |

Blank or duplicate normalized headers are rejected. Multiple aliases for the same required field, such as both `sku` and `product_code`, are also rejected rather than choosing one silently. Extra unrelated columns are not included in the normalized output.

### Pack sizes, prices and currencies

Supported examples include `12 x 250g`, `500g`, `1.5kg`, `750ml`, `2 litres`, `6 each` and `24 pcs`. A bare number is treated as an item count; use an explicit mass or volume unit whenever that is what the number represents.

| Input unit | Output base unit |
| --- | --- |
| `mg`, `g`, `kg` | `kg` |
| `ml`, `l`, `litre`, `litres` | `litre` |
| `each`, `ea`, `unit`, `units`, `pc`, `pcs` | `item` |

Pack quantities must be positive. Multipack counts must be whole numbers. Free-text sizes such as `one box`, unsupported units such as `gallon`, and zero quantities are flagged for review.

Prices must be nonnegative plain decimals, for example `36`, `36.00` or `0.50`. Currency symbols, thousands separators, scientific notation and negative prices are not accepted. Up to six digits after the decimal point are supported.

Supported currency codes are **AUD, NZD, USD, CAD, GBP, EUR, CHF, JPY, SGD, HKD, CNY, INR and ZAR**. Codes are normalized to uppercase. Currency is required on every row; no currency or exchange rate is guessed.

Unit prices are rounded to **four decimal places**, using half-up rounding. Compare prices only within the same base unit and currency.

### Results

| Result | Contents |
| --- | --- |
| `clean_catalogue.csv` | Accepted products and calculated unit prices |
| `review_required.csv` | Excluded rows with CSV record number, SKU and reason |
| `quality_report.json` | Submitted, accepted and review counts; status; submitted CSV text SHA-256 |
| Validated products dataset | Accepted product records for API or workflow integrations |
| Delivery summary | Report counts and artifact links after output delivery completes |

The accepted product fields are `sku`, `name`, `pack_size_original`, `pack_count`, `base_quantity`, `base_unit`, `pack_price`, `currency` and `price_per_base_unit`.

The original pack-size text is retained. Product-name whitespace is normalized. SKU matching is case-sensitive: the **first valid occurrence** of an SKU is retained and later occurrences go to the review file. This rule does not establish that the retained price is the authoritative supplier price.

Formula-like text is prefixed with an apostrophe in exported text cells to reduce spreadsheet formula-injection risk. Consumers should preserve this protection when importing or exporting the results.

### Understanding the report

- **`passed`** means all submitted product rows were accepted by the supported validation rules.
- **`review_required`** means some rows were excluded, or none could be accepted. Review the exceptions before importing the clean subset.
- An invalid input envelope, missing or ambiguous headers, malformed CSV or an exceeded input limit causes the run to fail instead of returning a successful catalogue.

A successful run means processing completed. It does not mean every source row was accepted, every supplier fact is correct, or the catalogue is ready to import into a particular commerce system.

### Limits

- One supplied CSV per run; comma, semicolon and tab separators are supported.
- Maximum **10 MB of UTF-8 CSV text**, **20 MB of JSON input**, and **50,000 product records**.
- Maximum **100,000 characters per CSV field**.
- A price string may contain at most 24 characters. A pack-size string may contain at most 64 characters, with at most nine digits in the multipack count and twelve digits in the pack amount.
- No XLSX, PDF, image, archive or remote URL input.

### Pricing

**See the Pricing tab for the current rate before starting a run.** Completion-based billing uses one `catalogue-report-completed` event for a completed report containing at least one accepted product.

The charge covers the clean CSV, review CSV, quality report and dataset. It applies **once per report**, regardless of row count or number of result files. There is no per-row completion charge.

A report containing both accepted and rejected rows is still a completed report and is charged once. Rejected input and reports with **no accepted products** do not request a completion charge. No external API key is needed.

### Scope and comparison cautions

This Actor normalizes one supplied catalogue. It does not match products across suppliers, find the cheapest equivalent product, detect changes between old and new lists, convert currencies, account for tax/freight/discount terms, verify supplier facts or update a storefront.

Different brands, grades, specifications, currencies and tax bases still require a like-for-like comparison. Keep the source file and report together for traceability.

### Hosted data

Input and output are processed on **Apify**, in the run's default storage. Access and retention depend on the calling account's Apify settings and applicable platform policies. This is a hosted service, not local-only processing.

Only submit catalogue data you have permission to process. Do not include passwords or unrelated personal information. Treat run and storage links as sensitive, and remove stored run data when it is no longer needed. Actor logs contain aggregate processing counts rather than the submitted CSV rows.

# Actor input Schema

## `csv_text` (type: `string`):

Inline CSV content. Currency must be an explicit supported three-letter code. Pack sizes can be 12 x 250g, 750ml or 6 each. Do not include credentials or personal information unrelated to the catalogue.

## Actor input object example

```json
{
  "csv_text": "SKU,Name,Pack size,Price,Currency\nCOF-1,Coffee,12 x 250g,36,AUD\nJCE-1,Juice,750ml,3,NZD\n"
}
```

# Actor output Schema

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

No description

## `cleanCatalogue` (type: `string`):

No description

## `reviewRequired` (type: `string`):

No description

## `qualityReport` (type: `string`):

No description

## `dataset` (type: `string`):

No description

# 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 = {
    "csv_text": `SKU,Name,Pack size,Price,Currency
COF-1,Coffee,12 x 250g,36,AUD
JCE-1,Juice,750ml,3,NZD`
};

// Run the Actor and wait for it to finish
const run = await client.actor("rose_dwelling/supplier-catalogue-unit-price-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 = { "csv_text": """SKU,Name,Pack size,Price,Currency
COF-1,Coffee,12 x 250g,36,AUD
JCE-1,Juice,750ml,3,NZD
""" }

# Run the Actor and wait for it to finish
run = client.actor("rose_dwelling/supplier-catalogue-unit-price-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 '{
  "csv_text": "SKU,Name,Pack size,Price,Currency\\nCOF-1,Coffee,12 x 250g,36,AUD\\nJCE-1,Juice,750ml,3,NZD\\n"
}' |
apify call rose_dwelling/supplier-catalogue-unit-price-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rose_dwelling/supplier-catalogue-unit-price-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/UhANHdcBTCNNTpjwx/builds/rL15R1DoFCyFAubGo/openapi.json
