# Universal Ecommerce Schema Product Price Scraper (`arezdev/universal-ecommerce-schema-product-price-scraper`) Actor

Extract product names, prices, SKUs, GTINs, availability and ratings from JSON-LD, Microdata and OpenGraph. Discover product URLs through sitemaps and export structured data from stores that publish supported metadata in their HTML.

- **URL**: https://apify.com/arezdev/universal-ecommerce-schema-product-price-scraper.md
- **Developed by:** [Arezdev](https://apify.com/arezdev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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

**Turn e-commerce product pages into clean product, price, stock, and rating data without writing CSS selectors.**

Extract public product information from WooCommerce, Magento, VTEX, BigCommerce, and other stores that publish product metadata in their server-rendered HTML. Paste product URLs or discover pages through sitemaps. Export the flat dataset as JSON, CSV, or Excel, or connect it to your automation workflow.

Best for product pages that expose structured metadata in downloaded HTML. Start with a direct product URL, inspect the result, then enable sitemap discovery. Store platform names alone do not guarantee coverage; missing or stale source metadata limits the output.

### How to use

1. Paste product URLs into **Product or store URLs**.
2. For catalog discovery, enable **Discover products from sitemaps** and enter store URLs. Adjust the product URL filter to the store's paths.
3. Choose the maximum number of saved rows and click **Start**.
4. Open the dataset to review or export results.

The prefilled example extracts one public demo product:

```json
{
  "urls": ["https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"],
  "discoverFromSitemap": false,
  "maxProducts": 3,
  "maxConcurrency": 25,
  "timeoutSecs": 15
}
```

The demo uses ordinary HTML rather than structured product metadata. A final semantic HTML fallback handles its product markup and reports `extractionMethod: "HTML"`.

For sitemap discovery, replace the example hostname with your store:

```json
{
  "urls": ["https://your-store.example"],
  "discoverFromSitemap": true,
  "sitemapUrlPattern": "/product",
  "maxProducts": 50
}
```

Discovery reads `/robots.txt`, `/sitemap.xml`, nested sitemap indexes, and `.xml.gz` files. It deduplicates URLs, follows at most 1,000 sitemaps per store, and keeps discovered links within the store domain and its subdomains. Product paths supplied with discovery enabled are also extracted directly. Sitemaps are fetched sequentially; product pages use concurrent requests.

### What data can you extract?

| Fields | Contents |
| --- | --- |
| `productUrl`, `domain` | Final page URL and store hostname |
| `status`, `errorMessage` | `SUCCESS` or `ERROR`, with safe error details |
| `name`, `brand`, `category` | Product identity and classification |
| `sku`, `gtin`, `mpn` | SKU, GTIN/EAN/UPC, and manufacturer part number; leading zeroes are preserved |
| `price`, `currency` | Numeric price and published three-letter currency code |
| `availability`, `inStock` | Published availability and a nullable stock flag |
| `ratingValue`, `reviewCount` | Aggregate rating and review or rating count |
| `sellerName` | Seller from the selected offer |
| `imageUrl`, `allImages` | Main image and up to 50 product image URLs |
| `descriptionSnippet` | Plain-text description, limited to 1,000 characters |
| `extractionMethod`, `scrapedAt` | Primary source and UTC extraction time |

Extraction runs in this order: JSON-LD (`LD_JSON`), OpenGraph (`OPENGRAPH`), then Microdata (`MICRODATA`). Lower layers fill missing fields. `extractionMethod` identifies the highest-priority product source found, even when another source fills a missing price. A final semantic `HTML` fallback supports markup such as the supplied demo.

JSON-LD supports root objects, arrays, `@graph`, `ProductGroup`, variant selection, graph references, `Offer`, `AggregateOffer.lowPrice`, and price specifications. Common trailing commas and unescaped control characters are repaired. A matching product or offer URL is preferred; otherwise the first usable offer is selected. Each page produces one row rather than one row per variant or seller. Aggregate offer prices are published minimums, not calculated averages.

Missing values are `null`; image lists default to `[]`. Recognized products may succeed without a price when none is published. Backorders, preorders, presales, discontinued products, and sold-out products have `inStock: false`; unknown stock remains `null`. Prices are not converted between currencies.

### Input settings

| Setting | Default | Details |
| --- | --- | --- |
| `urls` | Required | 1–5,000 public HTTP/HTTPS URLs; duplicates and fragments are removed |
| `discoverFromSitemap` | `false` | Discover product URLs from each store's sitemaps |
| `sitemapUrlPattern` | `/product` | Case-insensitive literal substring; an empty string includes all sitemap pages |
| `maxProducts` | `50` | 1–5,000 saved rows across all stores, including errors; Console prefill is `3` |
| `maxConcurrency` | `25` | 1–60; actual concurrency adapts to available memory |
| `timeoutSecs` | `15` | 3–60 seconds for the complete URL attempt, including DNS, redirects, and retries |
| `proxyConfiguration` | Optional | Direct requests with eligible proxy fallbacks |

At the default 256 MB, up to six product requests run simultaneously to bound parsing memory. Increasing run memory permits higher concurrency up to your requested maximum.

Direct requests have no proxy cost. HTTP 403, 429, and 503 can trigger Apify datacenter retries, first with `SHADER`, then the default account datacenter proxy. Configured or residential Apify proxies are used only when `useApifyProxy: true` was explicitly selected. Custom `proxyUrls` force those proxies. Setting `useApifyProxy: false` forces direct connections unless custom proxy URLs were supplied. Managed proxies require the platform-provided proxy password; the Actor never retrieves a user profile to obtain it.

### Output example

```json
{
  "productUrl": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
  "domain": "books.toscrape.com",
  "status": "SUCCESS",
  "name": "A Light in the Attic",
  "brand": null,
  "sku": null,
  "gtin": null,
  "mpn": null,
  "price": 51.77,
  "currency": "GBP",
  "availability": "InStock",
  "inStock": true,
  "ratingValue": null,
  "reviewCount": null,
  "sellerName": null,
  "category": null,
  "imageUrl": "https://books.toscrape.com/media/cache/fe/72/fe72f0532301ec28892ae79a629a293c.jpg",
  "allImages": ["https://books.toscrape.com/media/cache/fe/72/fe72f0532301ec28892ae79a629a293c.jpg"],
  "descriptionSnippet": "It's hard to imagine a world without A Light in the Attic.",
  "extractionMethod": "HTML",
  "scrapedAt": "2026-10-20T12:00:00.000Z",
  "errorMessage": null
}
```

The timestamp and description above are illustrative. Descriptions are stripped of markup. Dataset text is protected against spreadsheet formula injection with an apostrophe prefix for risky leading characters; numeric prices remain numbers.

### Use the results in Clay, n8n, Make, or your API

Use your platform's Apify integration to start a run, wait for completion, and retrieve its default dataset. Map `productUrl` or `sku` to your product key, then map `price`, `currency`, and `inStock`. Filter `status` to `SUCCESS` before updating records; send `ERROR` rows to a retry or alert workflow.

For API integrations, use `GET https://api.apify.com/v2/datasets/{datasetId}/items?format=json&clean=true`. For private datasets, authenticate through your platform's secret storage or an authorization header. See the [dataset items API](https://docs.apify.com/api/v2/dataset-items-get) for pagination and export options. Schedule repeated runs in Apify Console and compare snapshots in your database or workflow.

### Pricing and limits

The custom event is `product-extracted`. Only saved `SUCCESS` rows are submitted with this event. **`ERROR` rows cost $0 in event fees.** Standard platform usage and selected proxies can still incur costs.

Example: at a Store rate of **$0.001 per successful product**, **1,000 successful products cost $1.00** in extraction event fees. A run with 900 successes and 100 errors costs $0.90 in event fees at that rate. This is an illustrative rate; the active Store price is configured in Apify Console.

Free-plan platform runs have a hard cap of **25 saved rows**, counting successes and errors together. Local runs are unrestricted by that gate. All runs respect `maxProducts`. Event budget exhaustion stops new work, flushes buffered results within the remaining budget, and exits successfully.

Publishers must configure `product-extracted` in Apify Console before enabling PPE. Keep the automatic `apify-default-dataset-item` event fee disabled or zero so errors remain free. The Actor refuses to extract if that automatic event has a positive price. Pricing is an account setting rather than a source-controlled rate. See the [Apify pay-per-event guide](https://docs.apify.com/sdk/js/docs/guides/pay-per-event).

### FAQ and troubleshooting

**Does this work with every store?**

The product data must be present in the HTTP response as supported structured markup or semantic HTML. The Actor does not execute JavaScript. JavaScript-only stores without server-rendered product data return `NO_PRODUCT_DATA`. Prices can vary with location, currency selection, session, or login.

**Why are fields empty?**

The Actor reports published values and does not invent missing identifiers, currency, ratings, or stock. `price: null` on a successful product means valid product metadata was found without a valid price. Generic pages without product evidence produce an error.

**Why does discovery find no products?**

Adjust `sitemapUrlPattern` to the store's product paths, such as `/p/` or `.html`. The default `/product` does not match every store. An empty filter also includes category and editorial pages. Missing or inaccessible sitemaps produce warnings; a store with no usable candidates produces one free error record.

**How are blocked or interrupted pages handled?**

Individual HTTP failures, TLS errors, malformed pages, and timeouts become safe `ERROR` records. HTTP/2 incompatibilities retry once over HTTP/1.1. Eligible bare-domain connection failures retry once with `www`. TLS verification remains enabled. HTML larger than 4 MiB can preserve an extracted prefix. A timeout or socket reset after a successful HTTP status and at least 16 KiB of HTML can also preserve extracted data; logs report `TRUNCATED_HTML`.

**What safety limits apply?**

HTML is capped at 4 MiB, JSON at 2 MiB, and XML at 15 MiB after decompression. Incomplete XML and JSON are rejected. Nesting is capped at 128, and XML DTD/external entities are disabled. Public HTTP/HTTPS URLs on default ports are required. Private or reserved IPs, local hostnames, embedded credentials, unsafe redirects, and HTTPS downgrades are blocked. Every redirect is revalidated, up to six hops. Proxy CONNECT tunnels use validated public IP addresses to prevent remote DNS rebinding.

### Development and deployment

Use Node.js 22.13 or newer:

```sh
npm ci
npm run build
npm test
npm run smoke
```

Tests use `node:test` and cover extraction, malformed JSON-LD, XML and gzip limits, SSRF, DNS pinning, protocol fallback, partial response recovery, batching, PPE, and free-plan limits. The smoke command runs the actual entry point against the public prefill URL with isolated local storage and no inherited Apify credentials.

For a local run, create `storage/key_value_stores/default/INPUT.json` with the sample input and run `npm start`. Set `CRAWLEE_STORAGE_DIR` to choose another storage directory. Start and test runners set `UV_THREADPOOL_SIZE=64`, production mode, and TLS verification before spawning Node.js.

The multi-stage `node:22-alpine` Dockerfile builds TypeScript, retains only production dependencies, and runs as the non-root `node` user. Deploy through Apify CLI or a source integration, select `LIMITED_PERMISSIONS`, retain 256 MB memory and the 3,600-second run timeout, and configure Store event pricing in Console.

Repository initialized by Arezgit.

# Actor input Schema

## `urls` (type: `array`):

Absolute HTTP or HTTPS URLs. With discovery disabled, each URL is extracted directly. With discovery enabled, product paths are extracted and each store's sitemaps are searched.

## `discoverFromSitemap` (type: `boolean`):

Read robots.txt, sitemap.xml, nested sitemap indexes, and compressed XML sitemaps. Only links belonging to the requested store are followed.

## `sitemapUrlPattern` (type: `string`):

Case-insensitive literal substring, not a regular expression. Change this for stores using another product path. An empty string includes every sitemap page.

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

Maximum saved rows across all stores. Both successful products and free error records count toward this limit. Free-plan platform runs have a hard cap of 25 rows.

## `maxConcurrency` (type: `integer`):

Upper bound for concurrent product requests. The Actor lowers concurrency when necessary to stay within the available memory.

## `timeoutSecs` (type: `integer`):

Total time budget per URL, including redirects, protocol retries, DNS, and proxy fallback.

## `proxyConfiguration` (type: `object`):

Direct connections are tried first. Blocked requests may use available datacenter proxies. Configured Apify proxies are tried only when explicitly enabled. Custom proxy URLs force that proxy; disabling Apify Proxy forces direct requests.

## Actor input object example

```json
{
  "urls": [
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "discoverFromSitemap": false,
  "sitemapUrlPattern": "/product",
  "maxProducts": 3,
  "maxConcurrency": 25,
  "timeoutSecs": 15
}
```

# Actor output Schema

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

Default dataset items. Review each record status before using extracted data downstream.

# 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 = {
    "urls": [
        "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
    ],
    "maxProducts": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("arezdev/universal-ecommerce-schema-product-price-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 = {
    "urls": ["https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"],
    "maxProducts": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("arezdev/universal-ecommerce-schema-product-price-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 '{
  "urls": [
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "maxProducts": 3
}' |
apify call arezdev/universal-ecommerce-schema-product-price-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arezdev/universal-ecommerce-schema-product-price-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/yAfAacKWRdJGdgXOF/builds/Ra8rIP7F8eWZYgtOT/openapi.json
