# Shopify & WooCommerce Price & Stock Monitor (`cherry_hippopotamus/shopify-woo-price-stock`) Actor

Watch public Shopify and WooCommerce catalogs and get price drops, restocks, new SKUs, and removals since your last run — clean JSON, no login.

- **URL**: https://apify.com/cherry_hippopotamus/shopify-woo-price-stock.md
- **Developed by:** [Carson Packard](https://apify.com/cherry_hippopotamus) (community)
- **Categories:** E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 change detecteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & WooCommerce Price & Stock Monitor

> **Status:** listed on the Apify Store as [Shopify & WooCommerce Price & Stock Monitor](https://apify.com/cherry_hippopotamus/shopify-woo-price-stock). Pay-per-event pricing below is live.
> This Actor sends anonymous error and usage stats, including the run's input settings (URLs, cities, companies, filters) for debugging. No personal or scraped data is included. URLs are sent without query strings; emails, phone numbers, and secrets are masked. `disableTelemetry` turns this off.

Watch public **Shopify** and **WooCommerce** catalogs and get a clean JSON feed of **price drops**, **price rises**, **restocks**, **out-of-stock**, **new SKUs**, and **removed SKUs** since the last run. Give the Actor a list of store URLs. In **delta mode** it compares against a snapshot in a named key-value store, so a daily schedule becomes a price-and-stock change feed. Under Apify limited permissions, the Actor can create and reuse a named store for your account. If opening that store is forbidden (for example a store with the same name already exists outside this Actor's scope), the run still succeeds: it falls back to the run's default key-value store and records in the status and dataset that delta state was not persisted. Use a new `stateStoreName` so the Actor can create its own store.

### What it does

- Reads only the **public catalog JSON endpoints**: Shopify `/products.json` and `/collections/{handle}/products.json`, and the WooCommerce Store API `/wp-json/wc/store/v1/products` (variations via `type=variation` and `parent=`). No HTML scraping, no browser, no login, no API keys, no cart or checkout probing.
- Checks **robots.txt before every path**. On HTTP **403** or **429** it backs off and reports the store as blocked. It does not use proxies to evade blocks, and it does not bypass CAPTCHAs, logins, or paywalls.
- Normalizes every variant (or product) into one **frozen v1 schema**.
- **Delta mode** keeps the last snapshot in a named Apify key-value store and emits only the changes (optionally `unchanged` too). **Full mode** returns the current catalog.
- A store that fails mid-run **keeps its previous snapshot**. Its SKUs are not falsely marked `removed`.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `stores` | array (required) | — | Store home URLs, or a Shopify collection URL. Each item may include `platform` (`auto`, `shopify`, `woocommerce`) and `collection`. |
| `mode` | `full` | `delta` | `delta` | `full` returns every current row. `delta` returns changes since the last snapshot. |
| `includeUnchanged` | boolean | `false` | Also emit unchanged rows in delta mode. |
| `includeVariants` | boolean | `true` | One row per Shopify variant or Woo variation. Off: one row per product (lowest price; in stock if any variant is). |
| `minPriceChangePct` | number | `0` | Ignore smaller price moves. `0` reports any change. |
| `maxProductsPerStore` | integer | null | `null` | Cap products fetched per store (previews and tests). |
| `maxItems` | integer | null | `null` | Cap billed rows this run. Unemitted changes stay pending. Also honors `ACTOR_MAX_PAID_DATASET_ITEMS`. |
| `stateStoreName` | string | `price-stock-monitor-state` | Named key-value store for the snapshot. Use a distinct name per schedule. |
| `stateKey` | string | `snapshot` | Key inside that store. |
| `currencyOverride` | string | null | `null` | ISO 4217 code (for example `USD`) when Shopify `/products.json` has no currency. WooCommerce already publishes `currency_code`. |

The Store prefill uses `mode: "full"` and `maxItems: 50` so Apify's daily test finishes with a non-empty dataset in well under 5 minutes even after the default state store is warm. Actor defaults for omitted fields are unchanged (`mode` is still `delta`, `maxItems` is still uncapped).

Example — scheduled delta on a Shopify theme demo and a WooCommerce store:

```json
{
  "stores": [
    { "url": "https://theme-dawn-demo.myshopify.com", "platform": "shopify" },
    { "url": "https://bonsoy.com", "platform": "woocommerce" }
  ],
  "mode": "delta",
  "currencyOverride": "USD",
  "stateStoreName": "price-stock-monitor-state"
}
```

Example — one Shopify collection, full catalog, product-level rows:

```json
{
  "stores": [
    { "url": "https://theme-dawn-demo.myshopify.com/collections/all", "platform": "shopify" }
  ],
  "mode": "full",
  "includeVariants": false,
  "currencyOverride": "USD"
}
```

### Sample output

Real rows from public fixtures saved 2026-11-17 (America/Denver), after robots.txt allowed the path. Shopify currency comes from `currencyOverride` (`USD`). The price-drop example is a **simulated second run** on the Refresh demo fixture (price edited from $14.00 to $10.00); the Art Deco and Bonsoy rows are as published in the catalog JSON.

First-run (or full mode) sale item from the Dawn theme collection feed:

```json
{
  "item_key": "shopify:theme-dawn-demo.myshopify.com:6920725692505:39577010569305",
  "platform": "shopify",
  "store": "theme-dawn-demo.myshopify.com",
  "product_id": "6920725692505",
  "variant_id": "39577010569305",
  "sku": "3001-03-CY-1",
  "title": "Art Deco",
  "variant_title": "Cyclamen",
  "product_url": "https://theme-dawn-demo.myshopify.com/products/art-deco-cyclamen",
  "brand": "Mlouye",
  "categories": [],
  "price": 165.0,
  "regular_price": 375.0,
  "on_sale": true,
  "currency": "USD",
  "in_stock": false,
  "stock_status": "out_of_stock",
  "low_stock_remaining": null,
  "image_url": "https://cdn.shopify.com/s/files/1/0551/9242/0441/products/mlouye-art-deco-cyclamen-1_ec8e69b6-92ea-4c48-b8b6-34601cf3c070.jpg?v=1637106934",
  "change_type": "new",
  "changes": ["new"],
  "previous_price": null,
  "previous_in_stock": null,
  "price_change_pct": null,
  "first_seen_at": "2026-11-17T09:58:00-07:00",
  "last_seen_at": "2026-11-17T09:58:00-07:00",
  "removed_at": null,
  "source_url": "https://theme-dawn-demo.myshopify.com/collections/all/products.json",
  "store_status": "ok"
}
```

Delta price drop (simulated second run on the Refresh demo Conditioner SKU):

```json
{
  "item_key": "shopify:theme-refresh-demo.myshopify.com:7671434150140:42961977245948",
  "platform": "shopify",
  "store": "theme-refresh-demo.myshopify.com",
  "sku": "HN-CON-R-BX-1",
  "title": "Conditioner",
  "variant_title": null,
  "price": 10.0,
  "previous_price": 14.0,
  "price_change_pct": -28.57,
  "currency": "USD",
  "in_stock": true,
  "change_type": "price_drop",
  "changes": ["price_drop"],
  "store_status": "ok"
}
```

WooCommerce variation (Bonsoy, AUD; flavour taken from the parent product when the variation object has empty `attributes`):

```json
{
  "item_key": "woocommerce:bonsoy.com:5698:5705",
  "platform": "woocommerce",
  "store": "bonsoy.com",
  "product_id": "5698",
  "variant_id": "5705",
  "sku": "04873",
  "title": "Isotonic Hydration",
  "variant_title": "White Peach and Yuzu",
  "product_url": "https://bonsoy.com/shop/isotonic/?attribute_flavour=White+Peach+and+Yuzu",
  "price": 40.0,
  "regular_price": 40.0,
  "currency": "AUD",
  "in_stock": true,
  "change_type": "new",
  "changes": ["new"],
  "store_status": "ok"
}
```

`change_type` values: `new`, `removed`, `restock`, `out_of_stock`, `price_drop`, `price_increase`, `unchanged`. Primary priority is in that order (`new` first). A store that is blocked or disallowed by robots.txt emits a diagnostic row with `store_status` such as `blocked_403`, `blocked_429`, or `robots_disallow` (not billed, not snapshotted as catalog).

### Pricing (pay per event)

Live Store prices. Apify bills the synthetic start event once per GB of run memory (minimum one event). The default run memory is 1024 MB, so a typical run is charged one start event. Diagnostic store-status rows are not billed.

| Event | Price | When it is charged |
|---|---|---|
| Actor start (`apify-actor-start`) | $0.005 per start event | Synthetic platform event; not charged again from code |
| `product` | $0.001 | Every row in `full` mode, and `unchanged` rows in `delta` mode |
| `change-detected` | $0.004 | `delta` mode rows whose `change_type` is not `unchanged` |

Example: a daily delta on 5 stores × 2,000 SKUs with about 40 changes/day ≈ $0.005 + 40 × $0.004 = **$0.165/day**. Set a max charge per run in Apify to cap spend; the Actor stops cleanly when it is reached, and unemitted new or removed SKUs stay pending for the next run.

### How it behaves

- **Robots first.** `robots.txt` is fetched for the store origin, then checked again before every catalog or variation path. Shopify-style `*` and `$` wildcards are honored (longest path wins; Allow wins ties).
- **Polite delays.** Default 1 second between requests to the same host, or the file's `Crawl-delay` when it is longer. 5xx responses are retried with capped backoff. A 429 may wait once on `Retry-After` (capped at 30 s); if the block continues, the store is reported `blocked_429`.
- **No evasion.** No proxies, no User-Agent spoofing, no CAPTCHA/login/paywall bypass. HTTP 403 is reported as `blocked_403` and not retried as a workaround.
- **Failed stores keep state.** Prior snapshot rows stay in the named key-value store; they are not emitted as `removed`.
- **SSRF guards.** Only `http`/`https`, no credentials in the URL, no localhost, private, or link-local targets.
- **Shopify currency.** `/products.json` does not include a currency field. Pass `currencyOverride` or leave `currency` null. The Actor does not call `cart.js` or `meta.json`.

### robots.txt and terms

The Actor honors robots.txt on every run. A path that is disallowed is not fetched.

Fixtures used in this README and in the test suite were saved only from hosts whose robots.txt allowed the path at fetch time (official Shopify theme demos and three WooCommerce stores). Some brand stores allow `/products.json` in robots.txt but still return **HTTP 403** (for example www.gymshark.com on 2026-11-17, 7:12 AM America/Denver — CloudFront "Request blocked"). That is recorded as blocked and is **not retried or circumvented**. bombas.com returned **429** on robots.txt that morning and was not used.

Many Shopify merchants use a default terms template that prohibits automated access. Carson accepted that store-terms risk on 2026-11-17 and does not want the Actor restricted to owned stores. This is not legal advice; review a store's terms before you schedule it.

### Out of scope

- Cart, checkout, inventory admin, or any authenticated Shopify / WooCommerce API (including private app tokens and the REST Admin API).
- `cart.js`, `meta.json`, or other endpoints not listed above.
- Proxies or other methods to evade a 403, 429, CAPTCHA, login, or paywall.
- Non-Shopify / non-WooCommerce platforms.
- Personal customer data. Output is limited to the public catalog.

### FAQ

- **Why is Shopify `currency` null?** `/products.json` does not publish currency. Set `currencyOverride`.
- **A store returned 403. Will its SKUs be marked removed?** No. The previous snapshot is kept and a diagnostic `blocked_403` row is emitted.
- **Can I watch one collection only?** Yes. Pass a `/collections/{handle}` URL or a `collection` field. The collection products path is still checked against robots.txt (some stores disallow `/collections/*/products*`).
- **Do I need to confirm permission in the input?** No. A leftover `confirmPermission` field is ignored.

### Local development

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pytest
```

Do not run `apify push` or create a paid run until Carson approves spending. See `SPEC.md` for the contract, `TODO.md` for listing steps, `LISTING-DRAFT.md` for Store copy, `LOG.md` for metrics, and `../LAUNCH-CHECKLIST.md` for CLI install and private-push steps.

# Actor input Schema

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

Store home URLs, or a Shopify collection URL such as https://store.com/collections/sale. Optional platform: auto (default), shopify, or woocommerce. Optional collection handle. The Actor checks robots.txt before every catalog path.

## `mode` (type: `string`):

full returns every current catalog row. delta returns only price, stock, and SKU changes since the last run stored in the named key-value store.

## `includeUnchanged` (type: `boolean`):

When mode is delta, also emit rows that did not change.

## `includeVariants` (type: `boolean`):

On: one dataset row per Shopify variant or WooCommerce variation. Off: one row per product (lowest price; in stock if any variant is).

## `minPriceChangePct` (type: `number`):

Ignore price changes smaller than this percent. 0 reports any change.

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

Optional cap on products fetched per store (previews and tests).

## `maxItems` (type: `integer`):

Optional cap on billed dataset rows this run. Unemitted changes stay pending for the next run. Also honors ACTOR_MAX_PAID_DATASET_ITEMS.

## `stateStoreName` (type: `string`):

Named Apify key-value store that keeps the last snapshot. Use a distinct name per schedule.

## `stateKey` (type: `string`):

Key inside the named key-value store that holds the last catalog snapshot.

## `currencyOverride` (type: `string`):

ISO 4217 code (for example USD) used when Shopify /products.json does not include a currency. WooCommerce already publishes currency_code.

## `disableTelemetry` (type: `boolean`):

Turn off anonymous error and usage stats sent to PostHog, including the run's sanitized input settings (URLs, cities, companies, filters). No personal or scraped data is included either way. Default is off (telemetry on).

## Actor input object example

```json
{
  "stores": [
    {
      "url": "https://theme-dawn-demo.myshopify.com",
      "platform": "shopify"
    },
    {
      "url": "https://bonsoy.com",
      "platform": "woocommerce"
    }
  ],
  "mode": "full",
  "includeUnchanged": false,
  "includeVariants": true,
  "minPriceChangePct": 0,
  "maxItems": 50,
  "stateStoreName": "price-stock-monitor-state",
  "stateKey": "snapshot",
  "disableTelemetry": false
}
```

# Actor output Schema

## `results` (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 = {
    "stores": [
        {
            "url": "https://theme-dawn-demo.myshopify.com",
            "platform": "shopify"
        },
        {
            "url": "https://bonsoy.com",
            "platform": "woocommerce"
        }
    ],
    "mode": "full",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("cherry_hippopotamus/shopify-woo-price-stock").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": [
        {
            "url": "https://theme-dawn-demo.myshopify.com",
            "platform": "shopify",
        },
        {
            "url": "https://bonsoy.com",
            "platform": "woocommerce",
        },
    ],
    "mode": "full",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("cherry_hippopotamus/shopify-woo-price-stock").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": [
    {
      "url": "https://theme-dawn-demo.myshopify.com",
      "platform": "shopify"
    },
    {
      "url": "https://bonsoy.com",
      "platform": "woocommerce"
    }
  ],
  "mode": "full",
  "maxItems": 50
}' |
apify call cherry_hippopotamus/shopify-woo-price-stock --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cherry_hippopotamus/shopify-woo-price-stock"
        }
    }
}
```

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/JPysm8CtjLJ6bM5iN/builds/amCVv2JaeolAxgsnM/openapi.json
