# Product Catalog Diff by SKU | Revenue Pilot (`logical_resourcefulnes/revenue-pilot`) Actor

For catalog-import reviewers: compare two complete JSON product catalogs by SKU. Get added, removed and field-level changes, a summary and detailed JSON. USD0.05 per completed comparison, including no changes. No CSV, Excel or URL input. Run without individual approval.

- **URL**: https://apify.com/logical_resourcefulnes/revenue-pilot.md
- **Developed by:** [Revenue Pilot](https://apify.com/logical_resourcefulnes) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 comparison completeds

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

## Product Snapshot Diff

Compare an earlier and a later product catalog. Get added products, removed
products and field-level changes in one JSON result. Use it after collecting
two snapshots, or before reviewing a catalog import.

### Current availability

This version supports general use without individual approval.
Processing can be paused by the operator; a paused run does not start a new
comparison or submit a new comparison charge after the pause is detected. Requests already sent before detection cannot be guaranteed to be cancelled. Review the current availability
and Pricing tab before starting. A completed comparison can incur a charge even
when it finds no changes.

Each row needs a unique string identifier, such as `sku`. Input order does not
affect the comparison. A missing field and a field containing `null` are
different; boolean and numeric values are also different. Nested objects are
compared as field values. Arrays inside a field preserve their order.

### Input

Supply `before`, `after`, `key`, `before_complete`, and `after_complete`.
Only mark a snapshot complete if the upstream collection has finished.
The Actor cannot independently verify that declaration.

Limits: 10,000 rows per snapshot, 5 MiB input JSON, and 16 MiB result JSON.
Identifiers must be strings; use `"00123"` when leading zeros matter.
URLs, CSV files and Excel files are not accepted in this version.

### Example 1: price change, added product, removed product

```json
{
  "key": "sku",
  "before_complete": true,
  "after_complete": true,
  "before": [{"sku":"A","price":100},{"sku":"B","price":200}],
  "after": [{"sku":"A","price":110},{"sku":"C","price":300}]
}
```

The result has `status: "completed"`, counts of one added, one removed and
one changed product, and a `changes` array containing the affected fields.

### Example 2: identical snapshots

```json
{
  "before_complete": true,
  "after_complete": true,
  "before": [{"sku":"A","price":100}],
  "after": [{"sku":"A","price":100}]
}
```

The result is completed with an empty `changes` array. A completed comparison
is a billable event even when it finds no changes.

### Example 3: an unexpected empty snapshot

```json
{
  "before_complete": true,
  "after_complete": true,
  "before": [{"sku":"A","price":100}],
  "after": []
}
```

The result is held with `empty_after_requires_explicit_intent`, with no
comparison event charged. If the empty catalog is intentional, set
`allow_empty_after: true` to receive the removal list.

### Retrieve the result

Open the run's default key-value store and read the `OUTPUT` record as JSON.
The API equivalent is `GET /v2/key-value-stores/{storeId}/records/OUTPUT`.
Use the authenticated access method shown by Apify for your run.

For a completed comparison, the run's dataset also contains one summary row
with the added, removed and changed counts. That row is not the full list of
changes; use `OUTPUT` for the field-level details. Dataset storage or later
exports can incur platform usage charges under your Apify plan.

`completed` means a valid comparison was produced. `held` means the completeness
or empty-input declaration needs attention. `rejected` means an input limit or
validation rule was violated. Check `reason` for held or rejected results.

### Charging and retries

One completed comparison costs USD 0.05 under the existing comparison-completed event. Confirm the active Pricing tab before running. Set the
run's maximum charge to at least that amount. Held and rejected comparisons do
not trigger the comparison event. There is no per-row comparison event.

The result is saved before the comparison event is submitted. Restarts of the
same run do not deliberately resubmit an uncertain charge. Starting a new run
is a new comparison and can incur a separate charge; retrieve the existing run
before submitting again. If an event's status is uncertain, the system leaves
it for reconciliation instead of charging again.

### Data handling

Input and output are processed in the run and stored in Apify's run storage.
This Actor does not send product data to a language model or fetch product
pages. It does not change your catalog, stock, or prices. Use only data you are
authorized to process. Avoid personal information and secrets in product rows.

### Support

Use this Actor's Issues tab for reproducible defects. Include the error reason
and a minimal example with invented product values. Do not post credentials,
private catalog records, or private run links in a public issue.

# Actor input Schema

## `before` (type: `array`):

JSON objects, at most 10000 records. Each record needs a unique string key.

## `after` (type: `array`):

The complete later snapshot, at most 10000 records.

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

Field used as the unique record identifier in both snapshots.

## `before_complete` (type: `boolean`):

Confirm that the earlier snapshot contains every record for the comparison scope.

## `after_complete` (type: `boolean`):

Confirm that the later snapshot contains every record for the comparison scope.

## `allow_empty_after` (type: `boolean`):

Allow an intentionally empty later snapshot; otherwise empty input is rejected as unsafe.

## Actor input object example

```json
{
  "key": "sku",
  "before_complete": false,
  "after_complete": false,
  "allow_empty_after": false
}
```

# Actor output Schema

## `comparison` (type: `string`):

JSON result with completion status, added and removed products, and field changes. Access uses the permissions of this run's default key-value store.

# 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("logical_resourcefulnes/revenue-pilot").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("logical_resourcefulnes/revenue-pilot").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 logical_resourcefulnes/revenue-pilot --silent --output-dataset

```

## MCP server setup

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

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/jfvLzmSoVRtfX9km4/builds/ljiR6YrBvVY3oB1RK/openapi.json
