# Price & Stock Monitor — Shopify Product Tracker (`crawlhex/product-price-stock-monitor`) Actor

Monitor product price, stock and Shopify variant changes from saved URLs. Return previous/current values and only changes for exports and downstream workflows.

- **URL**: https://apify.com/crawlhex/product-price-stock-monitor.md
- **Developed by:** [Riftanvil](https://apify.com/crawlhex) (community)
- **Categories:** E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 46.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 successful product checks

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 Price and Stock Monitor — Shopify Variant Tracking

Track **product price and stock changes** from a URL list. Compare successful observations across runs, return previous/current values, and optionally export only changes. Supported Shopify products include individual variant price and stock changes, even when the product's lowest price remains the same.

### What can I use it for?

- **Competitor price audits:** review changed prices rather than manually comparing every product.
- **Supplier stock checks:** identify supported source stock transitions for selected products.
- **Shopify variant monitoring:** detect a size/color variant changing price or stock.
- **Spreadsheet and API workflows:** export timestamped changes or feed them into your own downstream alert workflow.

This Actor detects changes. It does not send alerts or create schedules automatically; configure Apify integrations or your own notification workflow separately.

### Try one live preview without setup

To try the extractor before creating persistent storage, use this preview input. **Preview does not save history or detect changes across runs**; every successful run returns first_seen. It uses the same successful-check pricing as tracking.

```json
{
  "urls": ["https://www.allbirds.com/products/mens-tree-runners"],
  "previewOnly": true,
  "maxConcurrency": 1,
  "policy": {"maxRequests": 10, "maxRetries": 0, "delayMs": 1000}
}
```

The form's example input uses this preview so a first run needs no private resource selections. For actual monitoring, turn Preview only off and follow the setup below.

### Faster setup for developers

Use the optional [standalone Node.js setup helper](https://api.apify.com/v2/key-value-stores/tmZ4Py87Jm2rJvrfc/records/setup-monitor.mjs?signature=153JE3IMO4Q96fLcqHW3K) to prepare both private resource selections together. Save the file as setup-monitor.mjs and use Node 24.

```
node setup-monitor.mjs --name my-price-watch --url https://www.allbirds.com/products/mens-tree-runners
```

This first command only shows a plan. To create or reuse the dedicated state store and lock queue, provide your own APIFY_TOKEN through your environment or a private .env file, then run:

```
node --env-file=.env setup-monitor.mjs --name my-price-watch --url https://www.allbirds.com/products/mens-tree-runners --apply
```

The helper writes a ready-to-paste input file under storage/. Paste its contents into this Actor's JSON input editor and save as a task. Reuse the same input and feed name for repeat checks. Your token must be authorized to create resources in your account; the Actor's limited run token is not suitable. No run or schedule starts automatically. Never paste your token into Actor input or an Issue.

This is a developer shortcut; manual setup is still available below. Reusing a feed name reuses history. Use different names for independent feeds, keep URLs and extraction settings consistent, and start with one product and a finite timeout.

### First-time setup for saved monitoring

Saved monitoring needs somewhere to keep the previous successful observation. Preview mode intentionally has no saved history.

1. In Apify **Storage**, create a dedicated key-value store and an empty request queue. Keep the queue exclusively for this monitor's lock.
2. Open this Actor and paste the JSON example below.
3. Switch to the input form, **turn Preview only off**, and select your **Persistent feed state** store and **Dedicated feed lock** queue. The example does not create these resources.
4. Keep memory at **512 MB**, use a finite timeout such as **180 seconds**, and leave automatic restart off.
5. Click **Start**. The first run returns first_seen observations.
6. Save an Apify task with these settings. Run it again, or add your own schedule, to compare future observations.

#### Easy input: monitor one product

```json
{
  "urls": ["https://www.allbirds.com/products/mens-tree-runners"],
  "monitorId": "my-price-watch",
  "previewOnly": false,
  "changesOnly": true,
  "maxConcurrency": 1,
  "policy": {
    "maxRequests": 10,
    "maxRetries": 0,
    "delayMs": 1000
  }
}
```

The product is a public live example; its data can change. **Select both storage resources before starting a cloud run.** Keep the same resources and monitorId for subsequent checks. For API calls, include the selected resource IDs as cloudStateStoreId and cloudLockQueueId.

#### Example: monitor two products

```json
{
  "urls": [
    "https://www.allbirds.com/products/mens-tree-runners",
    "https://www.glossier.com/products/boy-brow"
  ],
  "monitorId": "my-price-watch",
  "previewOnly": false,
  "changesOnly": true,
  "maxResults": 100,
  "maxConcurrency": 1,
  "policy": {
    "maxRequests": 20,
    "maxRetries": 0,
    "delayMs": 1000
  }
}
```

After pasting, select the same persistent store and lock queue in the form. Avoid overlapping schedules for the same monitor.

### What results do I receive?

| Event/field | Meaning |
|---|---|
| first_seen | No prior valid observation |
| event = changed | A tracked product or variant price/stock value changed |
| unchanged | No tracked change; hidden when changesOnly=true |
| previous / current | The compared product observations |
| changed | Names of tracked fields that changed |
| priceDirection / priceChange | Exact price movement when currencies match |
| stockChange | Stock transition, including back_in_stock or out_of_stock |
| deliveryId | Identifier to deduplicate monitoring deliveries |

#### Recorded first-run output

```json
{
  "event": "first_seen",
  "changed": [],
  "previous": null,
  "priceDirection": "not_comparable",
  "priceChange": null,
  "stockChange": "none",
  "current": {
    "name": "Men's Tree Runner - Jet Black (White Sole)",
    "url": "https://www.allbirds.com/products/mens-tree-runners",
    "price": "70.00",
    "currency": "USD",
    "availability": "in_stock",
    "observedAt": "2026-11-10T17:56:58.725Z"
  }
}
```

This is a shortened recorded first_seen result. It is not a fabricated live price-change event. Actual output contains the complete current product record and additional comparison fields.

A second successful check with no tracked changes can return **zero dataset rows** when changesOnly=true. Inspect Run metrics for completed-check receipts. Zero output does not mean the monitor skipped the work.

### Shopify variants and prices

Without an explicit ?variant=ID URL, price is the lowest observed variant price and priceMax the highest, with priceBasis=range_minimum. The range includes unavailable variants. A specific variant URL selects that variant; missing selections fail rather than switching variants.

Variant reordering and equivalent decimal formats do not create changes. A variant changing stock can trigger an event even if the aggregate product remains in stock. Price differences are not calculated across currencies. Unknown stock becoming available is not falsely labeled back_in_stock.

The public Shopify API can expose at most 250 variants, and potentially truncated sets are flagged. Other product pages need unambiguous JSON-LD or scoped microdata. No universal retailer coverage, catalog discovery or generic multi-offer selection is claimed.

### Pricing and scheduled costs

Confirm effective prices on the **Pricing** tab and set a spending limit. Configured HTTP-only pricing is:

- **USD 0.002 per successful product check**, including unchanged checks.
- **USD 0.001 automatic startup per run**.
- No second charge for the output event row.

At 512 MB, one successful product check would cost **USD 0.003**, even when unchanged output is hidden. Two successful products in one run would cost **USD 0.005**. At these prices, checking those two products once daily for 30 days would cost **USD 0.15** in event fees, assuming every check succeeds and no additional runs. This is an illustrative calculation, not an active subscription or configured schedule.

Failed extraction has no product-check fee; startup can still apply. Set a spending limit and choose your schedule deliberately. Priced runs require 512 MB, concurrency 1 and HTTP extraction; browser pricing is not included.

### Reliability and recovery

Failed extraction, 404s, access blocks, ambiguous prices and identity mismatches preserve the previous valid state. A 404 is not proof a product was permanently removed. Source prices reflect the anonymous locale/server context; shipping, tax, subscriptions and currency conversion are not normalized.

Cloud monitoring requires a positive timeout at most 600 seconds and automatic restart off. A run aborted while holding a lock may delay the next check until server expiry, generally the run deadline plus about two minutes.

Recovery can replay output: deduplicate deliveryId. Uncertain charged work pauses for review instead of automatically charging it again. State, charges and dataset writes are not one transaction. Keep extraction options consistent within a feed; parser upgrades may create one-time field changes.

### Common questions

**Why does the first run show every product?** It establishes the baseline. Future checks compare against that saved observation.

**Why are there no rows on the next run?** With changesOnly=true, unchanged results are suppressed. Check Run metrics before treating zero rows as a failure.

**Can it scrape any retailer or search products for me?** No. Supply public product URLs with supported Shopify data or usable structured markup. No catalog search, sitemap crawling or marketplace discovery.

**Does it store an unlimited history or send alerts?** No. Each run has a dataset; export or integrate those datasets into your own history/alert system. Internal state retains bounded recovery history, not a historical-price database.

**Can I watch out-of-stock products?** Yes, where the source exposes a usable stock signal. Missing signals remain unknown; they are not guessed from failed requests.

### Troubleshooting and help

Select both persistent resources, reuse your monitorId and avoid simultaneous runs. Increase policy.maxRequests for larger lists; Shopify normally needs three source requests per check. Blocks and 401/403/404/429 stop that source without proxy or identity escalation. Inspect error records and Run metrics for details.

For help, share the **public product URL and run ID** through Issues. Do not post credentials or confidential inputs.

### AI agent integration

**Actor identifier:** crawlhex/product-price-stock-monitor. **Task:** compare supported public product observations across saved runs, including Shopify variant price and stock changes. It does not discover products, send alerts, create schedules, or provide an unlimited historical database.

Read the [listing as Markdown](https://apify.com/crawlhex/product-price-stock-monitor.md) for input schema, examples and fees. The [Apify MCP server](https://docs.apify.com/mcp) supports Actor discovery/details and authorized execution. No separate Crawlhex MCP server is needed. Keep credentials in the client, not in Actor input or public prompts.

For a first extraction without saved history, this is an explicit **preview**, not a monitoring setup:

```json
{
  "urls": ["https://www.allbirds.com/products/mens-tree-runners"],
  "previewOnly": true,
  "maxResults": 1,
  "maxConcurrency": 1,
  "policy": {"maxRequests": 10, "maxRetries": 0, "delayMs": 1000}
}
```

Every successful preview returns first_seen and saves no history. For actual monitoring, set previewOnly=false and supply the customer's dedicated cloudStateStoreId and cloudLockQueueId, reusing monitorId. Never substitute our test resource IDs or invent resource selections. Saved checks can return previous/current observations, changed fields and deliveryId; deduplicate deliveries. With changesOnly enabled, zero rows can mean a completed unchanged check, which still has a successful-check fee. Failures preserve prior valid state and do not establish out-of-stock. Use 512 MB, concurrency 1, a finite timeout, restart off and an explicit spending cap; fees are documented above.

Use the **latest** build for the documented inputs and pricing. Historical experimental builds are not supported for paid use.

# Actor input Schema

## `urls` (type: `array`):

Public HTTPS product URLs without embedded credentials or fragments; variant query parameters are preserved.

## `maxConcurrency` (type: `integer`):

Use 1 concurrent target for validated paid accounting.

## `maxResults` (type: `integer`):

Optional maxResults; validated by the Actor.

## `cloudStateStoreId` (type: `string`):

Explicit persistent state store for cloud monitoring. Feed history uses an append-only journal.

## `cloudLockQueueId` (type: `string`):

Dedicated empty feed-lock queue. Shared with all writers of this feed. Never use a crawler queue.

## `monitorId` (type: `string`):

Optional monitorId; validated by the Actor.

## `changesOnly` (type: `boolean`):

Optional changesOnly; validated by the Actor.

## `previewOnly` (type: `boolean`):

On: try one live observation without persistent resources. Every run is first_seen. Off: select persistent state and lock resources to track changes.

## `policy` (type: `object`):

Optional policy; validated by the Actor.

## `domainPolicies` (type: `object`):

Optional domainPolicies; validated by the Actor.

## Actor input object example

```json
{
  "urls": [
    "https://www.allbirds.com/products/mens-tree-runners"
  ],
  "maxConcurrency": 1,
  "maxResults": 3,
  "monitorId": "default",
  "changesOnly": false,
  "previewOnly": true,
  "policy": {
    "maxRequests": 10,
    "maxRetries": 0,
    "delayMs": 1000
  },
  "domainPolicies": {}
}
```

# Actor output Schema

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

No description

## `metrics` (type: `string`):

No description

## `sourceChecks` (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 = {
    "urls": [
        "https://www.allbirds.com/products/mens-tree-runners"
    ],
    "maxConcurrency": 1,
    "maxResults": 3,
    "changesOnly": false,
    "previewOnly": true,
    "policy": {
        "maxRequests": 10,
        "maxRetries": 0,
        "delayMs": 1000
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlhex/product-price-stock-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 = {
    "urls": ["https://www.allbirds.com/products/mens-tree-runners"],
    "maxConcurrency": 1,
    "maxResults": 3,
    "changesOnly": False,
    "previewOnly": True,
    "policy": {
        "maxRequests": 10,
        "maxRetries": 0,
        "delayMs": 1000,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("crawlhex/product-price-stock-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 '{
  "urls": [
    "https://www.allbirds.com/products/mens-tree-runners"
  ],
  "maxConcurrency": 1,
  "maxResults": 3,
  "changesOnly": false,
  "previewOnly": true,
  "policy": {
    "maxRequests": 10,
    "maxRetries": 0,
    "delayMs": 1000
  }
}' |
apify call crawlhex/product-price-stock-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlhex/product-price-stock-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/Xqobj5HcCgfJeFymr/builds/EnibApeXckPFxr4Qv/openapi.json
