# CatalogGate: Product Catalog Audit (`shoyeb/catalog-gate`) Actor

Compare two product catalog snapshots before publishing. Flag large price changes, missing SKUs, stock-outs, currency switches and invalid data. Deterministic JSON and CSV reports for AI agents and commerce workflows.

- **URL**: https://apify.com/shoyeb/catalog-gate.md
- **Developed by:** [Shoyeb Sheik](https://apify.com/shoyeb) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$200.00 / 1,000 completed catalog audits

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

## CatalogGate: Product Catalog Audit

Catch unexpected price changes, missing SKUs, stock-outs and currency switches before a product catalog update reaches your store.

Supply a complete previous snapshot and a complete proposed snapshot as JSON arrays. Get a deterministic hold/review decision, field-level changes, and downloadable JSON and CSV reports. No LLM API key, proxy or store login is required.

### Use it for

- Reviewing a supplier catalog before a scheduled import.
- Adding a review gate to an agency's product-data workflow.
- Giving an AI agent exact change evidence before it proposes a publishing action.

### Minimal input

```json
{
  "previous": [{"id":"001","title":"Linen shirt","price":1499,"currency":"INR","availability":"in_stock"}],
  "current": [{"id":"001","title":"Linen shirt","price":149.9,"currency":"INR","availability":"in_stock"}],
  "options": {"priceThresholdPct":20,"removalThresholdPct":10,"stockOutThresholdPct":20}
}
```

The example returns BLOCK with a 90% price drop. This is a review recommendation; CatalogGate does not connect to or alter your publishing system.

### Outputs

- `OUTPUT`: full JSON report with status, summary, findings and changes.
- `CHANGES`: spreadsheet-safe CSV of changed fields.
- `FINDINGS`: CSV of triggered checks.
- `Audit summary` (default view): one compact dataset row per completed audit.

Use the summary for large catalogs. The full JSON and both CSV exports retain all details; download these from the run's Storage tab when a large inline preview is slow.

PASS means no changes in checked fields. REVIEW means changes require review. BLOCK means a configured threshold or currency check triggered. INVALID means inputs could not be safely compared; no comparison was performed. NOT_RUN means the budget cannot cover an audit. The summary dataset and CSV records are empty or absent on INVALID or NOT_RUN; see OUTPUT for details.

### Rules and limits

Up to 10,000 products and 5 MB encoded JSON per snapshot. Default fields: id, title, price, currency, availability. Override flat field names through idField, titleField, priceField, currencyField and stockField. IDs are case-sensitive and trimmed. Duplicate/missing IDs, invalid prices and unknown stock values stop comparison.

Prices must be positive decimals with a three-letter currency field or suffix. Symbols and thousands separators are not accepted. Currency switching is flagged without conversion. Availability accepts in_stock, out_of_stock, preorder, backorder, booleans and nonnegative quantities. Thresholds are inclusive. Removed products are counted against the baseline; new stock-outs are counted against previously in-stock products.

This version accepts inline JSON arrays only. It does not fetch URLs, read other Apify datasets, store baselines or schedule itself. Other columns, merchant policy approval, live prices, images and page availability are not checked. An intentional large promotion may correctly trigger review.

### Pricing and data

Price: $0.20 per completed audit, with platform usage included and no separate start or dataset-item fee. One audit compares up to 10,000 products in each snapshot. The configured Store pricing is authoritative. Invalid inputs do not trigger the custom audit event. A free-plan run may still consume platform credits; consult the pricing tab.

Inputs and results are processed and retained by Apify according to the account's storage settings. The browser demo's local-processing claim does not apply to hosted runs.

For support, open an issue with redacted sample rows and the observed result. Do not post confidential catalogs, account tokens or personal data in public issues.

# Actor input Schema

## `previous` (type: `array`):

Baseline product objects. Up to 10,000 rows and 5 MB encoded JSON. Defaults: id, title, price, currency, availability. IDs are case-sensitive.

## `current` (type: `array`):

Complete new snapshot, not just changed products. Empty means remove every baseline product. Up to 10,000 rows and 5 MB encoded JSON.

## `options` (type: `object`):

Optional: idField, titleField, priceField, currencyField, stockField; priceThresholdPct (20), removalThresholdPct (10), stockOutThresholdPct (20). Thresholds range 0–100, inclusive. Flat field names only.

## Actor input object example

```json
{
  "previous": [
    {
      "id": "001",
      "title": "Linen shirt",
      "price": 1499,
      "currency": "INR",
      "availability": "in_stock"
    }
  ],
  "current": [
    {
      "id": "001",
      "title": "Linen shirt",
      "price": 149.9,
      "currency": "INR",
      "availability": "in_stock"
    }
  ],
  "options": {
    "priceThresholdPct": 20,
    "removalThresholdPct": 10,
    "stockOutThresholdPct": 20
  }
}
```

# Actor output Schema

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

One compact row per completed audit. For INVALID or NOT_RUN, read the full JSON report instead.

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

No description

## `changes` (type: `string`):

No description

## `findings` (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 = {
    "previous": [
        {
            "id": "001",
            "title": "Linen shirt",
            "price": 1499,
            "currency": "INR",
            "availability": "in_stock"
        }
    ],
    "current": [
        {
            "id": "001",
            "title": "Linen shirt",
            "price": 149.9,
            "currency": "INR",
            "availability": "in_stock"
        }
    ],
    "options": {
        "priceThresholdPct": 20,
        "removalThresholdPct": 10,
        "stockOutThresholdPct": 20
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("shoyeb/catalog-gate").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": [{
            "id": "001",
            "title": "Linen shirt",
            "price": 1499,
            "currency": "INR",
            "availability": "in_stock",
        }],
    "current": [{
            "id": "001",
            "title": "Linen shirt",
            "price": 149.9,
            "currency": "INR",
            "availability": "in_stock",
        }],
    "options": {
        "priceThresholdPct": 20,
        "removalThresholdPct": 10,
        "stockOutThresholdPct": 20,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("shoyeb/catalog-gate").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": [
    {
      "id": "001",
      "title": "Linen shirt",
      "price": 1499,
      "currency": "INR",
      "availability": "in_stock"
    }
  ],
  "current": [
    {
      "id": "001",
      "title": "Linen shirt",
      "price": 149.9,
      "currency": "INR",
      "availability": "in_stock"
    }
  ],
  "options": {
    "priceThresholdPct": 20,
    "removalThresholdPct": 10,
    "stockOutThresholdPct": 20
  }
}' |
apify call shoyeb/catalog-gate --silent --output-dataset

```

## MCP server setup

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

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/yNmid7FPzQIWB4RUB/builds/hLanj3Ri5jgTm84f5/openapi.json
