# Shopify Catalog & Stockout Auditor (`nazim_data_ops/shopify-catalog-auditor`) Actor

Fetches public Shopify /products.json feeds and checks every variant for stockouts, discounts, missing SKUs, and 0g weights. Outputs a 4-sheet Excel file (.xlsx), an HTML summary report, and dataset records.

- **URL**: https://apify.com/nazim_data_ops/shopify-catalog-auditor.md
- **Developed by:** [Nazım Yurtcan](https://apify.com/nazim_data_ops) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 & Stockout Auditor

Extracts product and variant data from public Shopify stores via the `/products.json` endpoint and runs a catalog audit across four areas: out-of-stock variants, active discounts (`compare_at_price`), missing SKUs, and `0g` shipping weights.

### Outputs

Every run generates three outputs:

1. **Excel Workbook (`Live_Shopify_Audit.xlsx` in Key-Value Store):**
   - `1_Executive_Benchmark`: Store-level summary (total products, variants, stockout rate %, average variant price, and estimated monthly out-of-stock revenue risk).
   - `2_Out_Of_Stock_Audit`: Full list of unavailable variants with prices, weights, and direct product URLs.
   - `3_Markdown_Promo_Tracker`: Variants currently on sale (`price < compare_at_price`), discount percentages, and `>30% OFF` flags.
   - `4_Catalog_Hygiene_Errors`: Variants missing a SKU identifier or configured with `0g` weight.
2. **HTML Report (`Live_Shopify_Report.html` in Key-Value Store):** Visual summary table ready to open in any browser.
3. **Apify Dataset:** Variant-level JSON/CSV records for API or webhook integrations.

### Input Parameters

- `stores` (array): One or more public Shopify store URLs (e.g., `https://www.keychron.com`).
- `maxPages` (integer, default `40`): Maximum pagination depth per store (`250` products per page).
- `maxOosPrice` (integer, default `15000`): Filters out placeholder prices above this threshold when calculating revenue risk.
- `oosBaselineUnits` (integer, default `5`): Multiplier used to estimate monthly revenue at risk per out-of-stock variant.

#### Example Input

```json
{
  "stores": [
    "https://www.keychron.com"
  ],
  "maxPages": 40,
  "maxOosPrice": 15000,
  "oosBaselineUnits": 5
}
```

# Actor input Schema

## `stores` (type: `array`):

Shopify store URLs, one per line (e.g. https://www.example.com). Paths like /collections/all are ignored. 'Brand=URL' is also accepted.

## `maxPages` (type: `integer`):

250 products per page.

## `maxOosPrice` (type: `integer`):

Out-of-stock variants priced above this are treated as placeholders and excluded.

## `oosBaselineUnits` (type: `integer`):

Used for the revenue-risk estimate (model assumption, not real sales data).

## `proxyConfiguration` (type: `object`):

Apify Proxy or custom proxies. Shopify/Cloudflare may rate-limit (HTTP 429) shared datacenter IPs.

## Actor input object example

```json
{
  "stores": [
    "https://www.keychron.com"
  ],
  "maxPages": 1,
  "maxOosPrice": 15000,
  "oosBaselineUnits": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `excelReport` (type: `string`):

4-sheet audit workbook: benchmark, out-of-stock, markdowns, catalog hygiene.

## `htmlReport` (type: `string`):

Shareable HTML report with charts and top findings.

## `storeSummary` (type: `string`):

One row per audited store, plus rows for stores that could not be audited.

# 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 = {
    "stores": [
        "https://www.keychron.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nazim_data_ops/shopify-catalog-auditor").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 = { "stores": ["https://www.keychron.com"] }

# Run the Actor and wait for it to finish
run = client.actor("nazim_data_ops/shopify-catalog-auditor").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 '{
  "stores": [
    "https://www.keychron.com"
  ]
}' |
apify call nazim_data_ops/shopify-catalog-auditor --silent --output-dataset

```

## MCP server setup

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

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/eEdMGMl7b8Kta7TCa/builds/Rku6afaNwlvV4zpdH/openapi.json
