# ONIX Catalog Diff (`onixcatalogdesk/onix-catalog-diff`) Actor

Compare two UTF-8 CSV catalog snapshots using a unique key. Export added and removed products and changed fields as JSON and CSV. Up to 20,000 rows per file. No store connection or automatic import.

- **URL**: https://apify.com/onixcatalogdesk/onix-catalog-diff.md
- **Developed by:** [Yurii Lobas](https://apify.com/onixcatalogdesk) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / completed 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/running/actors-in-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

## ONIX Catalog diff

Compare two complete catalog snapshots by an exact unique key. Report added or removed products and field changes. Duplicate or missing keys are rejected.

### Input

Supply CSV text using the input schema or INPUT.example.json. UTF-8 CSV, TSV and semicolon delimiters are supported. Maximum 5 MiB, 20,000 data rows and 100 columns per file. XLSX and XML are not supported. Diff requires a unique key in both files; the sample uses sku. Mapper requires an explicit target-to-source mapping. No store credentials are needed.

### Results

The default dataset holds individual findings, changes or mapped records. OUTPUT holds the complete JSON result; REPORT holds UTF-8 CSV. An empty audit dataset can mean no findings: check OUTPUT for counts. Results never automatically update a store.

### Data handling

Unlike the browser demo, cloud runs send supplied data to Apify storage. Use data you are authorized to process. Do not include customer personal data or credentials. The Actor does not fetch URLs in your CSV.

Contact: info@onyxautomationapp.com

### Pricing

One completed report costs USD 0.50, regardless of product or finding count. Apify also applies an Actor Start event of USD 0.00005 per GB (minimum one). Run with 128-1024 MB and a maximum-charge limit of at least USD 0.51. Platform usage during a customer run is included; later storage access may incur Apify fees.

A report with validation findings is still a completed report. The report event is requested only after CSV, dataset rows and the complete JSON have been saved. Invalid input or failed writes do not trigger the custom report event; the platform start event may still apply. No automatic retries or resumed runs are supported: contact support for a failed or uncertain charge before running again. A fresh run creates a separate report and may incur another charge. Own-account tests are not customer revenue.

# Actor input Schema

## `beforeCsv` (type: `string`):

Complete earlier UTF-8 CSV snapshot, up to 5 MiB and 20,000 rows. The key must be present and unique.

## `afterCsv` (type: `string`):

Complete later UTF-8 CSV snapshot, up to 5 MiB and 20,000 rows. The key must be present and unique.

## `key` (type: `string`):

Exact unique identifier column in both snapshots. Use sku for the supplied example.

## Actor input object example

```json
{
  "beforeCsv": "sku,title,price,stock\nA01,Oak desk,129.00,8\nA02,Reading lamp,39.00,15\nA03,Cotton throw,59.00,3\nA04,Wall shelf,49.00,7",
  "afterCsv": "sku,title,price,stock\nA01,Oak desk,119.00,6\nA02,Reading lamp,39.00,15\nA04,Wall shelf,49.00,0\nA05,Ceramic vase,24.00,12",
  "key": "sku"
}
```

# Actor output Schema

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

Audit findings, changed fields or mapped product records, depending on the workflow. An empty audit dataset can mean no findings; read the summary.

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

Complete workflow result, including counts and validation information. Written only after successful result persistence.

## `csv` (type: `string`):

Downloadable UTF-8 CSV for human review; never an automatic shop import.

# 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 = {
    "beforeCsv": `sku,title,price,stock
A01,Oak desk,129.00,8
A02,Reading lamp,39.00,15
A03,Cotton throw,59.00,3
A04,Wall shelf,49.00,7`,
    "afterCsv": `sku,title,price,stock
A01,Oak desk,119.00,6
A02,Reading lamp,39.00,15
A04,Wall shelf,49.00,0
A05,Ceramic vase,24.00,12`,
    "key": "sku"
};

// Run the Actor and wait for it to finish
const run = await client.actor("onixcatalogdesk/onix-catalog-diff").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 = {
    "beforeCsv": """sku,title,price,stock
A01,Oak desk,129.00,8
A02,Reading lamp,39.00,15
A03,Cotton throw,59.00,3
A04,Wall shelf,49.00,7""",
    "afterCsv": """sku,title,price,stock
A01,Oak desk,119.00,6
A02,Reading lamp,39.00,15
A04,Wall shelf,49.00,0
A05,Ceramic vase,24.00,12""",
    "key": "sku",
}

# Run the Actor and wait for it to finish
run = client.actor("onixcatalogdesk/onix-catalog-diff").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 '{
  "beforeCsv": "sku,title,price,stock\\nA01,Oak desk,129.00,8\\nA02,Reading lamp,39.00,15\\nA03,Cotton throw,59.00,3\\nA04,Wall shelf,49.00,7",
  "afterCsv": "sku,title,price,stock\\nA01,Oak desk,119.00,6\\nA02,Reading lamp,39.00,15\\nA04,Wall shelf,49.00,0\\nA05,Ceramic vase,24.00,12",
  "key": "sku"
}' |
apify call onixcatalogdesk/onix-catalog-diff --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,onixcatalogdesk/onix-catalog-diff"
        }
    }
}
```

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/BjViQk20PyfJflQ7S/builds/qyt3KktUzknx6fSM1/openapi.json
