# Shopify Catalog Change Monitor: Prices & Variants (`practical_ai_lab_jp/pal-shopify-public-product-changes`) Actor

Monitor published Shopify catalog changes between bounded snapshots: newly listed and removed products, price moves, variant option differences and availability flips. Start with a baseline, then repeat the same public-store scan. No hidden inventory claims.

- **URL**: https://apify.com/practical_ai_lab_jp/pal-shopify-public-product-changes.md
- **Developed by:** [Practical AI Lab](https://apify.com/practical_ai_lab_jp) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 change records

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

## Shopify Catalog Change Monitor: Prices & Variants

Detects what changed in a public Shopify catalog between two points in time: newly listed products, removed products, added or removed variants, published price movements, compare-at price changes, stock flips and title edits. Output is one dataset row per change, not a full catalog dump.

It is built for recurring monitoring (for example a scheduled daily run), not for one-off exports. If you only need a current product list, a plain Shopify product scraper is a better fit.

### How it works

1. **First run per store** reads the public `/products.json` feed and saves a compact baseline in a named key-value store (`snapshotStoreName`). No change records are produced, so nothing is charged.
2. **Every later run** reads the feed again, compares it with the saved baseline, emits change records, then replaces the baseline.
3. **Offline mode** (optional): supply `baselineProducts` and `currentProducts` in Shopify `products.json` format that you already hold. No network access happens.

### Sample input

```json
{
    "storeUrls": ["https://www.allbirds.com"],
    "maxProductsPerStore": 500,
    "minPriceChangePercent": 1,
    "changeTypes": ["product_added", "product_removed", "price_changed", "availability_changed"],
    "snapshotStoreName": "my-catalog-snapshots"
}
```

Replace the store with one you are entitled to monitor. Use the store's canonical domain: redirects are not followed, and the error message tells you where a store redirects to.

### Input

| Field | Meaning |
| --- | --- |
| `storeUrls` | 1-10 public `https://` Shopify store addresses. |
| `maxProductsPerStore` | 1-5000, default 1000. |
| `minPriceChangePercent` | Ignore smaller price moves. Default 0. |
| `changeTypes` | Subset of the change types below. Empty means all. |
| `maxChangeRecords` | Per-store cap on emitted rows, default 1000. |
| `resetBaseline` | Replace the baseline with the current catalog; report nothing. |
| `snapshotStoreName` | Named key-value store holding baselines. |
| `requestDelaySeconds` | Pause between page requests, 0.5-30. |
| `baselineProducts`, `currentProducts` | Optional offline comparison. |

### Output

Change types: `product_added`, `product_removed`, `variant_added`, `variant_removed`, `price_changed`, `compare_at_price_changed`, `availability_changed`, `title_changed`.

Example row:

```json
{
    "store": "https://www.example-store.com",
    "change_type": "price_changed",
    "product_id": "123",
    "title": "Example Shirt",
    "product_url": "https://www.example-store.com/products/example-shirt",
    "variant_id": "456",
    "variant_title": "M",
    "sku": "SHIRT-M",
    "old_value": "20.00",
    "new_value": "15.00",
    "price_delta": "-5.00",
    "price_change_percent": "-25.00",
    "detected_at": "2026-01-02T00:00:00Z",
    "baseline_taken_at": "2026-01-01T00:00:00Z"
}
```

For `product_added` and `product_removed`, `variant_count` and `lowest_price` are filled instead of old/new values. A per-store summary (status, product count, change counts, warnings, errors) is saved to the `OUTPUT` record of the run's key-value store.

### Pricing and errors

The Actor emits one `change-record` event per change row, and only after the row is stored. Runs that fail, stores that error, baseline-creation runs and runs with no changes produce no charge events. The payable plan is configured separately on the platform; this repository does not set one.

### Safety

- Only `https://` store domains on the default port; IP addresses, credentials, local and internal host names are rejected.
- The host is resolved before use and must resolve only to public addresses.
- `robots.txt` is checked first; a disallow rule, or a 401/403/5xx on robots.txt, stops that store.
- Redirects are never followed; requests are sequential, delayed, size-limited and capped at 40 pages per store.
- No logins, proxies, cookies or personal data are used. Only product, variant, price and availability fields are kept.

### Limitations

- Works only for stores that leave `/products.json` publicly enabled. Many stores disable or restrict it.
- The feed shows the **storefront default** prices. It does not show currency, per-market prices, discounts applied at checkout, customer-specific prices, or exact inventory counts (only an in/out-of-stock flag).
- Catalogs larger than `maxProductsPerStore` are truncated. A truncated current snapshot cannot prove removal, so removals are skipped; a truncated baseline cannot prove addition, so additions are skipped. Warnings are written to the summary.
- Draft, hidden or unpublished products are not visible; "removed" can also mean "unpublished".
- Change detection depends on schedule frequency: several changes between two runs collapse into the net difference.
- DNS is checked before connecting but not pinned to the connection; a hostile DNS change between check and request is not fully excluded.
- Shopify store data may be subject to the store's terms and applicable law. You are responsible for lawful use.
- Results from a few stores or a few runs are anecdotal; treat price movement statistics from small samples with caution.

### Development

Offline tests: `python -m unittest discover -s tests`

# Actor input Schema

## `storeUrls` (type: `array`):

Public https:// addresses of Shopify stores (canonical domain, e.g. https://www.example-store.com). Up to 10 stores. Only monitor stores whose public feed you are entitled to read.

## `maxProductsPerStore` (type: `integer`):

Upper bound of products read per store and run (1-5000). If a catalog is larger, the snapshot is marked truncated and removals are not evaluated.

## `minPriceChangePercent` (type: `number`):

Ignore price movements smaller than this percentage. 0 reports every change.

## `changeTypes` (type: `array`):

Leave empty for all. Allowed: product_added, product_removed, variant_added, variant_removed, price_changed, compare_at_price_changed, availability_changed, title_changed.

## `maxChangeRecords` (type: `integer`):

Safety cap on the number of change records emitted per store and run.

## `resetBaseline` (type: `boolean`):

Replace the stored baseline with the current catalog and report no changes for this run.

## `snapshotStoreName` (type: `string`):

Name of the named key-value store that keeps baselines between runs. Use a different name per project.

## `requestDelaySeconds` (type: `number`):

Pause between page requests to a store (0.5-30). Keep this polite.

## `baselineProducts` (type: `array`):

Advanced. Products array in Shopify products.json format that you already hold. With currentProducts, no network access happens and exactly one store URL is used as a label.

## `currentProducts` (type: `array`):

Advanced. Newer products array in the same format, compared against baselineProducts.

## Actor input object example

```json
{
  "storeUrls": [
    "https://www.allbirds.com"
  ],
  "maxProductsPerStore": 1000,
  "minPriceChangePercent": 0,
  "changeTypes": [
    "product_added",
    "product_removed",
    "price_changed",
    "availability_changed"
  ],
  "maxChangeRecords": 1000,
  "resetBaseline": false,
  "snapshotStoreName": "pal-shopify-catalog-snapshots",
  "requestDelaySeconds": 1
}
```

# Actor output Schema

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

Download rows from the latest run in JSON/CSV.

# 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 = {
    "storeUrls": [
        "https://www.allbirds.com"
    ],
    "changeTypes": [
        "product_added",
        "product_removed",
        "price_changed",
        "availability_changed"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("practical_ai_lab_jp/pal-shopify-public-product-changes").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 = {
    "storeUrls": ["https://www.allbirds.com"],
    "changeTypes": [
        "product_added",
        "product_removed",
        "price_changed",
        "availability_changed",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("practical_ai_lab_jp/pal-shopify-public-product-changes").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 '{
  "storeUrls": [
    "https://www.allbirds.com"
  ],
  "changeTypes": [
    "product_added",
    "product_removed",
    "price_changed",
    "availability_changed"
  ]
}' |
apify call practical_ai_lab_jp/pal-shopify-public-product-changes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,practical_ai_lab_jp/pal-shopify-public-product-changes"
        }
    }
}
```

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/sbX39b26Gn86Yifiq/builds/ESMngOkZlgtrBwjEF/openapi.json
