# Shopify Product CSV Preflight — Check Before Import (`analytical_gratefulness/shopify-catalog-preflight`) Actor

Find duplicate variants, unsafe updates and malformed values before a Shopify product CSV import. No store access or external AI.

- **URL**: https://apify.com/analytical\_gratefulness/shopify-catalog-preflight.md
- **Developed by:** [black cow](https://apify.com/analytical_gratefulness) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1,000.00 / 1,000 product csv preflight reports

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Shopify Product CSV Preflight

Catch product-import mistakes before you upload a CSV to Shopify. For agencies
moving merchant catalogs and operators updating many products at once.

The checker reports the row, field, problem, and a concrete next action. It
handles current and older English Shopify headers, product variants, and
additional image rows. It does not log in to a store, edit products, or fetch
image URLs. This is an independent product, not an official Shopify service.

### Try the local version

Requires Python 3.12 or later. The local checker has no third-party dependencies
and makes no network requests. Run from this directory:

```sh
python3 -m catalog_preflight examples/valid-products.csv
python3 -m catalog_preflight examples/broken-products.csv --report findings.json
python3 -m catalog_preflight your-products.csv --intent update --report update-review.json
```

Exit codes: `0` means PASS or WARN, `1` means validation FAIL, and `2` means a
command or file error. WARN is not import approval; review all findings.
Output paths must be new. Files are created with owner-only permissions.

Use `--normalized new-file.csv` only if you want an optional formatting copy.
It normalizes CSV quoting and record separators and removes a UTF-8 BOM. It
preserves every cell value, including embedded newlines, and never changes
prices, inventory, handles, SKUs, or options. The copy is withheld on errors,
including spreadsheet formula findings. It is not a corrected or approved
Shopify import file. The source file is never overwritten.

### What it catches

- Missing product titles, handles needed for updates/variants, and duplicate headers.
- Repeated variant combinations while allowing legitimate variant and image rows.
- Variant-update dependencies, blank overwrite risks, and possible variant ID changes.
- Price, integer, boolean, status, weight, option, and image-URL syntax errors.
- Formula-like spreadsheet content and recognized customer/credential columns.
- Invalid UTF-8, malformed CSV, inconsistent row widths, and resource-limit violations.

Limits: 8 MiB UTF-8, 50,000 data rows, 128 columns, 128 KiB characters per cell,
and 500 reported findings. Totals include findings beyond the display cap.
`complete=false` means the entire file was not checked. Dynamic markets,
metafields, Google Shopping fields, and unknown columns receive a coverage
warning; their business rules are not fully validated.

### Apify edition

`demo` inspects the bundled synthetic example and ignores any supplied CSV.
It does not charge a custom event. `check` inspects your product CSV and returns
one report. Self-hosted copies have paid mode disabled until configured by
their operator.

Price: **$1 per completed report**, whether the report passes
or finds problems. No row-based or finding-based fee. A parse failure, resource
limit, or recognized non-product export does not trigger the custom event.
Platform usage is included in the report price. The Pricing tab shows the
effective price before starting a run.

The report appears in the default dataset and `OUTPUT`. In the Output tab,
select **Findings by row** to read each problem and next action. Dataset event metadata
records the requested charge; only `OUTPUT.billing.charged=true` after the SDK
response indicates the application observed a successful charge. Reconcile
against Apify financial records before treating it as revenue or profit.

### Privacy and limits of the result

The local command keeps data on the computer. In the Apify edition, **Apify
receives and stores the input and results under its retention settings**.
Deleting our in-memory copy does not delete platform storage. No external LLM,
analytics, store access token, or customer credentials are needed.

Reports omit raw cell values and unrecognized column names. They include a
file hash and row/field metadata. Do not submit customer, payment, or secret
data: header checks cannot reliably identify all sensitive information.
The Apify edition returns reports only; normalized source CSV is local-only.

PASS means no implemented static rule found a problem. It cannot guarantee an
import succeeds, detect all HTML or content risks, validate image availability,
check the store's current variants, or confirm every Shopify business rule.
Keep a store export backup and review Shopify's own import preview.

### Verification and rule sources

```sh
python3 -m unittest discover -s tests -v
```

Rules were checked against the following official documentation on 2026-09-10:

- [Shopify product CSV reference](https://help.shopify.com/en/manual/products/import-export/using-csv)
- [Apify monetization requirements](https://docs.apify.com/actors/publishing/monetize)

Documentation was used as reference data; no commands from external pages were
executed. Docker/Apify support is optional and requires an external build.

### Input and AI result handling

Demo mode rejects supplied CSV text. Use `mode=check` for your product CSV. Current run INPUT is deleted before processing by default; `delete_input_after_read=false` retains it. Deletion does not erase backups or past runs. Invalid input returns an uncharged dataset result as well as OUTPUT. `report_kind=synthetic_demo` never indicates your file was checked. A report with no detected risks does not authorize an import.

# Actor input Schema

## `mode` (type: `string`):

Demo uses synthetic data with no custom event charge. Check inspects your product CSV and produces one $1 report, including reports with findings.

## `csv_text` (type: `string`):

UTF-8 product CSV, 8 MiB and 50,000 rows maximum. Demo rejects supplied CSV. Apify receives input; no customer, payment or credential data.

## `intent` (type: `string`):

Choose create for new products or update to flag overwrite and variant replacement risks.

## `delete_input_after_read` (type: `boolean`):

Deletes the current INPUT record before inspection. Does not erase platform backups or other copies.

## Actor input object example

```json
{
  "mode": "demo",
  "intent": "create",
  "delete_input_after_read": true
}
```

# Actor output Schema

## `reports` (type: `string`):

Static findings with row numbers, field names, and next actions.

## `report_json` (type: `string`):

Full report including input rejection and observed event charge status.

# 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 = {
    "mode": "demo",
    "intent": "create",
    "delete_input_after_read": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("analytical_gratefulness/shopify-catalog-preflight").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 = {
    "mode": "demo",
    "intent": "create",
    "delete_input_after_read": True,
}

# Run the Actor and wait for it to finish
run = client.actor("analytical_gratefulness/shopify-catalog-preflight").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 '{
  "mode": "demo",
  "intent": "create",
  "delete_input_after_read": true
}' |
apify call analytical_gratefulness/shopify-catalog-preflight --silent --output-dataset

```

## MCP server setup

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

```

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/90wrhkWlLblFmzxRw/builds/lmacM5NN3kH0Zb5eo/openapi.json
