# WooCommerce Store Products: Prices, Discounts & Stock (`54m_music/woocommerce-store-products`) Actor

Read any public WooCommerce store catalogue and get each product with discount percent, price range, stock status, new-arrival flag and a store summary (median price, share on sale). Official Store API, no login, no proxy.

- **URL**: https://apify.com/54m_music/woocommerce-store-products.md
- **Developed by:** [Sam](https://apify.com/54m_music) (community)
- **Categories:** E-commerce, Business, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 product or store summary 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

## WooCommerce Store Products: Prices, Discounts & Stock

Point this Actor at any public WooCommerce store and get the whole catalogue **already analysed**:
real discount percent, price range for variable products, stock state, a new-arrival flag and how each
price compares with the store's median. Every store also gets one summary row (catalogue size, median
price, share on sale, share in stock). Use it for competitor price tracking, sale monitoring, catalogue
audits and feeding an AI agent a ranked product list instead of raw JSON.

### What you get

Two kinds of rows, told apart by `rowType`.

**Product rows (`rowType: "product"`)**

| Field | What it means |
| --- | --- |
| `title`, `url`, `sku`, `productType`, `categories`, `brands`, `imageUrl` | The product as the store lists it |
| `currency`, `price`, `regularPrice` | Current and regular price in major units (the Store API sends minor units; the Actor converts them) |
| `priceMin`, `priceMax` | Lowest and highest price across a variable product's options. For simple products both equal `price` |
| `onSale`, `discountPct` | `discountPct = 100 x (regularPrice - price) / regularPrice`, only when the store flags the product on sale and regular is higher. Otherwise `0` and `onSale = false` |
| `availability` | `in_stock`, `backorder` or `sold_out` |
| `lowStockRemaining` | Units left when the store shows a low-stock count, else `null` |
| `rating`, `reviewCount` | Average rating and review count. Reviewer names and review text are not collected |
| `createdAt`, `updatedAt` | Publish and last-modified dates, read from the store's public WordPress product list. `null` when the site does not expose it |
| `newArrival` | `true` when published within your new-arrival window (default 30 days). `null` (not `false`) when dates are unavailable |
| `daysSincePublished`, `daysSinceUpdated` | Age in days at run time |
| `priceVsStoreMedian` | `priceMin / median(priceMin of all products read)`. 1.0 is typical, 0.5 is half the store's usual price, 2.0 is double |

**Store summary row (`rowType: "store"`)**

| Field | What it means |
| --- | --- |
| `catalogueSize` | Products read from the store |
| `medianPrice`, `priceMin`, `priceMax` | Price spread across the catalogue |
| `pctOnSale`, `avgDiscountPct` | Share of products with a real discount, and their average discount |
| `pctInStock` | Share of products that are not `sold_out` |
| `newArrivals` | Count of new arrivals in your window (`null` when dates are unavailable) |
| `categoryCount`, `lastUpdatedDaysAgo`, `datesAvailable` | Catalogue breadth, freshest update, and whether dates were readable |

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `storeUrls` | one demo store | Store addresses, one per line. Paths are ignored |
| `maxProductsPerStore` | 100 | Cap per store (up to 5,000) |
| `newArrivalDays` | 30 | Window for the new-arrival flag |
| `onlyOnSale` | false | Return only discounted products (the summary still covers the whole catalogue) |
| `includeStoreSummary` | true | One summary row per store |

```json
{ "storeUrls": ["https://porterandyork.com"], "maxProductsPerStore": 100, "newArrivalDays": 30 }
```

### Output example

```json
{
  "rowType": "product",
  "store": "porterandyork.com",
  "title": "Valentines Day Gift Box",
  "currency": "USD", "price": 125, "regularPrice": 150, "priceMin": 125, "priceMax": 390,
  "onSale": true, "discountPct": 16.7,
  "availability": "sold_out", "newArrival": false,
  "daysSincePublished": 1290.8, "daysSinceUpdated": 458.2,
  "priceVsStoreMedian": 3.21
}
```

### Pricing

Pay per event: you pay for each row written to the dataset (products and store summaries), plus the
standard Apify start event. See the Pricing tab. No proxy or browser is used, so runs are small and fast:
100 products take about 10 seconds. A run that produces no rows fails, so you do not pay for an empty run.

### How it works and limits

- Data comes from the public WooCommerce Store API (`/wp-json/wc/store/v1/products`) that WooCommerce
  4.0+ stores expose by default. Dates come from the WordPress product list (`/wp-json/wp/v2/product`)
  when the site allows it.
- The Actor reads `robots.txt` first and skips a site that disallows these paths. It waits at least 0.6 s
  between requests and stops on repeated HTTP 429 or 403. It never uses a proxy or evades blocks.
- Sites that are not WooCommerce, or that closed the Store API, are skipped with a clear reason in the run
  status message. The run only fails when every store fails.
- Prices are what a shopper sees without logging in. Tax display, currency and market follow the store's
  default settings.
- Only public catalogue data is read. No customer, order, reviewer or staff data is collected.

### FAQ

**Why is `newArrival` null?** The Store API has no dates. The Actor reads them from the WordPress product
list, and some stores switch that off. `null` means unknown, never "not new".

**Why does a store fail with "not a WooCommerce store"?** Its Store API returns 404, so it runs another
platform or has the API disabled. Shopify stores: use the Shopify Store Products Actor.

**Can I track discounts over time?** Yes. Schedule the Actor daily and compare `discountPct` and
`availability` between runs.

# Actor input Schema

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

WooCommerce stores to read, one per line, for example https://example-store.com. Only the site address is used.

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

Stop after this many products for each store.

## `newArrivalDays` (type: `integer`):

A product counts as a new arrival when it was published within this many days.

## `onlyOnSale` (type: `boolean`):

Return only products with a real discount. The store summary row still covers the whole catalogue.

## `includeStoreSummary` (type: `boolean`):

Adds one summary row per store: catalogue size, median price, share on sale, share in stock.

## Actor input object example

```json
{
  "storeUrls": [
    "https://porterandyork.com"
  ],
  "maxProductsPerStore": 25,
  "newArrivalDays": 30,
  "onlyOnSale": false,
  "includeStoreSummary": true
}
```

# Actor output Schema

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

Every scored row in the default dataset, overview table view.

## `allFields` (type: `string`):

Every row with all fields.

# 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://porterandyork.com"
    ],
    "maxProductsPerStore": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("54m_music/woocommerce-store-products").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://porterandyork.com"],
    "maxProductsPerStore": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("54m_music/woocommerce-store-products").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://porterandyork.com"
  ],
  "maxProductsPerStore": 25
}' |
apify call 54m_music/woocommerce-store-products --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,54m_music/woocommerce-store-products"
        }
    }
}
```

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/1mHc757Bbcc1dc3tO/builds/CkVaevj5NrAUW7ep3/openapi.json
