# Shopify Price & Stock Monitor (`headlessagent/shopify-price-stock-monitor`) Actor

Monitor public Shopify variant prices and availability with persistent baselines and scoped change detection.

- **URL**: https://apify.com/headlessagent/shopify-price-stock-monitor.md
- **Developed by:** [Headless Agent](https://apify.com/headlessagent) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Monitor public Shopify product and variant prices and published availability. Establish a baseline, then identify new items, price and compare-at changes, availability changes, and removals confirmed by a complete catalog observation.

### Features

- Monitor whole storefront catalogs or specific products.
- Keep variant identifiers as strings, including large identifiers.
- Choose variant rows or product-level minimum/maximum prices and any-variant availability.
- Compare separate runs with the same monitoring profile.
- Preserve previous observations when a source fails or a catalog is incomplete.
- Filter reported changes without changing the saved comparison baseline.

### Input

| Parameter | Default | Meaning |
| --- | --- | --- |
| `storeUrls` | — | Shopify storefront root URLs. |
| `productUrls` | — | Specific public product URLs. Supply at least one URL in either list. |
| `includeVariants` | `true` | One row per variant. False returns one aggregated row per product. |
| `onlyChanges` | `true` | Baseline on first observation, then only new, updated or removed items. False also returns unchanged current rows. |
| `maxProducts` | `100` | Product limit per catalog, from 1 to 10,000. This limits products, not variant rows. |
| `stateKey` | `shopify-price-stock-monitor-state` | Monitoring profile name. Reuse it for comparisons; change it for a fresh baseline. |
| `onlyInStock` | `false` | Return only currently observed rows whose availability is explicitly true. |
| `onlyPriceDrops` | `false` | Return only updates with a known current price lower than the previous known price. |

Use HTTPS storefront URLs and ordinary product URLs. Product tracking queries are ignored. At most 100 URLs are accepted per list. Storefront roots and product URL selections are monitored independently. The profile name accepts 1–100 letters, digits, underscores or hyphens.

```json
{
  "storeUrls": ["https://dropdead.world"],
  "includeVariants": true,
  "onlyChanges": true,
  "maxProducts": 2,
  "stateKey": "shopify-price-stock-monitor-state"
}
```

The sample names a storefront whose published crawler rules allow public product pages and whose terms do not prohibit automated collection, so it returns real products. Replace it with the store you are authorized to monitor.

The Actor reads the store's published crawler rules and terms before requesting products. It stops when crawler rules disallow the catalog, when the terms prohibit automated collection, or when those terms cannot be read.

### Output fields

| Fields | Meaning |
| --- | --- |
| `storeDomain`, `productId`, `title`, `url` | Store and stable product identity, title and public product link. |
| `variantId`, `variantTitle`, `sku` | Published variant details; null in product mode. |
| `currency` | Currency of the price the storefront served; otherwise null. |
| `price`, `maxPrice` | Variant price and null maximum in variant mode; minimum and maximum known variant prices in product mode. |
| `compareAtPrice` | Published compare-at price; minimum known compare-at price in product mode. |
| `available` | Published availability, or null when unknown. Never an inventory quantity. |
| `previousPrice`, `previousMaxPrice`, `previousCompareAtPrice`, `previousAvailable` | Values from the preceding verified observation, or null without a prior observation. |
| `changeType` | `baseline`, `new`, `updated`, `removed`, or `unchanged`. |
| `changedFields` | Changed price, maximum price, compare-at price and/or availability fields. Empty for membership events and unchanged rows. |
| `observedAt` | Observation timestamp in UTC. |

Product availability is true if any variant is explicitly available, false if all are explicitly unavailable, otherwise null. Minimum/maximum prices use known variant prices only; missing prices are not converted to zero. Product compare-at minimum is independent of the variant with the lowest current price. Descriptive changes such as title, SKU or product link refresh the observation but do not generate an update by themselves.

#### Observed example

An observation recorded from a public storefront:

```json
{
  "storeDomain": "dropdead.world",
  "productId": "15110341460346",
  "title": "Left 4 Dead Hoodie",
  "url": "https://dropdead.world/products/left-4-dead-hoodie",
  "variantId": "55404624511354",
  "variantTitle": "XS",
  "sku": "DDAW2478-XS",
  "currency": "USD",
  "price": 114,
  "maxPrice": null,
  "compareAtPrice": null,
  "available": false,
  "previousPrice": null,
  "previousMaxPrice": null,
  "previousCompareAtPrice": null,
  "previousAvailable": null,
  "changeType": "baseline",
  "changedFields": [],
  "observedAt": "2026-10-27T15:27:50.111Z"
}
```

### First and subsequent observations

A new scope emits `baseline` rows even with `onlyChanges=true`. Once that scope has completed a full observation, newly discovered identities are `new`. Repeating an unchanged observation emits no rows unless `onlyChanges=false`. During an initial incomplete observation, first-seen identities remain baseline observations until the scope first completes.

Identity is store plus product ID plus variant ID; product mode omits the variant ID. Changing titles or links does not create a new identity. Variant and product modes retain separate histories. Each catalog and each explicitly listed product has a separate scope; removing a URL from input does not announce that its products disappeared. Re-adding it resumes its previous comparison. Duplicate and overlapping input URLs emit at most one event per identity in a run; catalog observations take precedence over explicit product observations.

Only a complete successful observation of the same catalog can emit `removed`. Removed rows retain the last observed values; they do not imply availability became false or the product was deleted everywhere. Explicit product not-found responses are reported separately and retain history, including previous variants. Failed, rejected, malformed, truncated or capped catalog observations never imply removal. Verified rows from incomplete catalogs can still update the baseline, while unseen rows remain retained. A complete empty catalog can establish an empty baseline or confirm removals.

Filters apply after comparison: `onlyChanges` selects change rows, `onlyInStock` requires current explicit availability and excludes removals, and `onlyPriceDrops` requires an `updated` row with two known prices and a lower current price. Thus `onlyPriceDrops` also suppresses baseline, new and removed rows. In product mode it compares the minimum price, not the maximum. All filters affect output only, never comparison history.

### Persistence and limitations

Profiles persist across separate runs of the same Actor. Independent Actor copies do not share profiles. Only the last verified observation is retained, not a long-term price history. Source scope membership remains available when inputs change; use a new profile name for an independent monitoring campaign.

Results are written before acknowledging the corresponding baseline update. Results and baseline are not atomic: an interruption between those operations can replay events on the next run. Concurrent runs using the same profile can overwrite each other's observations; schedule runs sequentially. Other stores continue when one fails. If every source fails, the run fails instead of claiming a successful empty result. The run report distinguishes incomplete sources, confirmed product not-found responses and failures.

Only public product data from stores whose access rules clearly permit automated collection is supported. Unclear, unavailable or prohibitive access rules are reported as failures. This conservative permission check can reject stores that would grant permission separately; arrange explicit public authorization before using them. No account, customer, order or checkout data is accessed. Some stores do not expose currency or availability; unknown values stay null. Catalogs can change while being observed, so snapshots are not an atomic view of the merchant's inventory. No precise inventory quantities are inferred.

# Actor input Schema

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

Public Shopify storefront roots. At least one store URL or product URL is required. Use storefront roots whose published crawler rules allow the catalog and whose terms do not prohibit automated collection.

## `productUrls` (type: `array`):

Public Shopify product URLs. Each product is monitored independently from catalog scopes.

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

Return each variant. When false, return each product with minimum/maximum price and any-variant availability.

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

Emit first baseline, then new, updated and removed items. False also emits unchanged current observations.

## `maxProducts` (type: `integer`):

Maximum products per catalog. Capped/incomplete observations never imply removals.

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

Reuse this profile for comparison across runs; choose a new name for an independent baseline.

## `onlyInStock` (type: `boolean`):

Output only rows with current published availability true. Does not change the baseline.

## `onlyPriceDrops` (type: `boolean`):

Output only updated rows with a known lower price than before. This also filters baseline/new/removal rows, but never the saved comparison state.

## Actor input object example

```json
{
  "storeUrls": [
    "https://dropdead.world"
  ],
  "includeVariants": true,
  "onlyChanges": true,
  "maxProducts": 100,
  "stateKey": "shopify-price-stock-monitor-state",
  "onlyInStock": false,
  "onlyPriceDrops": false
}
```

# Actor output Schema

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

Product and variant observations and changes.

# 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://dropdead.world"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("headlessagent/shopify-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 = { "storeUrls": ["https://dropdead.world"] }

# Run the Actor and wait for it to finish
run = client.actor("headlessagent/shopify-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 '{
  "storeUrls": [
    "https://dropdead.world"
  ]
}' |
apify call headlessagent/shopify-price-stock-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,headlessagent/shopify-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/QazIaXwXLwM3EFUFu/builds/Z2vdRBX2IaB1BqbQd/openapi.json
