# Shopify Catalog Export & Change Monitor (`hanktop/shopify-catalog-export`) Actor

Shopify products scraper: export public product variants (price, SKU, availability, options, image) from Shopify stores, and optionally detect price and availability changes between runs.

- **URL**: https://apify.com/hanktop/shopify-catalog-export.md
- **Developed by:** [HANKTOP Tools](https://apify.com/hanktop) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 dataset rows

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 Catalog Export & Change Monitor

Read one or more Shopify stores' anonymous public `/products.json` listings. Export one row per valid (product ID, variant ID) listing, with products deduplicated across pages. Invalid products, including those with wrongly typed price, availability, SKU or compare-at price, are skipped and counted in the run summary; any invalid product makes that store's result incomplete. Products with no variants produce no variant rows.

Optionally compare the listing with the last baseline saved by a previous run that had `detectChanges` on and completed. Errors are reported in the run summary, never written to the billed dataset.

### Input

| Field | Description |
| --- | --- |
| storeUrls | Required nonempty array of store URLs. URLs are normalized to HTTPS; paths are ignored. |
| maxProductsPerStore | Maximum products per store, from 1 to 25,000. Default: 1,000. |
| includeDescription | Include plain-text descriptions, limited to 2,000 characters. Default: false. |
| detectChanges | Compare with a saved complete snapshot. Default: false. |
| onlyChanges | Write only change rows, omitting variant rows. Requires detectChanges to be true. Default: false. |

Unknown input fields, an empty store list, and `onlyChanges: true` without `detectChanges: true` are rejected. Input URLs are deduplicated after normalization. IP addresses and hosts without an alphabetic final domain label of at least two letters are rejected.

### Output fields

This tool's tracking policy is that each product listing of a variant is tracked as its own row, identified by product id and variant id.

| Variant field | Description |
| --- | --- |
| record_type | `variant` |
| store | Normalized store URL |
| product_id | Product identifier |
| handle | Product handle |
| product_url | Product page URL |
| title | Product title |
| vendor | Published vendor |
| product_type | Published product type |
| tags | List of strings |
| published_at | Publication timestamp |
| product_updated_at | Product update timestamp |
| variant_id | Variant identifier |
| variant_title | Variant title |
| sku | SKU, including empty or null values |
| price | Original price string or null |
| compare_at_price | Original comparison price string or null |
| currency | Always `UNKNOWN` |
| available | Published availability |
| grams | Published weight in grams |
| option1_name, option2_name, option3_name | Names mapped by option position, or null |
| option1_value, option2_value, option3_value | Variant option values, or null |
| image_url | Variant featured image, otherwise first product image object, otherwise null. Non-object image entries and featured images are ignored. |
| description | Plain-text description, only included when requested |

| Change field | Description |
| --- | --- |
| record_type | `change` |
| store | Normalized store URL |
| change | `added`, `removed`, `price_changed`, or `availability_changed` |
| product_id, variant_id, handle, sku | Identity of the affected variant; variant IDs in change rows are strings |
| field | `price`, `available`, or null for additions and removals |
| old, new | Previous and current field values. Additions and removals use a snapshot object on the existing side and null on the absent side. |

### Change monitoring

Baselines live in the named key-value store `shopify-catalog-monitor-state` in your own Apify account. All runs and tasks in that account share the baseline for the same store hostname. Legacy, malformed, and mismatched records are ignored with `baseline_note: incompatible_baseline_ignored`; a complete run can rebuild them under the delivery rules below. A missing record is simply a first run.

Change detection compares with the last baseline saved by a previous run that had `detectChanges` on and completed. It detects added variants, removed variants, price changes, and availability changes. Title, SKU, description, and compare-at price changes are NOT detected. Prices are compared exactly as published, so `10.0` and `10.00` differ. With no usable baseline, no change rows are emitted; a complete run saves the initial baseline. With `onlyChanges` on, that initial run writes no dataset rows.

Change rows are written first, sorted by product ID, then variant ID, then change type (IDs compared as strings), followed by variant rows unless `onlyChanges` is on. Runs with `detectChanges` off never read or update a baseline.

The baseline is updated after a complete fetch when every change row generated in that run was delivered; a later shortfall of variant rows in the same run does not undo it. If any change row was not delivered, or the acknowledgement could not be interpreted, the old baseline is kept. A first complete fetch creates the initial baseline even with zero change rows. Delivered row counts and baseline status are reported separately in the summary.

An incomplete run does not update the baseline and never emits removed events. It can still export valid variants and report observed additions, price changes, and availability changes. Consequently, the same change can be reported and billed again by a later run. As a second validation check, the new snapshot must pass the same validation as a stored baseline before comparison or saving; a failure reports `invalid_state`, marks the store incomplete, emits no change rows, and keeps the old baseline. An HTTP 200 empty catalog on the first page is treated as `empty_catalog_unconfirmed` when the usable baseline contains variants: there are no removals and the baseline is kept. Avoid simultaneous runs for the same hostname: baseline writes are not coordinated between runs.

The default key-value store contains `RUN_SUMMARY`, an object with run-level `delivery_limited` and `delivery_unverified` flags and a `stores` array. Stores skipped after delivery stops are listed with status `not_processed`. Each store reports its URL, status, product count, `pages`, `requests`, `invalid_products`, `truncated`, `variants_generated`, `variants_delivered`, `variants_unverified`, `changes_generated`, `changes_delivered`, `changes_unverified`, `delivery_limited`, `delivery_unverified`, and `baseline_saved`. Optional fields include `baseline_note`, `retry_after_seconds`, and `error_type`. With `onlyChanges`, variant rows are still generated for comparison, but `variants_delivered` is zero.

A per-store exception is recorded as `internal_error`, and later stores continue unless delivery has been limited or could not be verified. Summary writing runs in a finally block, including when input or setup fails; invalid input adds `status: invalid_input`. A run fails if no processed store has status `ok`, or if delivery could not be verified. In the latter case, the final message explicitly reports unverified delivery instead of saying the stores were ok. Valid products collected before a later failure are retained. No error records are put in the dataset.

At startup, the Actor checks the default dataset through the public SDK using both its item count and a listing limited to one item. A positive count refuses the run immediately without listing; a listed item also refuses the run even if the count is zero or unreadable. These cases write `RUN_SUMMARY` with `status: replay_refused` and fail with a request to start a new run. Processing proceeds only when the count is zero and the listing is empty. Unknown results are retried for up to three attempts, with a short delay between attempts; if emptiness still cannot be verified, the Actor refuses to process anything, writes `status: replay_check_unavailable`, and fails with a clear message. Neither refusal fetches stores, pushes rows, or reads or updates baselines.

**Advanced.** The baseline record key is the hostname. Its format is `schema: 3`, matching `store` hostname, UTC `saved_at`, and a `variants` dictionary keyed by ASCII digits in `<product_id>:<variant_id>` form. Each entry has exactly `price` (string/null), `available` (boolean/null), `handle` (nonempty string), `sku` (string/null), and `product_id` (valid ID whose string matches the key's product part). Other schemas, keys, entry fields, or types are incompatible.

### Limits and behaviour

- Anonymous public listings only: no sign-in, customer or order data, proxies, cookies, or bot-challenge handling.
- Robots rules use the case-insensitive `ShopifyCatalogExport` user-agent group when present, otherwise the `*` group. Every product request is checked against its actual path and query string. Before matching, both rules and request paths decode percent-escapes for unreserved ASCII characters only (letters, digits, `-`, `.`, `_`, `~`); remaining escapes have uppercase hex digits. Non-ASCII characters on both sides are percent-encoded as UTF-8 octets with uppercase hex, so raw and encoded non-ASCII paths match. Reserved characters stay escaped: `%2F` is not `/`. Longest matching rule wins; Allow wins ties. `*` and terminal `$` patterns are supported. Rules are cached separately by scheme, host, and port.
- A 2xx robots response is parsed; a 4xx robots response allows access. A 5xx response, network error, or refused robots redirect makes robots unavailable and skips product requests for that host. Oversized responses report `bad_response`; DNS safety failures are reported separately as `blocked_address` or `http_error`; when a robots redirect points to a host that fails the address check, the request is still refused but the store is reported as `robots_unavailable`.
- Product redirects are HTTPS-only and limited to the original hostname and its `www.` variant; a redirect to HTTP or any other scheme stops the store with `http_error` before requesting the target. Each target is checked against its origin's robots rules before requesting it. A different allowed hostname must pass its own DNS check and robots fetch before its product request. Up to five robots.txt redirects are followed, including across hosts, to HTTPS hosts only; targets must have no userinfo, use the default port, and pass store-host validation and DNS safety checks. The rules found are applied to the store that was requested. At most 10 redirects are followed per product request.
- Before the first request to each hostname, DNS is resolved once; every returned address must be globally routable unicast, and the default HTTP/1.1 transport pins TCP connections to the first verified address while preserving the original hostname for the Host header, TLS SNI, and certificate verification. If any address is private, loopback, link-local, multicast, reserved, unspecified, or otherwise not global, no request is made to that host (`blocked_address`). Resolver failures report `http_error`.
- Requests are sequential, with a one-second gap between requests. Product HTTP 429 and 430 responses permit three retries after the initial request. A numeric or HTTP-date `Retry-After` is honored up to 60 seconds; missing, invalid, or nonfinite values use 20 seconds, and past/negative values use zero. If the delay exceeds 60 seconds, the store stops immediately with `rate_limited`, `truncated: true`, and `retry_after_seconds`: no retry or requested back-off wait occurs. The one-second request gap also applies to retries.
- A password redirect reports `storefront_locked`. Product HTTP 401, 403, and 404 report `not_available`; other unsuccessful responses report `http_error`. Malformed listing responses and response bodies larger than 20 MB (20 × 1024 × 1024 decoded bytes, including robots responses) report `bad_response`. Requests use a 30-second timeout for network operations.
- Pages request 250 products. A smaller nonempty page does not prove the end: fetching continues until an empty page confirms completion. If a page must be cut at `maxProductsPerStore`, the result is truncated. If a page exactly fills the allowance without being cut, one further page is requested: empty means complete, nonempty means incomplete. Reaching 25,000 collected products always marks the result truncated; 25,000 products is this tool's limit, not a Shopify platform limit.
- Product IDs are deduplicated across pages. A repeated product is compared with its first appearance using the complete set of (product ID, variant ID) pairs and each pair's price and availability. An added or missing pair, or changed price or availability, stops pagination with `pagination_anomaly` and marks the store incomplete. An identical repeated listing is ignored, including alongside a new product. The same pair repeated within one product's variants list is also an anomaly. A nonempty page with no new valid product IDs still stops as a pagination anomaly. The tracking policy keeps shared variant IDs under different product IDs as separate rows.
- A valid product is an object with a nonempty string handle and a variants list (possibly empty). Product and variant IDs must be nonnegative integers (not booleans) or nonempty strings of ASCII digits. Other IDs fail validation as `invalid_product`. Every variant must be an object; price, SKU and compare-at price must be strings or null, and availability must be a boolean or null. Missing optional fields are treated as null; values are never coerced. Products with wrongly typed fields are skipped and counted, making the store incomplete with `invalid_products`. Options must be a list of objects or absent/null; images must be a list or absent/null. Other invalid products likewise make the store incomplete. Non-object image entries and featured images are ignored.
- Prices are returned exactly as published. Currency is not supplied by this listing, so the currency column is always `UNKNOWN`.
- Listings can change during pagination. A run is not a transactional snapshot and cannot guarantee that a changing storefront exposes every product consistently.

Rights in product text and images remain with their respective owners; exporting them grants no right to reuse them. You are responsible for your use of the data and for complying with the terms of the stores you query.

### Billing

You are charged per row written to the dataset, variant rows and change rows alike. A run with no changes still writes every variant row unless `onlyChanges` is on. `maxProductsPerStore` limits products, not rows: one product can have many variants. Skipped stores with no collected data produce no rows; valid retained rows from an incomplete fetch are still written and billed.

See this Actor's Pricing tab on apify.com for the current price per dataset row and per Actor start. For example, 200 products might produce 461 variant rows; 461 variant rows plus 12 change rows = 473 billed rows. With `onlyChanges` on, the same comparison writes 12 billed rows. A run that writes no rows can still incur the Actor start fee. The platform counts Actor start events by the memory allocated to the run: one event for up to 1 GB (the default for this Actor), and one event per GB above that, so a 4 GB run counts four start events.

If a maximum charge stops acceptance of rows, the Actor stops pushing rows and stops processing further stores. The summary shows generated versus delivered counts and `delivery_limited: true`. A boolean `event_charge_limit_reached: false` means all rows in that push were delivered, regardless of `charged_count`; when true, `charged_count` bounds the delivered count and further stores are not processed. Baselines follow the change-row delivery contract above, so a later variant-row shortfall does not undo a complete store's baseline update. A push returning no result or lacking a boolean limit flag is unknown: its rows count only in `variants_unverified` or `changes_unverified`, never as delivered. The Actor immediately stops pushing and processing further stores, reports `delivery_unverified: true` for the store and run, marks that store `delivery_unverified`, and keeps its old baseline. Later stores are listed as `not_processed`. Changes whose baseline was kept can be reported and billed again on a later run.

### Terms of use

By running this Actor you agree to the following, in addition to the Apify terms that apply to all Actors:

1. Use it only for public storefront data that you are permitted to access, and comply with the terms of each store you query and with the laws that apply to you.
2. Do not use it or its output to reproduce or resell product text or images, to impersonate a store, or to interfere with a store's operation.
3. Output is provided "as is", without any warranty that it is accurate, complete or current; prices and availability may have changed since the run.
4. To the maximum extent permitted by law, the author is not liable for any loss or damage arising from the use of this Actor or its output.
5. Store owners who do not want their store queried by this Actor can report it through the Issues tab of this Actor's page on Apify Store, and the author will handle the request.

# Actor input Schema

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

One or more Shopify store URLs. Only the public product listing of each store is read.

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

Stop after this many products per store (1 to 25,000).

## `includeDescription` (type: `boolean`):

Add a plain-text product description column (HTML removed, up to 2,000 characters).

## `detectChanges` (type: `boolean`):

Compare with the previous complete run and add rows for added, removed, price-changed and availability-changed variants.

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

Write only change rows, omitting variant rows. Requires detectChanges. The first complete run saves a baseline without writing change rows.

## Actor input object example

```json
{
  "storeUrls": [
    "https://hydrogen-preview.myshopify.com"
  ],
  "maxProductsPerStore": 1000,
  "includeDescription": false,
  "detectChanges": false,
  "onlyChanges": false
}
```

# Actor output Schema

## `items` (type: `string`):

No description

## `summary` (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 = {
    "storeUrls": [
        "https://hydrogen-preview.myshopify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hanktop/shopify-catalog-export").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://hydrogen-preview.myshopify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("hanktop/shopify-catalog-export").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://hydrogen-preview.myshopify.com"
  ]
}' |
apify call hanktop/shopify-catalog-export --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hanktop/shopify-catalog-export"
        }
    }
}
```

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/ejODb93qEhrtFaBf2/builds/e6sPunryhhFAYgqLS/openapi.json
