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

Track price drops, restocks and availability changes for public Shopify products. By default the first baseline is saved without charge. If emitInitialSnapshot=true, explicitly requested baseline rows are delivered and charged as snapshots; later price/stock transition rows use the same event.

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

## Pricing

$5.00 / 1,000 shopify price or stock changes

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

## Shopify Price & Stock Change Monitor

Monitor public Shopify product prices and availability over time. Only requests the public `/products.json` endpoint, with no browser or proxies.

### Quick start

Use one public Shopify storefront and keep the same `stateStoreName` for scheduled runs:

```json
{
  "storeUrls": ["https://www.allbirds.com"],
  "maxProductsPerStore": 10,
  "emitInitialSnapshot": false,
  "stateStoreName": "SHOPIFY-PRICE-STOCK-STATE"
}
```

The recommended default creates a free baseline. A later run emits `NEW_VARIANT`, `PRICE_DROP`, `PRICE_CHANGE`, `RESTOCK`, or `SOLD_OUT` rows only when a public variant changes.

1. Provide known public Shopify store URLs.
2. On the first run a persistent baseline is saved; by default there are no chargeable change events.
3. Schedule it periodically with the same state store name. Only new variants, price movements, restocks and sellouts are written to the Dataset.

### Run economics summary

Every completed run writes an `OUTPUT` summary containing requested/checked stores, checked products and variants, detected changes, delivered/billed rows, billing failures, and whether the run was baseline-only. This is audit evidence for future pricing decisions; it does not change the live billing event or estimate platform cost.

Every delivered change also includes a deterministic `changeIdentityKey`. The key is based on the store, product, variant, change types, and before/after values—not the check timestamp—so a retry of the same business change can be recognized downstream without changing the existing `change-result` event or price.
4\. Set `emitInitialSnapshot=true` only when you explicitly want the first snapshot delivered as billable rows.

The Actor records only public prices and availability flags. Actual stock quantities are not exposed by this public endpoint. Password-protected and unsupported storefronts produce clear failures; they are not billed as success. It will not bypass login, CAPTCHA, or rate limits.

**Pay-per-event:** `change-result`. The default baseline is free; `emitInitialSnapshot=true` explicitly emits and charges baseline rows. The live **Pricing** tab is authoritative for the current event price and plan-specific terms. This sprint does not add a `check-result` charge or change the current price.
`OUTPUT` is an object, not a text blob. It reports requested/accepted/duplicate stores, processed/check/baseline/unchanged stores, products and variants checked, detected changes, delivered versus billed rows, and billing failures. This makes recurring monitoring and state recovery auditable.

# Actor input Schema

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

Enter one or more Shopify store homepages; public catalogs only, no login or private API.

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

Only these many public products are checked per store on each run.

## `maxChangesPerStore` (type: `integer`):

Safety cap. If exceeded, store is skipped and baseline is not advanced.

## `emitInitialSnapshot` (type: `boolean`):

Off (recommended): first run saves state, emits 0 changes and costs 0 result events. On: initial variants are output and charged.

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

Use the same name on recurring runs to compare results.

## `requestTimeoutSecs` (type: `integer`):

Maximum time allowed for each public storefront catalog request.

## Actor input object example

```json
{
  "storeUrls": [
    "https://www.allbirds.com"
  ],
  "maxProductsPerStore": 10,
  "maxChangesPerStore": 250,
  "emitInitialSnapshot": false,
  "stateStoreName": "SHOPIFY-PRICE-STOCK-STATE",
  "requestTimeoutSecs": 20
}
```

# Actor output Schema

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

No description

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

Structured batch accounting is stored in the OUTPUT key-value record; the Apify output schema exposes it as a link because nested properties are not accepted by Cloud schema validation.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bin_ai_tools/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 = {}

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

```

## MCP server setup

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