# WordPress & WooCommerce Scraper (WP REST API) (`onomatopoeia_dev/wordpress-woocommerce-scraper`) Actor

Export posts, pages, categories, tags, media and WooCommerce products from any public WordPress site as clean rows. Official REST APIs only, honors robots.txt, no proxy or login.

- **URL**: https://apify.com/onomatopoeia_dev/wordpress-woocommerce-scraper.md
- **Developed by:** [onomatopoeia](https://apify.com/onomatopoeia_dev) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 result items

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/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

## WordPress & WooCommerce Scraper (WP REST API)

**Export posts, pages, categories, tags, media and WooCommerce products from any public WordPress site — as clean, flat rows in JSON, CSV or Excel.**

This **WordPress scraper** and **WooCommerce product scraper** uses only the **official public WordPress REST API (WP REST API)** and the **WooCommerce Store API**. It needs **no login, no API key and no proxies**. It never touches carts, checkouts, orders or customer data, and it **honors robots.txt**.

> Not affiliated with, endorsed by or sponsored by WordPress, Automattic or WooCommerce. All names are trademarks of their owners.

### What can you do with it?

- **Scrape WordPress posts and pages**: titles, full text, excerpts, dates, authors, categories, tags and featured images — for content audits, research, archiving or AI datasets.
- **Scrape WooCommerce products**: name, SKU, price (already converted to real currency units), sale price, stock status, categories, images, attributes, rating and review count — for price monitoring and catalog comparison.
- **Monitor a competitor blog or shop** by scheduling the Actor daily and filtering on date, category or sale status.
- **Export taxonomies and the media library**: category and tag lists with post counts, and media items with direct file URLs, sizes and alt text.
- **Collect public comments** (optional): display name and text only, never e-mail addresses or IP addresses.
- **Process many sites in one run**: add a list of sites, set a cap per site, and get one combined dataset with a `site` column.

### Why this Actor

| | |
|---|---|
| **Official APIs only** | `/wp-json/wp/v2/` (WP REST API) and `/wp-json/wc/store/v1/` (WooCommerce Store API). No HTML scraping, no browser. |
| **Auto-detects WooCommerce** | Asks the site which APIs it offers. Products are only requested where WooCommerce is present. |
| **Works with plain permalinks** | If `/wp-json/` is not routed, it automatically uses the `?rest_route=` form of the same API. |
| **Clean flat rows** | One row per item with a `type` field (`post`, `page`, `product`, `category`, `tag`, `media`, `comment`), the `site` and the source URL. HTML is converted to readable text; raw HTML is optional. |
| **Real prices** | Store API prices are in minor units (cents). They are converted with each store's `currency_minor_unit`, so `1999` becomes `19.99`. |
| **Polite** | Honors `robots.txt`, rate-limits each site (default 2 requests/second), retries with exponential backoff and `Retry-After`, and identifies itself with a clear User-Agent. |
| **Graceful errors** | REST disabled, HTTP 401/403, not a WordPress site, robots.txt block: reported per site in the **Site report**, the run continues with the other sites. |
| **Spend control** | Respects your **maximum cost per run** and stops cleanly. Resumable across Apify platform migrations. |

### Input

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | WordPress sites, e.g. `https://wordpress.org/news`. A sub-folder install such as `https://example.com/blog` works too. |
| `contentTypes` | array | `posts`, `pages`, `products`, `categories`, `tags`, `media`, `productCategories`. Default: posts and products. |
| `maxItems` | integer | Total rows across all sites (default 100). Every row is one billed item. |
| `maxItemsPerSite` | integer | Optional cap per site, so one big site cannot use up the budget. |
| `search` | string | Keyword search using the site's own search. |
| `dateFrom`, `dateTo` | string | Posts, pages and media published in this range (inclusive). `YYYY`, `YYYY-MM` or `YYYY-MM-DD`, in the site's local time. Not available for products. |
| `categories`, `tags` | array | Slugs or numeric IDs. Applied to posts and, separately, to WooCommerce product categories/tags. |
| `onSaleOnly`, `inStockOnly` | boolean | WooCommerce product filters. |
| `includeRawHtml` | boolean | Add `contentHtml` / `descriptionHtml` next to the plain text. |
| `includeAuthors` | boolean | Resolve public author name, slug and profile URL (default on). Never e-mail addresses. |
| `includeComments` | boolean | Also export approved public comments of posts as `comment` rows (off by default; each comment counts as an item). |
| `maxCommentsPerPost` | integer | Cap per post when comments are on (default 20). |
| `siteConcurrency` | integer | Sites read in parallel (default 3). |
| `requestsPerSecond` | integer | Politeness limit per site, 1–5 (default 2). |

#### Example inputs

**Latest 200 posts of a news site**

```json
{
  "startUrls": [{ "url": "https://wordpress.org/news" }],
  "contentTypes": ["posts"],
  "maxItems": 200
}
```

**Release posts from the last quarter, with raw HTML**

```json
{
  "startUrls": [{ "url": "https://wordpress.org/news" }],
  "contentTypes": ["posts"],
  "categories": ["releases"],
  "dateFrom": "2026-09-01",
  "includeRawHtml": true,
  "maxItems": 500
}
```

**Products on sale from several shops, at most 300 per shop**

```json
{
  "startUrls": [{ "url": "https://shop-one.example" }, { "url": "https://shop-two.example" }],
  "contentTypes": ["products"],
  "onSaleOnly": true,
  "maxItemsPerSite": 300,
  "maxItems": 600
}
```

### Output

One dataset row per item. Fields common to every row: `type`, `site`, `id`, `url`, `sourceUrl` (the API request URL it came from) and `scrapedAt`. Empty values are `null` or empty arrays. See the dataset's field descriptions in the **Output** tab for every field.

**Post example**

```json
{
  "type": "post",
  "site": "https://developer.woocommerce.com",
  "id": 8771861,
  "url": "https://developer.woocommerce.com/2026/11/19/woocommerce-11-3-1/",
  "sourceUrl": "https://developer.woocommerce.com/wp-json/wp/v2/posts?orderby=date&order=desc&per_page=100&page=1",
  "scrapedAt": "2026-11-28T23:10:11.304Z",
  "slug": "woocommerce-11-3-1",
  "status": "publish",
  "title": "WooCommerce 11.3.1: Release Notes",
  "excerpt": "WooCommerce 11.3.1 is a security-focused patch release …",
  "content": "Dot Release\n\nWooCommerce 11.3.1 is available now\n\nThis security-focused patch release brings fixes across checkout …",
  "wordCount": 560,
  "date": "2026-11-19T20:12:32",
  "dateGmt": "2026-11-19T20:12:32Z",
  "modified": "2026-11-19T20:12:33",
  "modifiedGmt": "2026-11-19T20:12:33Z",
  "authorId": 308,
  "authorName": "Brian Coords",
  "authorSlug": "bcoords",
  "authorUrl": "https://developer.woocommerce.com/author/bcoords/",
  "categories": ["Releases"],
  "tags": [],
  "featuredImageUrl": "https://developer.woocommerce.com/wp-content/uploads/sites/2/2026/11/WooCommerce-11.3.1-thumbnail-1795037337.png",
  "sticky": false,
  "format": "standard",
  "commentStatus": "open",
  "parentId": null
}
```

**Product example** (shortened)

```json
{
  "type": "product",
  "site": "https://www.soundproofcow.com",
  "id": 8119,
  "url": "https://www.soundproofcow.com/product/quiet-barrier%c2%ad-hd-soundproofing-material-roll/",
  "name": "Quiet Barrier® HD Soundproofing Material (Roll)",
  "sku": "10203060",
  "productType": "simple",
  "currency": "USD",
  "price": 394.99,
  "regularPrice": 404.99,
  "salePrice": 394.99,
  "priceMin": 394.99,
  "priceMax": 394.99,
  "onSale": true,
  "inStock": false,
  "categories": ["Mass Loaded Vinyl Barriers (MLV)", "On Sale"],
  "tags": ["ceiling", "mass loaded vinyl"],
  "mainImageUrl": "https://www.soundproofcow.com/wp-content/uploads/import/P/Soundporoofing_Quiet_Barrier_HD_175.jpg",
  "attributes": [],
  "variationCount": 0,
  "averageRating": null,
  "reviewCount": 0
}
```

**Other row types**

- `page`: same fields as `post` (with `parentId`), without categories and tags.
- `category` / `tag`: `taxonomy` (`category`, `post_tag`, `product_cat`, `product_tag`), `name`, `slug`, `description`, `parentId`, `count`, `url`.
- `media`: `title`, `altText`, `caption`, `mediaType`, `mimeType`, `fileUrl`, `width`, `height`, `fileSizeBytes`, `authorName`, `parentPostId`.
- `comment`: `postId`, `parentId`, `authorName` (public display name), `content`, `date`, `dateGmt`.

Besides the dataset the Actor stores two records:

- **`SITE_REPORT`**: one entry per site with status (`ok`, `partial`, `skipped`, `error`), whether WordPress and WooCommerce were detected, rows per type and human-readable messages (for example "robots.txt of this site disallows the WordPress REST API").
- **`RUN_SUMMARY`**: items stored, sites read/failed/skipped and why the run stopped.

### Pricing

This Actor uses **pay-per-event** pricing: you pay for each **item** (dataset row) returned, plus Apify's standard Actor-start event. There is no monthly rental. Launch price: **$0.0025 per item ($2.50 per 1,000 items)**; the pricing panel on this page always shows the current price.

- Discovery, paging, look-ups of authors, categories and images, retries and the site report are included in the item price.
- Rows that are filtered out or skipped (for example products on a non-WooCommerce site) are not billed.
- Set **Maximum cost per run** when starting the Actor; it stops cleanly when the budget is used.
- Platform usage is included in the event price. No proxy costs.

### Politeness, robots.txt and legal notes

- The Actor reads `robots.txt` first. If it disallows `/wp-json/`, the site is **skipped** and shown as `skipped` in the Site report. The Actor does not try the `?rest_route=` form to get around such a rule.
- Requests are paced per site (default 2 per second), identify as `WordPressWooCommerceScraperApifyActor/0.1`, and back off on HTTP 429 and 5xx errors.
- It only reads data the site itself publishes through its public APIs. Private, draft, password-protected and login-only content is not available.
- **Personal data:** e-mail addresses are never requested, and any that appear inside text or HTML are masked as `[email removed]`. Comment rows contain only the public display name and text — no e-mail, IP address, user agent or author URL. If you process data about identifiable people, you are responsible for GDPR and similar compliance.
- Content on WordPress sites is protected by copyright. Check each site's terms and the content's license before reusing or republishing it. You are responsible for how you use the data.

### Limitations

- Sites that disable the REST API, block it with a firewall (HTTP 401/403, bot protection) or forbid it in robots.txt cannot be read. They appear in the Site report with the reason.
- WooCommerce products come from the public **Store API**, which has no date filter, no product reviews list and no order or customer data by design. Variable products show a price range and variation count, not every variation.
- Author names need the site's public `/users` endpoint; many sites hide it, then `authorId` is returned and `authorName` is `null`.
- `date` and `modified` are in the site's local time; `dateGmt` / `modifiedGmt` are UTC.
- Some sites trim their API output (for example excerpts or full content). The Actor returns what the site's API returns.
- Sites hosted as WordPress.com "simple" sites may not offer `/wp-json/` on their own domain.

### Tips

- Start with a small `maxItems` (for example 10) to preview the output, then scale up.
- Use `maxItemsPerSite` when scraping many sites so one large site does not use the whole budget.
- To export a whole shop catalog: `contentTypes: ["products"]`, a high `maxItems`.
- Schedule the Actor daily with `dateFrom` set to yesterday to monitor new posts.

### FAQ

**Does it need a WordPress login or API key?** No. It only uses public endpoints.

**How do I know if a site works?** Open `https://their-site.com/wp-json/` in a browser. If you see JSON, it should work.

**Why are there no products?** The site does not run WooCommerce, or its Store API is turned off. The Site report says which.

**Can it scrape any e-commerce site (Shopify, Magento)?** No, only WordPress and WooCommerce.

**Something looks wrong or a field is missing.** Open an issue from the Actor's *Issues* tab with your input and the run link.

# Actor input Schema

## `startUrls` (type: `array`):

WordPress sites to read, for example `https://wordpress.org/news`. The home page of the site is enough; you can also give a sub-folder install such as `https://example.com/blog`.

## `contentTypes` (type: `array`):

Choose what to export. WooCommerce products are only returned from sites that run WooCommerce; for all other sites that type is skipped with a note in the Site report.

## `maxItems` (type: `integer`):

Stop after this many rows in total, across all sites and content types. Every row is one billed item.

## `maxItemsPerSite` (type: `integer`):

Optional cap for each site, so one big site cannot use the whole budget. Leave empty to share the total limit.

## `search` (type: `string`):

Only return posts, pages, media, categories, tags or products that match this search phrase (the site's own search).

## `dateFrom` (type: `string`):

Only posts, pages and media published on or after this date. Accepts `YYYY`, `YYYY-MM` or `YYYY-MM-DD`. Uses the site's local time. Not available for WooCommerce products.

## `dateTo` (type: `string`):

Only posts, pages and media published on or before this date (inclusive). Accepts `YYYY`, `YYYY-MM` or `YYYY-MM-DD`.

## `categories` (type: `array`):

Only posts (and products) in these categories. Use the category slug, e.g. `news`, or the numeric ID. Applies to the post categories and, separately, to WooCommerce product categories.

## `tags` (type: `array`):

Only posts (and products) with these tags. Use the tag slug or numeric ID.

## `onSaleOnly` (type: `boolean`):

Only return WooCommerce products that currently have a sale price.

## `inStockOnly` (type: `boolean`):

Only return WooCommerce products that are in stock.

## `includeRawHtml` (type: `boolean`):

Add the original HTML next to the plain-text content (`contentHtml` for posts and pages, `descriptionHtml` for products). Plain text is always included.

## `includeAuthors` (type: `boolean`):

Look up the public author name, slug and profile URL (needs the site's public /users endpoint; skipped when the site hides it). E-mail addresses are never exported.

## `includeComments` (type: `boolean`):

Also export approved public comments on posts as separate `comment` rows (each one counts as an item). Comment rows contain only the public display name and text, never e-mail addresses or IP addresses.

## `maxCommentsPerPost` (type: `integer`):

Only used when comments are included.

## `siteConcurrency` (type: `integer`):

How many sites are read at the same time. Requests to each single site are always rate limited.

## `requestsPerSecond` (type: `integer`):

Politeness limit for each site, 1 to 5. Keep it low for small shops and blogs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://wordpress.org/news"
    }
  ],
  "contentTypes": [
    "posts",
    "products"
  ],
  "maxItems": 100,
  "onSaleOnly": false,
  "inStockOnly": false,
  "includeRawHtml": false,
  "includeAuthors": true,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "siteConcurrency": 3,
  "requestsPerSecond": 2
}
```

# Actor output Schema

## `items` (type: `string`):

No description

## `overview` (type: `string`):

No description

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

No description

## `siteReport` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://wordpress.org/news"
        }
    ],
    "contentTypes": [
        "posts",
        "products"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("onomatopoeia_dev/wordpress-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 = {
    "startUrls": [{ "url": "https://wordpress.org/news" }],
    "contentTypes": [
        "posts",
        "products",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("onomatopoeia_dev/wordpress-woocommerce-scraper").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 '{
  "startUrls": [
    {
      "url": "https://wordpress.org/news"
    }
  ],
  "contentTypes": [
    "posts",
    "products"
  ],
  "maxItems": 100
}' |
apify call onomatopoeia_dev/wordpress-woocommerce-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,onomatopoeia_dev/wordpress-woocommerce-scraper"
        }
    }
}
```

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/74GMS4wd5eIZR2B67/builds/F3Notb6lhxeylQZeY/openapi.json
