# Shopify Products Scraper & Price/Stock Change Monitor (`gr8data/shopify-store-monitor`) Actor

Shopify products scraper: the full catalog (products, variants, prices, stock) for a flat $0.005 per store, not per product. Or schedule it and pay only for changes: price, sales, sold-out, restocks and new products. CSV and HTML report.

- **URL**: https://apify.com/gr8data/shopify-store-monitor.md
- **Developed by:** [Gr8 Data](https://apify.com/gr8data) (community)
- **Categories:** E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 catalog changes delivered

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

## Shopify Products Scraper & Price/Stock Change Monitor

**Shopify products scraper.** Set `onlyChanges: false` to get the full catalog of any Shopify store (every product and variant with price, compare-at price, stock, SKU and images) as dataset rows. You are charged **$0.005 per store, not per product**: in a real platform run, 2 stores, 198 products and 670 variant rows were billed as 2 store checks ($0.01). Keep the default `onlyChanges: true` on a schedule to pay only for what changed.

Monitor competitor Shopify storefronts on a schedule and receive **only what changed** since your previous run — new products, removed products, price changes, sales started and ended (`compare_at_price`), stockouts, restocks, and new variants — along with store catalog summaries, a spreadsheet-safe CSV export, and a self-contained interactive `report.html`.

Not affiliated with, endorsed by or sponsored by Shopify or any store listed. It reads public storefront `products.json` feeds and `robots.txt` without proxies, logins, or anti-bot bypasses.

[![30-second walkthrough: only-changes tracking, old and new prices, stock changes and honest coverage from a real run](https://img.youtube.com/vi/koX_ForBIH0/maxresdefault.jpg)](https://www.youtube.com/watch?v=koX_ForBIH0)

![Report overview: one card per store with products, available variants, changes, price range and share on sale; a blocked store is reported, not counted](https://simple-free-apps.github.io/listings/shopify-store-monitor/report-overview.png)

*From a real run on Apify, 6 hours after the first: 10 of 11 stores read, 230 changes. Gymshark answered 403, so it is reported as blocked and charged nothing.*

![Back-in-stock filter: each row shows the store, product, variant, SKU and the old and new availability](https://simple-free-apps.github.io/listings/shopify-store-monitor/back-in-stock.png)

![Change details: a sale that ended, with old price 3.00, new price 9.00, the change percent and when it was first seen](https://simple-free-apps.github.io/listings/shopify-store-monitor/change-details.png)

### You pay for what changed, not for the whole catalog

Most Shopify scrapers charge for every product on every run, so watching the same stores daily means paying for the same catalog again and again. This Actor charges for **change rows** plus one small event per store checked. Unchanged products are free, and so are the first-run baseline, the full catalog snapshot, summaries, blocked stores and preview runs.

**Real example (the run in the screenshots above):** 10 stores, **7,783 products** and 63,169 variants read. Billed: **230 change events + 10 store checks**. A per-product tool would bill 7,783 product rows for the same run, and again on the next one.

### What a run gives you

- **Dataset (`changes`, `store-summary`, `run-summary` views):**
  - One `change` row per detected change (`changeType`: `new-product`, `removed-product`, `price-change`, `sale-started`, `sale-ended`, `sold-out`, `restocked`, `new-variant`), including `store`, `productId`, `variantId`, `title`, `variantTitle`, `sku`, `vendor`, `productType`, `url`, `image`, `old`, `new`, `changePercent`, `firstSeenAt`, and `readAt`.
  - One `store-summary` row per store: products count, available variants count, change counts by type, average/min/max price, percentage of variants on sale, products added in the last 30 days (from `published_at`), `catalogComplete` flag, or honest failure status (`no-public-catalog`, `blocked`, `not-shopify`, `robots-disallowed`, `unreachable`).
  - One `run-summary` row with honest status: `COMPLETE`, `COMPLETE_WITH_FAILURES`, `LIMIT_REACHED`, `PARTIAL`, or `PREVIEW`.
- **First-run baseline & free catalog snapshot:** On the first run of any store, the Actor does not flood you with every product marked as "new". Instead, it saves the baseline silently, emits the `store-summary` row, and writes a free full catalog snapshot (`catalog-<store>.json`) to the default key-value store.
- **`report.html` (key-value store):** One self-contained interactive HTML report with light and dark themes, mobile-responsive layout, keyboard navigation, print styles, store overview cards, **Biggest Price Drops**, **Back in Stock**, and **New Arrivals** highlights, plus filters by store, change type, percentage threshold, and search.
  - **Image CSP:** `report.html` enforces a strict Content Security Policy (`default-src 'none'; img-src https://cdn.shopify.com; ...`) with SHA-256 hashes for inline CSS and JS. Product images load directly from Shopify's CDN (`cdn.shopify.com`) and hide cleanly if offline or blocked.
- **`export.csv` (key-value store):** Delivered changes as CSV, protected against spreadsheet formula injection (leading `=`, `+`, `-`, `@`, full-width equivalents, tabs, and line breaks — even behind spaces or invisible characters — are neutralized with a leading `'`).
- **Preview mode (`preview: true`):** Reads page 1 of each store to return product counts and up to 3 sample products per store without charging or modifying tracking state.

### Incremental tracking (`onlyChanges`)

When `onlyChanges` is enabled (the default):

- **Per-store state isolation:** Each store's baseline state is stored independently in a named key-value store (`shopify-store-monitor-state`) keyed by `t-<sha256(finalDomain)>` (with automatic atomic sharding for large catalogs up to 20,000 products). Adding or removing a store in your input never resets history for your other monitored stores.
- **No duplicate delivery or charging:** Redirects are resolved to the store's canonical `finalDomain`; duplicate store aliases in the input and pagination overlaps are deduplicated so the same change is never delivered or charged twice in one run.
- **Failure safety:** If a store blocks requests (`403` / `429` / challenge), disallows `/products.json` in `robots.txt`, or has no public catalog, it is reported in `failedStores` (`COMPLETE_WITH_FAILURES`), never retried aggressively, never charged, and **never modifies saved tracking state**.
- **Per-store concurrency lock:** Overlapping runs targeting the same store exit cleanly with exit code `3` and charge nothing, while runs monitoring disjoint stores can execute concurrently.
- **Migration & restart safety:** Delivered changes and checked stores are checkpointed (`CHECKPOINT`) so a migrated or restarted run never delivers or charges the same item twice.
- **Strict input validation:** Empty, malformed, or contradictory inputs (e.g. `stores: []`, localhost/private IPs, out-of-range limits) fail immediately with exit code `2` before any network request or charge. Empty input `{}` runs a working 2-store default (`www.hauslabs.com` and `www.deathwishcoffee.com`).

### Pricing (Pay per event)

| Event | Charged when |
|---|---|
| `store-checked` | Once per Shopify store read completely and successfully |
| `catalog-change` | Once per `change` row delivered to the dataset |
| First-run baseline & `catalog-<store>.json` snapshot, `store-summary`, `run-summary`, failed/blocked stores, `preview: true` | Free |

This Actor never uses `apify-default-dataset-item`. It charges and pushes changes in batches while respecting your `maxTotalChargeUsd` budget limit, never delivers uncharged rows when the limit is hit, and stops cleanly with status `LIMIT_REACHED`.

### Known limits (honest)

- **Not every Shopify store exposes `products.json`:** Some stores disable `/products.json` (returning `404` or HTML) or enforce bot protection (`403` / `429` / Cloudflare challenge). When that happens, this Actor stops querying that store immediately without proxies or bypasses and reports the reason honestly (`no-public-catalog`, `blocked`, `robots-disallowed`, or `not-shopify`).
- **Default storefront currency only:** Prices are reported exactly as exposed by `products.json` in each store's default storefront currency. The Actor does not perform currency conversion.
- **Removed-product rule (`removed-product`):** A product is marked `removed-product` **only** when the entire store catalog is read to completion below `maxProductsPerStore`. If reading stops early due to `maxProductsPerStore` or an error, no products are marked removed and `removedDetectionSkipped: true` is reported explicitly.
- **Store `updated_at` timestamps are ignored:** Shopify storefronts often return the current fetch timestamp in `products.json` `updated_at`. Change detection compares actual saved variant prices, `compare_at_price`, and availability across runs rather than trusting `updated_at`.
- **Polite rate limiting without proxies:** Requests are spaced at least 1,050 ms apart per store host (maximum 1 request/second per store, up to 5 stores in parallel). Large stores with thousands of products take roughly 1 second per 250 products.
- **Embedded report cap:** `report.html` embeds up to the first 5,000 delivered changes to keep browser rendering fast; the dataset and `export.csv` contain all delivered changes.

# Actor input Schema

## `stores` (type: `array`):

List of Shopify store domains or URLs (e.g. www.hauslabs.com, https://www.deathwishcoffee.com, mystore.myshopify.com). Up to 100 stores.

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

Maximum number of products to fetch per store (1 to 20000). Note: removed-product detection only runs when the entire store catalog is read below this cap.

## `onlyChanges` (type: `boolean`):

When enabled, tracks each store independently in a named key-value store and delivers only changes since the previous run. On the first run of a store, saves a baseline and a free catalog-<store>.json snapshot.

## `trackPrices` (type: `boolean`):

Detect variant price changes (price-change) and sale transitions via compare_at_price (sale-started, sale-ended).

## `trackStock` (type: `boolean`):

Detect when variants sell out (sold-out) or come back in stock (restocked).

## `trackNewProducts` (type: `boolean`):

Detect new products (new-product), new variants (new-variant), and removed products (removed-product, only when full catalog read completes).

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

Ignore price-change, sale-started, and sale-ended events smaller than this absolute percentage (0 to 100). Set 0 to report all price changes.

## `currencyNote` (type: `string`):

Informational note stored in run-summary and report.html. Prices are reported in each store's default storefront currency from products.json without currency conversion.

## `preview` (type: `boolean`):

Read page 1 of each store to report product counts and 3 sample products without charging or modifying tracking state.

## Actor input object example

```json
{
  "stores": [
    "www.hauslabs.com",
    "www.deathwishcoffee.com"
  ],
  "maxProductsPerStore": 1000,
  "onlyChanges": true,
  "trackPrices": true,
  "trackStock": true,
  "trackNewProducts": true,
  "minPriceChangePercent": 0,
  "currencyNote": "Prices are reported in each store's default storefront currency as exposed by products.json. This Actor does not convert currencies.",
  "preview": false
}
```

# Actor output Schema

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

One row per detected change, plus store-summary rows and one run-summary row.

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

Self-contained report.html: store cards, biggest price drops, back in stock, new arrivals, and filterable change table.

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

Delivered catalog changes as spreadsheet-safe CSV.

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

Run status, checked/failed stores, and counts.

# 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 = {
    "stores": [
        "www.hauslabs.com",
        "www.deathwishcoffee.com"
    ],
    "currencyNote": "Prices are reported in each store's default storefront currency as exposed by products.json. This Actor does not convert currencies."
};

// Run the Actor and wait for it to finish
const run = await client.actor("gr8data/shopify-store-monitor").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 = {
    "stores": [
        "www.hauslabs.com",
        "www.deathwishcoffee.com",
    ],
    "currencyNote": "Prices are reported in each store's default storefront currency as exposed by products.json. This Actor does not convert currencies.",
}

# Run the Actor and wait for it to finish
run = client.actor("gr8data/shopify-store-monitor").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 '{
  "stores": [
    "www.hauslabs.com",
    "www.deathwishcoffee.com"
  ],
  "currencyNote": "Prices are reported in each store'\''s default storefront currency as exposed by products.json. This Actor does not convert currencies."
}' |
apify call gr8data/shopify-store-monitor --silent --output-dataset

```

## MCP server setup

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

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/grYVtgfpiM2fELKX5/builds/qu8nS3Se2g76ZvxSk/openapi.json
