# Shopify Products Scraper & Price Monitor (`pentababy/shopify-products-price-monitor`) Actor

Scrape public Shopify /products.json across many stores and get price-change, new-product, removed-product and availability alerts.

- **URL**: https://apify.com/pentababy/shopify-products-price-monitor.md
- **Developed by:** [easy-ok](https://apify.com/pentababy) (community)
- **Categories:** E-commerce, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 product scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Shopify Products Scraper & Price Monitor

Scrape the public **`/products.json`** catalog of any number of Shopify stores and turn it into clean, structured data — then keep watching it. This **Shopify scraper** is built for **price monitoring**, catalog building and competitor research: run it once for a **snapshot**, or run it on a schedule to get **price drop alerts**, new‑product alerts and **inventory tracker** signals across a whole group of stores.

Unlike single‑store, one‑shot scrapers, this actor is a **multi‑store price monitor**: point it at 1 or 100 Shopify storefronts, and in `monitor` mode it diffs every run against the last one and emits change events (price changed, new product, product removed, availability changed).

### What it does

- Reads only the **public `/products.json`** endpoint that Shopify serves by design — no login, no headless browser, no private data.
- Handles pagination automatically (`?limit=250&page=n`) up to an optional per‑store cap.
- Checks **`robots.txt`** for every store before scraping and skips any store that disallows the endpoint.
- Normalizes each product into a flat item with computed **min/max price**, variant detail, and availability counts.
- In **`monitor`** mode, compares against the previous run and outputs **price‑change / new / removed / availability** events.

### Use cases

- **Competitor price monitoring** — track a group of rival Shopify stores and get alerted the moment a price drops.
- **Product research / sourcing** — pull entire catalogs (title, vendor, type, tags, variants, price range) for analysis.
- **Catalog / feed building** — keep an up‑to‑date structured mirror of a store's public catalog.
- **Inventory tracker** — watch which variants flip in and out of stock over time.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `stores` | string[] | — (required) | Domains or URLs, e.g. `allbirds.com` or `https://www.gymshark.com`. |
| `mode` | `snapshot` \| `monitor` | `snapshot` | `snapshot` = one‑off dump. `monitor` = also diff vs. the last run. |
| `maxProductsPerStore` | integer | `0` | Cap per store. `0` = all. |
| `includeVariantDetail` | boolean | `true` | Include the per‑variant array on each product. |
| `throttleMs` | integer | `1500` | Minimum delay between requests to the **same** store (stores run in parallel). |
| `proxyConfiguration` | object | `{}` | Optional Apify proxy. Empty = direct connection. |

```json
{
  "stores": ["allbirds.com", "https://www.gymshark.com"],
  "mode": "monitor",
  "maxProductsPerStore": 0,
  "includeVariantDetail": true,
  "throttleMs": 1500
}
````

### Output

**Product item** (one per product; real sample, trimmed):

```json
{
  "type": "product",
  "store": "www.deathwishcoffee.com",
  "product_id": 7469535264823,
  "handle": "all-american-tank",
  "title": "All-American Tank",
  "vendor": "Planet Apparel",
  "product_type": "Apparel",
  "tags": ["Americana", "Apparel", "Men", "Unisex"],
  "created_at": "2026-06-15T13:35:58-04:00",
  "updated_at": "2026-07-05T04:17:35-04:00",
  "published_at": "2026-07-04T07:17:47-04:00",
  "price_min": 30,
  "price_max": 30,
  "images_count": 6,
  "available_count": 5,
  "url": "https://www.deathwishcoffee.com/products/all-american-tank",
  "variants": [
    { "id": 42272775372855, "sku": "UTRWBT03", "title": "M", "price": 30, "compare_at_price": null, "available": true, "options": ["M"] }
  ]
}
```

A small **`store_status`** item is also emitted per store (`ok` / `skipped_robots` / `endpoint_unavailable` / `rate_limited` / `error`) so failures are visible in the dataset without breaking the run.

### Monitor mode (price & stock alerts)

In `monitor` mode the actor stores a compact snapshot of each store in a named key‑value store and, on the next run, compares the fresh catalog against it. Every difference becomes a **change event** item (`"type": "change_event"`):

```json
{ "type": "change_event", "event": "price_changed", "store": "allbirds.com",
  "product_id": 7205181653072, "title": "...",
  "before": { "price_min": 185, "price_max": 185 },
  "after":  { "price_min": 135, "price_max": 135 }, "ts": "2026-07-05T..." }
```

Event types: `price_changed`, `new_product`, `product_removed`, `availability_changed`. Schedule the actor (e.g. hourly/daily) and wire the change‑event stream into your alerting to get **price‑drop alerts** and stock notifications. The first monitor run establishes a baseline and emits no events.

### Compliance

- **Public data only.** The actor requests exclusively `/robots.txt` and the public `/products.json` endpoint that Shopify serves by design. It never touches `/admin`, carts, checkout, orders, reviews or any customer data.
- **No personal data** is collected — only product/catalog metadata.
- **robots.txt is respected**: each store is checked first and skipped if `/products.json` is disallowed for our user‑agent.
- **No product descriptions** (`body_html`) are stored — only structured metadata (title, vendor, tags, prices, variants), to avoid copying store copy.
- **Descriptive user‑agent** identifies the crawler and its narrow scope.
- **You are responsible for your use.** Review the target store's Terms of Service and applicable laws for your jurisdiction and use case before running at scale.

### FAQ

**Does this use the Shopify Admin API or need an API key?** No. It reads the public storefront `/products.json`, so no keys, tokens or login are required.

**Will it work on any store?** Only stores running Shopify that keep `/products.json` public. Stores that disable the endpoint (or disallow it in robots.txt) are reported as `endpoint_unavailable` / `skipped_robots` and skipped — other stores in the same run are unaffected.

**How do I get only price changes?** Run in `monitor` mode on a schedule and filter dataset items to `type = change_event`, `event = price_changed`.

**Can I limit how much it scrapes?** Yes — set `maxProductsPerStore`. Requests to a single store are throttled by `throttleMs`; different stores run in parallel.

**Does it handle rate limiting?** Yes. `429` responses are retried with exponential backoff (2s/4s/8s/16s) before the store is marked `rate_limited`; transient network errors are retried too.

### Local development

```bash
npm install && npm run build
apify run -p     # local run; -p purges ./storage first (input: storage/key_value_stores/default/INPUT.json)
npm test         # offline unit tests, no network
```

Note (Apify SDK v3): the local storage location is controlled by `CRAWLEE_STORAGE_DIR` — the legacy `APIFY_LOCAL_STORAGE_DIR` is ignored. Re-running into a non-empty `./storage` can collide with the previous run's dataset; either purge (`apify run -p`) or isolate each run, e.g. `CRAWLEE_STORAGE_DIR=$PWD/storage-run2 node dist/main.js`.

# Actor input Schema

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

Shopify storefronts to scrape. Bare domain (allbirds.com) or full URL (https://www.gymshark.com). Only the public /products.json endpoint is requested.

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

snapshot = one-off catalog dump. monitor = also diff against the previous run and emit change events.

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

Upper bound on products fetched per store. 0 = all.

## `includeVariantDetail` (type: `boolean`):

Include the per-variant array (sku, price, options, availability) in each product item.

## `throttleMs` (type: `integer`):

Minimum delay between consecutive requests to the same store. Different stores run in parallel.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy. Leave empty for direct connection (fine for public /products.json).

## Actor input object example

```json
{
  "stores": [
    "allbirds.com"
  ],
  "mode": "snapshot",
  "maxProductsPerStore": 0,
  "includeVariantDetail": true,
  "throttleMs": 1500,
  "proxyConfiguration": {}
}
```

# 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": [
        "allbirds.com",
        "https://www.gymshark.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pentababy/shopify-products-price-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": [
        "allbirds.com",
        "https://www.gymshark.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("pentababy/shopify-products-price-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "allbirds.com",
    "https://www.gymshark.com"
  ]
}' |
apify call pentababy/shopify-products-price-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pentababy/shopify-products-price-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Shopify Products Scraper & Price Monitor",
        "description": "Scrape public Shopify /products.json across many stores and get price-change, new-product, removed-product and availability alerts.",
        "version": "0.1",
        "x-build-id": "WLpykS7vt6wHHzZD7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pentababy~shopify-products-price-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pentababy-shopify-products-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/pentababy~shopify-products-price-monitor/runs": {
            "post": {
                "operationId": "runs-sync-pentababy-shopify-products-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/pentababy~shopify-products-price-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-pentababy-shopify-products-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "stores"
                ],
                "properties": {
                    "stores": {
                        "title": "Store domains or URLs",
                        "type": "array",
                        "description": "Shopify storefronts to scrape. Bare domain (allbirds.com) or full URL (https://www.gymshark.com). Only the public /products.json endpoint is requested.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "snapshot",
                            "monitor"
                        ],
                        "type": "string",
                        "description": "snapshot = one-off catalog dump. monitor = also diff against the previous run and emit change events.",
                        "default": "snapshot"
                    },
                    "maxProductsPerStore": {
                        "title": "Max products per store",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Upper bound on products fetched per store. 0 = all.",
                        "default": 0
                    },
                    "includeVariantDetail": {
                        "title": "Include variant detail",
                        "type": "boolean",
                        "description": "Include the per-variant array (sku, price, options, availability) in each product item.",
                        "default": true
                    },
                    "throttleMs": {
                        "title": "Throttle between requests to the same store (ms)",
                        "minimum": 500,
                        "type": "integer",
                        "description": "Minimum delay between consecutive requests to the same store. Different stores run in parallel.",
                        "default": 1500
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional Apify proxy. Leave empty for direct connection (fine for public /products.json).",
                        "default": {}
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
