# Catalogue Import Guard — CSV Change Report (`theonlyxic/my-actor`) Actor

Compare two product CSV exports before importing. Report added or removed SKUs, price and stock changes, missing columns, and suspicious price drops. Preserve leading zeros and original text. Deterministic processing with no AI. Up to 10,000 rows per file.

- **URL**: https://apify.com/theonlyxic/my-actor.md
- **Developed by:** [IGNITE Tools](https://apify.com/theonlyxic) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$500.00 / 1,000 completed catalogue comparisons

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

## Catalogue Import Guard

Compare two product CSV exports before importing changes. Receive a JSON report of added and removed products, changed fields, missing columns, suspicious price drops and zero/negative prices.

### Input

Paste previous_csv and current_csv; choose a unique key_column (default sku), price_column (default price; empty disables checks), ignored columns, price-drop threshold (default 30%) and removal threshold (default 10%).
Each file: UTF-8, comma-separated, header required, at most 2 MiB, 10,000 data rows and 40 columns.
Duplicate or blank keys and malformed rows are rejected. Headers must be unique, nonblank and at most 128 characters. Maximum 50,000 changed cells and 8 MiB report; split large comparisons into batches.
Plain decimal prices only, at most 24 characters. Currency symbols, thousands separators and other formats are flagged for review, never guessed.

### Output

One JSON report with summary, changes, additions, removals, flags, settings and source hashes. Product codes, leading zeros and original text are preserved. Row order does not affect comparison. Blank rows are counted and skipped. A missing value is distinct from an empty string.
no_configured_flags means no configured checks triggered. It does not certify a safe import or validate business correctness.

### Data

The comparison uses deterministic Python, with no AI or outbound requests in the core. Cloud runs pass input and output through Apify storage and its retention/access controls. Use only public, synthetic or non-sensitive data you are authorised to provide. Do not submit customer personal data or secrets.
CSV text is treated as data. Formula-like text is preserved; do not evaluate returned values as spreadsheet formulas.
This tool reports changes; it does not modify your shop or perform an import.

### Pricing

US$0.50 per completed comparison. No startup charge. Invalid input is rejected before a comparison is produced. Check the run's cost limit before starting.

# Actor input Schema

## `previous_csv` (type: `string`):

UTF-8 comma-separated CSV; maximum 2 MiB, 10000 data rows, 40 columns.

## `current_csv` (type: `string`):

New export with exact unique product keys. Same limits.

## `key_column` (type: `string`):

Exact header of the unique product identifier column.

## `price_column` (type: `string`):

Plain decimal prices; empty disables price checks.

## `ignore_columns` (type: `array`):

Exclude volatile columns.

## `price_drop_percent` (type: `number`):

Percentage threshold between 0 and 100.

## `removal_percent` (type: `number`):

Percentage of previous products removed; threshold between 0 and 100.

## Actor input object example

```json
{
  "previous_csv": "sku,name,price,stock\n001,Blue mug,29.95,10\n002,Red mug,12.00,5\n003,Green mug,15.00,0\n",
  "current_csv": "sku,name,price,stock\n001,Blue mug,2.99,10\n003,Green mug,15.00,5\n004,Yellow mug,20.00,8\n",
  "key_column": "sku",
  "price_column": "price",
  "ignore_columns": [],
  "price_drop_percent": 30,
  "removal_percent": 10
}
```

# Actor output Schema

## `report` (type: `string`):

JSON report of catalogue additions, removals, field changes and review flags.

# 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 = {
    "previous_csv": `sku,name,price,stock
001,Blue mug,29.95,10
002,Red mug,12.00,5
003,Green mug,15.00,0`,
    "current_csv": `sku,name,price,stock
001,Blue mug,2.99,10
003,Green mug,15.00,5
004,Yellow mug,20.00,8`
};

// Run the Actor and wait for it to finish
const run = await client.actor("theonlyxic/my-actor").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 = {
    "previous_csv": """sku,name,price,stock
001,Blue mug,29.95,10
002,Red mug,12.00,5
003,Green mug,15.00,0
""",
    "current_csv": """sku,name,price,stock
001,Blue mug,2.99,10
003,Green mug,15.00,5
004,Yellow mug,20.00,8
""",
}

# Run the Actor and wait for it to finish
run = client.actor("theonlyxic/my-actor").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 '{
  "previous_csv": "sku,name,price,stock\\n001,Blue mug,29.95,10\\n002,Red mug,12.00,5\\n003,Green mug,15.00,0\\n",
  "current_csv": "sku,name,price,stock\\n001,Blue mug,2.99,10\\n003,Green mug,15.00,5\\n004,Yellow mug,20.00,8\\n"
}' |
apify call theonlyxic/my-actor --silent --output-dataset

```

## MCP server setup

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

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/1NxB7PFTxMSkH2WGV/builds/0ubGEajXkRjeMsQBd/openapi.json
