# Shopify Public Catalog Feed Extractor (`pecopeko/shopify-public-catalog-feed-extractor`) Actor

Extract full product catalogs, variants, prices, compare-at discounts, SKUs, stock status & collections from public Shopify stores via /products.json. Multi-store batch, lightweight HTTP only, SSRF-safe & 429 Retry-After compliant.

- **URL**: https://apify.com/pecopeko/shopify-public-catalog-feed-extractor.md
- **Developed by:** [peco](https://apify.com/pecopeko) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 product extracteds

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 Public Catalog JSON Feed Extractor

Extract structured product catalogs, full variant matrices (SKU, price, compare-at price, discount %, stock availability, options, weight), plain-text descriptions, image galleries, and collection metadata from any public Shopify store — at **$1.00 per 1,000 products** with zero headless browsers.

### Why Use This Actor?

- **10x Faster & Cheaper Than Browser Scrapers**: Queries Shopify's public `/products.json`, `/collections/{handle}/products.json`, and `/collections.json` feeds directly over HTTP — no Playwright/Chrome overhead, no residential proxy burn.
- **Batch Multi-Store Execution With Fault Isolation**: Pass dozens of stores in `storeUrls`. If one storefront disables `/products.json` or returns `403`/`404`, this Actor writes a clean `status: "error"` record with `http_status` and continues extracting every other store without crashing your run.
- **Full Variant & Discount Intelligence**: Every variant includes `id`, `title`, `sku`, `price`, `compare_at_price`, auto-calculated `discount_pct`, `available`, `option1`–`option3`, and `grams`, plus product-level `price_min`, `price_max`, `max_discount_pct`, `in_stock`, and `available_variant_count`.
- **Clean Plain-Text Descriptions**: Automatically converts Shopify `body_html` into readable plain text ready for spreadsheets, BI tools, and LLM/RAG indexing.
- **Production Safety Built In**: Enforces strict SSRF protection (blocks loopback, private, link-local, and cloud metadata IPs on initial URLs and every redirect hop up to 3 hops) plus automatic `429`/`503` `Retry-After` exponential backoff.

### Pricing (Pay-Per-Event)

- **`product_extracted`**: **`$0.001`** per extracted Shopify product (`$1.00 / 1,000 products`).
- Error rows and `/collections.json` discovery records are **free** (never charged).

### Popular Use Cases

1. **Competitor Price & Promo Monitoring**: Track `price_min`, `compare_at_price`, and `discount_pct` daily across DTC Shopify brands.
2. **Stockout & Assortment Tracking**: Monitor `in_stock` and `available_variant_count` across sizes/colors (`option1`/`option2`/`option3`).
3. **E-Commerce Lead & Merchandising Enrichment**: Discover full store collections (`includeCollections: true`) and export SKU catalogs into Airtable, BigQuery, or Sheets.
4. **AI Shopping & RAG Catalog Feeds**: Feed clean plain-text `description`, `tags`, `variants`, and `image_urls` directly into vector search or product-recommendation pipelines.

### Input Example

```json
{
  "storeUrls": [
    "https://www.allbirds.com",
    "https://www.gymshark.com"
  ],
  "collectionHandle": "",
  "includeCollections": true,
  "maxPages": 5,
  "maxProductsPerStore": 500,
  "requestDelayMs": 250
}
```

> Legacy single-store input `{"storeUrl": "https://www.allbirds.com", "collection": "mens-runners", "maxPages": 3}` remains 100% supported.

### Output Example (Product Record)

```json
{
  "record_type": "product",
  "status": "ok",
  "store_url": "https://www.allbirds.com",
  "collection_handle": null,
  "product_id": 8912345678901,
  "handle": "mens-wool-runners",
  "product_url": "https://www.allbirds.com/products/mens-wool-runners",
  "title": "Men's Wool Runners",
  "description": "Our cozy everyday sneaker crafted with ZQ Merino wool.",
  "vendor": "Allbirds",
  "product_type": "Shoes",
  "tags": ["wool", "runners", "everyday"],
  "variant_count": 2,
  "available_variant_count": 1,
  "variants": [
    {
      "id": 4410001,
      "title": "Natural Grey / 10",
      "sku": "WR-GRY-10",
      "price": 78.0,
      "compare_at_price": 98.0,
      "discount_pct": 20.41,
      "available": true,
      "option1": "Natural Grey",
      "option2": "10",
      "option3": null,
      "grams": 450
    },
    {
      "id": 4410002,
      "title": "Natural Grey / 11",
      "sku": "WR-GRY-11",
      "price": 98.0,
      "compare_at_price": null,
      "discount_pct": null,
      "available": false,
      "option1": "Natural Grey",
      "option2": "11",
      "option3": null,
      "grams": 470
    }
  ],
  "skus": ["WR-GRY-10", "WR-GRY-11"],
  "price_min": 78.0,
  "price_max": 98.0,
  "compare_at_price_max": 98.0,
  "max_discount_pct": 20.41,
  "in_stock": true,
  "image_url": "https://cdn.shopify.com/s/files/1/example/wool-runner.jpg",
  "image_urls": [
    "https://cdn.shopify.com/s/files/1/example/wool-runner.jpg"
  ],
  "published_at": "2026-01-15T12:00:00-08:00",
  "created_at": "2025-11-01T09:00:00-07:00",
  "updated_at": "2026-11-18T14:22:10-08:00"
}
```

### Output Example (Graceful Per-Store Error Record)

```json
{
  "record_type": "error",
  "status": "error",
  "store_url": "https://protected-store.example.com",
  "collection_handle": null,
  "http_status": 403,
  "error_message": "HTTP 403: Client error '403 Forbidden' for url 'https://protected-store.example.com/products.json?limit=250&page=1'"
}
```

# Actor input Schema

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

One or more public Shopify store base URLs or domains (e.g. 'https://www.allbirds.com'). Failed or blocked stores emit a structured error record without stopping the rest of the batch.

## `storeUrl` (type: `string`):

Optional legacy single Shopify store base URL. Supported for backward compatibility alongside storeUrls.

## `collectionHandle` (type: `string`):

Optional Shopify collection handle (e.g. 'mens-runners') to fetch /collections/{handle}/products.json instead of the full store catalog.

## `includeCollections` (type: `boolean`):

When enabled, also fetches public /collections.json metadata and outputs collection discovery records alongside products.

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

Maximum number of 250-product JSON pages to fetch per store.

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

Optional hard cap on product records extracted per store. Set to 0 to extract all products up to maxPages \* 250.

## `requestDelayMs` (type: `integer`):

Polite delay in milliseconds between paginated requests and consecutive stores. 429/503 responses automatically trigger Retry-After exponential backoff.

## Actor input object example

```json
{
  "storeUrls": [
    "https://www.allbirds.com"
  ],
  "includeCollections": false,
  "maxPages": 5,
  "maxProductsPerStore": 500,
  "requestDelayMs": 250
}
```

# Actor output Schema

## `results` (type: `string`):

Structured JSON records extracted during this Actor run.

# 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://www.allbirds.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pecopeko/shopify-public-catalog-feed-extractor").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://www.allbirds.com"] }

# Run the Actor and wait for it to finish
run = client.actor("pecopeko/shopify-public-catalog-feed-extractor").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://www.allbirds.com"
  ]
}' |
apify call pecopeko/shopify-public-catalog-feed-extractor --silent --output-dataset

```

## MCP server setup

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

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/N0i9ILxkdAj64Kw25/builds/VzOq4ZpobLhO5SxyW/openapi.json
