# WooCommerce Scraper (`sourabhbgp/woocommerce-scraper`) Actor

Scrape products from any WooCommerce store. Get prices, images, SKU, stock status, categories, ratings, and descriptions. 3-level fallback: Store API, sitemap, HTML. HTTP-only, no browser. Pay-per-event pricing.

- **URL**: https://apify.com/sourabhbgp/woocommerce-scraper.md
- **Developed by:** [Sourabh Kumar](https://apify.com/sourabhbgp) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 24 total users, 3 monthly users, 94.1% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$2.00 / 1,000 products

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/platform/actors/running/actors-in-store#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

## 🛒 WooCommerce Scraper

Scrape products from **any WooCommerce store**. Prices, images, SKU, stock status, categories, ratings, and more. Works on 85%+ of WooCommerce stores with zero configuration.

### 🚀 What It Does

Enter a WooCommerce store URL and get structured product data. The scraper uses a smart **3-level fallback** strategy:

1. **WooCommerce Store API** — Fastest, richest data (prices, categories, ratings, stock)
2. **Product Sitemap + HTML** — Extracts structured data from product pages via `ld+json`
3. **Shop Page Crawl** — Discovers products by crawling the store's shop page

The scraper auto-detects which method works for each store. No configuration needed.

### ✨ Features

- 🔄 **3-level fallback** — Works even if the Store API is disabled
- 💰 **Accurate pricing** — Handles sale prices, currency conversion, minor units
- 📦 **Stock status** — In stock, out of stock, low stock
- 🏷️ **Categories & SKU** — Full product taxonomy
- ⭐ **Ratings & reviews** — Average rating and review count
- 🖼️ **All images** — Full-size product image URLs
- 🌐 **Any WooCommerce store** — Works on 85%+ of WooCommerce stores worldwide
- ⚡ **HTTP-only** — No browser needed, fast and cost-effective

### 📥 Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `storeUrl` | string | Yes | URL of the WooCommerce store (e.g., `https://example.com`) |
| `maxProducts` | integer | No | Maximum number of products to scrape. Leave empty for all. |

### 📤 Output Example

```json
{
  "name": "USDA Prime Dry-Aged Bone-In Ribeye Steak",
  "price": 109.99,
  "regularPrice": 129.99,
  "salePrice": 109.99,
  "currency": "USD",
  "description": "Our finest dry-aged bone-in ribeye, hand-selected from USDA Prime beef.",
  "shortDescription": "Premium dry-aged bone-in ribeye steak.",
  "sku": "PY-RBDA-01",
  "url": "https://www.porterandyork.com/product/usda-prime-dry-aged-bone-in-ribeye/",
  "images": [
    "https://www.porterandyork.com/wp-content/uploads/ribeye-1.jpg",
    "https://www.porterandyork.com/wp-content/uploads/ribeye-2.jpg"
  ],
  "categories": ["Beef", "Steaks", "Dry-Aged"],
  "inStock": true,
  "stockStatus": "instock",
  "rating": 4.8,
  "reviewCount": 42,
  "productType": "simple",
  "storeUrl": "https://www.porterandyork.com"
}
```

### 💡 Use Cases

- **Price Monitoring** — Track competitor prices across WooCommerce stores
- **Competitor Analysis** — Compare product catalogs, pricing strategies, stock levels
- **Catalog Export** — Export your own WooCommerce store products to CSV/JSON
- **Market Research** — Analyze product categories, pricing trends, and inventory
- **Lead Generation** — Find products and suppliers in specific niches
- **SEO Analysis** — Audit product descriptions, categories, and metadata

### 💰 Pricing

**$2.00 per 1,000 products** — Pay only for what you scrape.

### 🏪 Supported Stores

This scraper works on **any WooCommerce store**, including:

- Online retail stores
- Food & beverage shops
- Fashion & apparel
- Electronics & gadgets
- Health & wellness
- Sports & outdoor equipment
- And any other WooCommerce-powered store

#### ⚠️ Limitations

- **~15% of stores** with aggressive bot protection (Cloudflare JS challenges, CAPTCHA) may not work via HTTP-only
- Stores that have completely disabled the WooCommerce Store API AND have no product sitemap will fall back to shop page crawling, which may return fewer data fields
- The scraper does not handle stores behind login walls or password-protected catalogs

### 🔧 How It Works

1. **Normalizes** the input URL (adds `https://` if needed, strips trailing slashes)
2. **Tries Store API** — Sends `GET /wp-json/wc/store/v1/products` with pagination
3. **Falls back to sitemap** — If API unavailable, fetches `/product-sitemap.xml` and scrapes each product page
4. **Extracts structured data** — Parses `ld+json` (Schema.org Product) from HTML pages
5. **Transforms & outputs** — Normalizes all data into a consistent flat format

### 📊 Data Fields

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Product name |
| `price` | number | Current price |
| `regularPrice` | number | Regular (non-sale) price |
| `salePrice` | number | Sale price (if on sale) |
| `currency` | string | Currency code (USD, EUR, etc.) |
| `description` | string | Full product description (text) |
| `shortDescription` | string | Short description |
| `sku` | string | Stock Keeping Unit |
| `url` | string | Product page URL |
| `images` | array | Product image URLs |
| `categories` | array | Product categories |
| `inStock` | boolean | Whether product is in stock |
| `stockStatus` | string | Stock status (instock/outofstock) |
| `rating` | number | Average customer rating |
| `reviewCount` | number | Number of customer reviews |
| `productType` | string | Product type (simple/variable/grouped) |
| `storeUrl` | string | Store URL used for scraping |

# Actor input Schema

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

URL of the WooCommerce store (e.g., https://example.com). The scraper will auto-detect if it's a WooCommerce store.

## `maxProducts` (type: `integer`):

Maximum number of products to scrape. Leave empty for all products.

## Actor input object example

```json
{
  "storeUrl": "https://nalgene.com"
}
```

# Actor output Schema

## `products` (type: `string`):

Product records with name, price, images, categories, SKU, and stock data

# 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 = {
    "storeUrl": "https://nalgene.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sourabhbgp/woocommerce-scraper").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 = { "storeUrl": "https://nalgene.com" }

# Run the Actor and wait for it to finish
run = client.actor("sourabhbgp/woocommerce-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "storeUrl": "https://nalgene.com"
}' |
apify call sourabhbgp/woocommerce-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=sourabhbgp/woocommerce-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HmgB9gPrMaIf6BgcI/builds/NmOgPhBjbalULGtZQ/openapi.json
