# Brand Price & Stock Monitor (Shopify + Product JSON-LD) (`magenta_courser/brand-price-stock-monitor`) Actor

Enter product page URLs, get each variant's price, currency, stock status and the change since your last run as flat JSON. For public Shopify stores and pages with Product JSON-LD. No browser, no proxy. Pay per URL checked; failed URLs are free.

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

## Pricing

from $2.40 / 1,000 product url checkeds

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

## Brand Price & Stock Monitor (Shopify + Product JSON-LD)

Enter product page URLs and get one flat JSON row per variant: listed price, currency, in-stock status, SKU, barcode, and the price change since your last run.

Built for brands, distributors and sellers who watch **known product pages on reseller and competitor stores** every day or every week. It reads public Shopify storefront data and public Product JSON-LD with plain HTTPS requests. No browser, no proxy, no login.

### What you get

- **Variant-level rows.** A product with 5 sizes gives 5 rows, each with its own price and stock status.
- **Change tracking.** Give the run a history name and every row gets `isNew`, `isChanged`, `previousPrice` and `priceChange`. Turn on `onlyChanges` to store only what moved.
- **Your own product code on every row.** Add `productCode` to link the same product across stores, for example your brand store and three resellers.
- **Honest status per URL.** Every URL ends as `completed`, `partial`, `failed`, `blocked` or `budgetLimited` in the free `RUN_SUMMARY` record. A page that could not be read is never reported as "out of stock" or as an empty result.
- **Pay per URL checked.** Failed and blocked URLs are free.

### Which pages work

| Page type | Works? | Notes |
|---|---|---|
| Shopify storefront product page (`/products/<handle>`) | Yes | Exact variant prices from the storefront's own data. |
| Any public page with Product JSON-LD (`<script type="application/ld+json">`) | Yes | Many WooCommerce, Magento, BigCommerce and custom stores. |
| Sites that block data-center traffic (HTTP 403 / 429, captcha) | **No** | This Actor uses no proxy. Such URLs end as `blocked` and are not charged. |
| Pages that render the price only with JavaScript and publish no JSON-LD | **No** | They end as `failed` with the reason. |
| Amazon, marketplaces, pages behind a login | **No** | Not supported. |

In our test run of 40 product URLs on 9 stores, 38 were read (95%); see [Reliability](#reliability-what-we-measured). Try your URLs once: a failed URL costs nothing.

### Quick start

1. Paste product URLs into **Product page URLs**.
2. Run. Each variant is one dataset row.
3. For monitoring, set a **History name** (for example `my-brand-prices`) and schedule the Actor daily. From the second run on, rows show what changed.

### Input

Only `products` is required.

| Field | Type | Default | Description |
|---|---|---|---|
| `products` | array | required | Up to 100 product pages per run. Each item is a URL string or an object (see below). |
| `historyStoreName` | string | none | Name of a key-value store in your account that remembers the last saved observation. Turns on change tracking. |
| `onlyChanges` | boolean | `false` | Store only new or changed rows. Needs `historyStoreName`. |
| `maxItems` | integer | 1000 | Maximum rows stored per run. |
| `maxRequests` | integer | 300 | Maximum HTTP requests per run. A URL needs 1 request (JSON-LD) or 2 (Shopify). |
| `maxRunSeconds` | integer | 600 | Time budget. URLs not reached are `budgetLimited` and free. |
| `requestIntervalMs` | integer | 1000 | Pause between two requests (minimum 500). |

A product object:

| Key | Description |
|---|---|
| `url` | Public `https` product page. Required. |
| `productCode` | Your own label, copied to every row of this URL. Use the same code for the same product on different stores. |
| `variantId` | Store only this variant (Shopify variant id, or the JSON-LD offer SKU). A `?variant=` in the URL does the same. |
| `adapter` | `auto` (default): JSON-LD first, and on a Shopify storefront fall back to the storefront's variant data. `jsonld`: JSON-LD only. `shopify`: Shopify data only. |

#### Example 1: one product on the brand store and on a reseller

```json
{
  "products": [
    { "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence", "productCode": "cosrx-snail-essence" },
    { "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence", "productCode": "cosrx-snail-essence" }
  ]
}
```

#### Example 2: daily monitoring, store only what changed

```json
{
  "products": [
    "https://sokoglam.com/products/klairs-freshly-juiced-vitamin-c",
    "https://colourpop.com/products/lunch-money",
    "https://www.deathwishcoffee.com/products/medium-roast"
  ],
  "historyStoreName": "my-brand-prices",
  "onlyChanges": true
}
```

#### Example 3: one variant only

```json
{
  "products": [
    { "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence", "variantId": "51086327742680", "productCode": "snail-100ml" }
  ]
}
```

### Output

One row per variant. All fields are always present; a value the store does not publish is `null`. Numbers are numbers.

Real rows from a run on 2026-10-02 (Example 1):

```json
{
  "source": "shopify",
  "productCode": "cosrx-snail-essence",
  "productId": "9070057062616",
  "title": "Advanced Snail 96 Mucin Power Essence",
  "variant": "3.38 fl.oz / 100mL",
  "sku": "113020114",
  "gtin": "8809416470009",
  "price": 25,
  "currency": "USD",
  "available": true,
  "priceType": "listed",
  "lowerPrice": null,
  "upperPrice": null,
  "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence",
  "currencySource": "source",
  "matchMethod": "customerSuppliedUrl",
  "offerIdentityType": "variantId",
  "recordKey": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence|51086327742680",
  "schemaVersion": 1,
  "observedAt": "2026-10-02T07:09:03.715Z",
  "isNew": true,
  "isChanged": null,
  "previousObservedAt": null,
  "previousPrice": null,
  "priceChange": null
}
```

```json
{
  "source": "product-jsonld",
  "productCode": "cosrx-snail-essence",
  "productId": "CRX110009",
  "title": "Advanced Snail 96 Mucin Power Essence",
  "variant": "10286705669",
  "sku": "CRX110009",
  "gtin": "8809416470009",
  "price": 20.9,
  "currency": "USD",
  "available": true,
  "priceType": "listed",
  "lowerPrice": null,
  "upperPrice": null,
  "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence",
  "currencySource": "source",
  "matchMethod": "customerSuppliedUrl",
  "offerIdentityType": "offerId",
  "recordKey": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence|/products/cosrx-advanced-snail-96-mucin-power-essence?variant=10286705669#offer",
  "schemaVersion": 1,
  "observedAt": "2026-10-02T07:09:03.715Z",
  "isNew": true,
  "isChanged": null,
  "previousObservedAt": null,
  "previousPrice": null,
  "priceChange": null
}
```

| Field | Type | Description |
|---|---|---|
| `source` | string | `shopify` or `product-jsonld`: where the row was read from. |
| `productCode` | string | null | Your label for this URL. |
| `productId` | string | null | The store's product identifier. |
| `title` | string | null | Product title as published. |
| `variant` | string | null | Variant name, or the variant id when the store publishes no name. `null` for a single-offer product. |
| `sku` | string | null | Store SKU. |
| `gtin` | string | null | Barcode (GTIN / EAN / UPC) when published. |
| `price` | number | null | Listed price of the variant. `null` for a price range or when no price is published. |
| `currency` | string | null | ISO 4217 code published by the store. Never assumed. |
| `available` | boolean | null | `true` in stock, `false` out of stock or discontinued, `null` when the page does not say. |
| `priceType` | string | `listed` (exact variant price) or `range` (the page only publishes lowest and highest price). |
| `lowerPrice`, `upperPrice` | number | null | Bounds of a `range` offer. |
| `url` | string | The URL exactly as you gave it. |
| `recordKey` | string | Stable key of the variant (input URL + variant identity). Join runs on it. |
| `offerIdentityType` | string | Which key identifies the variant: `variantId`, `offerId`, `offerSku`, `variantName` or `product`. |
| `currencySource`, `matchMethod` | string | Constants: currency comes from the store; products are linked by your URLs, not matched automatically. |
| `schemaVersion` | integer | `1`. |
| `observedAt` | string | Run observation time, ISO 8601 UTC. |
| `isNew` | boolean | Not in the history before (always `true` without a history name). |
| `isChanged` | boolean | null | Differs from the last saved observation. `null` when new. |
| `previousObservedAt` | string | null | Time of the last saved observation. |
| `previousPrice` | number | null | Last saved price, only when both observations have the same known currency. |
| `priceChange` | number | null | `price - previousPrice`. Negative means cheaper. |

Dataset views: **Prices and stock** (core columns) and **Identifiers** (SKU, GTIN, product id).

#### Run summary (free)

The key-value record `RUN_SUMMARY` has one entry per URL. Shortened real example from the 40-URL test run:

```json
{
  "status": "partial",
  "stopReason": "someTargetsIncomplete",
  "targetsRequested": 40,
  "targetsCompleted": 38,
  "targetsFailed": 2,
  "targetsBlocked": 0,
  "targetsBudgetLimited": 0,
  "rowsObserved": 78,
  "rowsSaved": 78,
  "rowsUnchanged": 0,
  "requests": 44,
  "historyEnabled": true,
  "historyCommitted": true,
  "targets": [
    { "target": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence", "status": "completed", "reason": null, "observed": 3, "saved": 3, "unchanged": 0, "requests": 2 },
    { "target": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/", "status": "failed", "reason": "Ambiguous products; target has no matching canonical URL", "observed": 0, "saved": 0, "unchanged": 0, "requests": 1 }
  ]
}
```

Each target also has `checkCharged` (`true` when this URL was billed), and the record has a `charging` object with the number of charged events and whether your maximum cost was reached.

| URL status | Meaning | Charged |
|---|---|---|
| `completed` | Page read, rows stored (or all unchanged with `onlyChanges`). | Yes |
| `partial` | Read, but cut by `maxItems` or the 250-variant Shopify limit. | Yes, if at least one row was stored or found unchanged |
| `failed` | No usable product data (reason given), HTTP error, or conflicting prices. | No |
| `blocked` | The site answered HTTP 403 or 429. | No |
| `budgetLimited` | Not reached within `maxRequests`, `maxRunSeconds` or your maximum cost. | No |

The run itself fails only when every URL failed.

### Change tracking

- Without `historyStoreName` every run is an independent snapshot: all rows have `isNew: true`.
- With it, the Actor keeps the last **saved** observation of each variant (a hash, price and currency, not the page text) in a key-value store of that name in your account.
- `isChanged` is `true` when any field of the row differs: price, stock status, title, SKU and so on. `priceChange` is filled only when both prices have the same known currency.
- `onlyChanges: true` stores only new or changed rows. A quiet day gives zero rows; `RUN_SUMMARY.rowsUnchanged` shows how many were checked and identical.
- Only rows that were stored move the baseline. If a dataset write fails, the history is not advanced and the run fails.
- Use one history name per product list, and do not run two runs with the same name at the same time. Up to 10,000 variants are remembered per history. Changing a URL starts a new record.

### Pricing

Pay per event: **$0.003 for each product URL that was checked successfully** (event name `target-check`), plus the standard Actor start event ($0.00005 per run). Rows are free: a URL with 12 variants costs the same as a URL with one.

| What you run | Checks | Cost |
|---|---|---|
| 10 URLs, once | 10 | $0.03 |
| 50 URLs, every day for 30 days | 1,500 | $4.50 |
| 100 URLs, every day for 30 days | 3,000 | $9.00 |
| 500 URLs (5 runs), once a week for 4 weeks | 2,000 | $6.00 |

**Not charged:** URLs that end as `failed`, `blocked`, `budgetLimited` or `notStarted`; dataset rows; the run summary.

**Good to know:**

- With `onlyChanges`, a URL that was checked and found unchanged is still one check. The check is the work.
- If you set a maximum cost per run, URLs that no longer fit are not fetched and end as `budgetLimited`. `RUN_SUMMARY.charging.chargedEvents` equals the number of URLs with `checkCharged: true`.

### Reliability: what we measured

One cloud run on 2026-10-02, 256 MB, no proxy, 40 product URLs on 9 stores, one request per second:

| Store type | URLs | Read | Notes |
|---|---|---|---|
| Shopify (6 stores) | 31 | 31 | 29 by JSON-LD, 2 by Shopify fallback (the page had conflicting JSON-LD prices) |
| Other stores with JSON-LD (3 stores) | 9 | 7 | 2 pages failed: no JSON-LD on the page, or several products without a matching URL |
| **Total** | **40** | **38 (95%)** | 78 variant rows, 44 requests, 57 seconds, no HTTP 403/429 |

A second run with `onlyChanges` on the same URLs stored 0 rows and reported 78 unchanged.

This is a small same-day sample on stores that do not block data-center traffic. Stores with bot protection will be `blocked`.

### Limits and honest notes

- **No proxy, no browser, no cookies.** Sites that block data-center IPs or need JavaScript for the price are not supported.
- **Listed prices only.** Shipping, tax, coupons at checkout, member prices and marketplace seller offers are not included.
- **No automatic product matching.** The Actor does not decide that two pages sell the same item. You link them with `productCode`.
- **Conflicting data fails.** If a page publishes two different prices for the same variant and is not a Shopify storefront, the URL fails instead of guessing.
- **Requests are sequential**, at least 500 ms apart, with no automatic retries. 100 URLs take about 2 to 4 minutes.
- **Up to 100 URLs per run.** Split larger lists into several runs or tasks; they can share one history name if they do not run at the same time.
- Shopify returns at most 250 variants per product.
- The robots-disallowed Shopify `/cart.js` endpoint is never requested; currency is read from the product page.

### Use from the API

```bash
curl -X POST "https://api.apify.com/v2/acts/magenta_courser~brand-price-stock-monitor/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"products":["https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence"],"historyStoreName":"my-brand-prices"}'
```

Schedule it in Apify Console (Schedules) or call it from n8n, Make or Zapier with the same JSON.

### Use with AI agents (MCP)

The Actor works as a tool through the Apify MCP server. One required input (`products`, a list of URLs), flat output fields, numbers as numbers and `null` for unknown values. A good instruction: "Check these product URLs with brand-price-stock-monitor and list variants where `available` is false or `priceChange` is negative."

### FAQ

**Does it find resellers for me?** No. You supply the product page URLs.

**Why did my URL fail with "No public Product JSON-LD found"?** The page does not publish machine-readable product data and is not a Shopify storefront. It cannot be read without a browser.

**Why `blocked`?** The site refused the request (HTTP 403 or 429). There is no proxy option. Blocked URLs are free.

**Can I track thousands of URLs?** Yes, in runs of up to 100 URLs. Remember that one history keeps up to 10,000 variants.

**Is a missing row a sold-out product?** No. Sold-out variants are rows with `available: false`. A URL that could not be read has no rows and a `failed` or `blocked` status in `RUN_SUMMARY`.

# Actor input Schema

## `products` (type: `array`):

Public product pages to check, up to 100 per run. Each item is a URL string or an object: {"url": "https://...", "productCode": "your own label that links the same product across stores", "variantId": "one variant only", "adapter": "auto | jsonld | shopify"}. Works for Shopify storefronts and pages that publish Product JSON-LD.

## `historyStoreName` (type: `string`):

Name of a key-value store in your account that remembers the last saved price and stock of every variant, for example "my-brand-prices". With it, each row gets isNew, isChanged, previousPrice and priceChange. Leave empty for an independent snapshot. Use one name per product list and do not run two runs with the same name at the same time.

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

Needs a history name. Rows that are identical to the last saved observation are skipped, so a run can save zero rows. Every URL that was checked successfully is still counted (and charged) as one check.

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

Stop saving after this many rows (one row per variant).

## `maxRequests` (type: `integer`):

A URL needs 1 request (JSON-LD) or 2 (Shopify); redirects count too. URLs that do not fit are reported as budgetLimited and are not charged.

## `maxRunSeconds` (type: `integer`):

URLs not reached within this time are reported as budgetLimited and are not charged.

## `requestIntervalMs` (type: `integer`):

Minimum time between two requests. Keep it at 1000 or more when many URLs are on the same store.

## Actor input object example

```json
{
  "products": [
    {
      "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence",
      "productCode": "cosrx-snail-essence"
    },
    {
      "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence",
      "productCode": "cosrx-snail-essence"
    }
  ],
  "onlyChanges": false,
  "maxItems": 1000,
  "maxRequests": 300,
  "maxRunSeconds": 600,
  "requestIntervalMs": 1000
}
```

# Actor output Schema

## `prices` (type: `string`):

One row per product variant: price, currency, stock status, identifiers and change since the last saved observation.

## `overview` (type: `string`):

The same rows with the core columns only.

## `runSummary` (type: `string`):

Free key-value record: status and reason for every product URL (completed, partial, failed, blocked, budgetLimited), rows saved and unchanged, requests, and what was charged.

# 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 = {
    "products": [
        {
            "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence",
            "productCode": "cosrx-snail-essence"
        },
        {
            "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence",
            "productCode": "cosrx-snail-essence"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("magenta_courser/brand-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 = { "products": [
        {
            "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence",
            "productCode": "cosrx-snail-essence",
        },
        {
            "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence",
            "productCode": "cosrx-snail-essence",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("magenta_courser/brand-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 '{
  "products": [
    {
      "url": "https://sokoglam.com/products/cosrx-advanced-snail-96-mucin-power-essence",
      "productCode": "cosrx-snail-essence"
    },
    {
      "url": "https://www.cosrx.com/products/advanced-snail-96-mucin-power-essence",
      "productCode": "cosrx-snail-essence"
    }
  ]
}' |
apify call magenta_courser/brand-price-stock-monitor --silent --output-dataset

```

## MCP server setup

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