# Petrovich Building Materials Scraper (`vexaloom-labs/petrovich-building-materials-scraper`) Actor

Scrape Petrovich (petrovich.ru) - a major Russian building-materials and DIY retailer. Search products, browse by category, and fetch full product detail pages including price, specs/characteristics tables, brand, images, and availability.

- **URL**: https://apify.com/vexaloom-labs/petrovich-building-materials-scraper.md
- **Developed by:** [vexaloom-labs](https://apify.com/vexaloom-labs) (community)
- **Categories:** E-commerce, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Petrovich Building Materials Scraper

Collect structured product data from **Petrovich** (petrovich.ru), one of Russia's
largest building-materials and DIY retailers. Search the catalogue, browse a category,
fetch full product pages, collect reviews, or inspect a category's filters before you
scrape it. Records include prices, club and old prices, specifications, dimensions,
images, videos, certificates, availability and per-store stock.

The actor starts an anonymous Petrovich API session automatically. No login, cookie,
API key, or proxy setup is required.

### Modes

| Mode | What it returns |
|---|---|
| `search` | Products matching a free-text query (`кабель`, `цемент`, `дрель`, …). |
| `byCategory` | Products from one or more catalogue categories, with sort and server-side filters. |
| `productDetails` | Full detail records for specific product URLs or numeric IDs. |
| `reviews` | Product reviews with rating, author, location, pros/cons, images, comments and recommendations. |
| `categoryInfo` | Category metadata: product count, breadcrumbs, subcategories, filter values and sort options. |

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `mode` | select | `search` | `search`, `byCategory`, `productDetails`, `reviews`, `categoryInfo`. |
| `searchQuery` | text | — | Required for `search`. |
| `categoryUrls` | list | `[]` | Category URLs, paths, or bare codes. Required for `byCategory` and `categoryInfo`. |
| `productUrls` | list | `[]` | Product URLs, paths, or numeric IDs. Required for `productDetails` and `reviews`. |
| `city` | select | `spb` | `spb` (Санкт-Петербург), `msk` (Москва), `ekb` (Екатеринбург). Prices and stock are city-specific. |
| `sortBy` | select | `popular` | `popular`, `price_asc`, `price_desc`, `rating`, `reviews`, `new` (new arrivals only). |
| `brand` | text | — | Category mode only. Accepts a brand slug or the brand title from the category filters. |
| `onSale` | boolean | `false` | Only discounted products. |
| `onlyNew` | boolean | `false` | Only new arrivals. |
| `onlyPromo` | boolean | `false` | Only products in a promotion. |
| `inStockOnly` | boolean | `false` | Keep products currently available in the selected city. |
| `deliveryType` | select | `any` | `any`, `today`, `tomorrow`, `five_days`, `whenever`. |
| `minRating` | select | `any` | `any`, `4`, `3`. |
| `minPrice` / `maxPrice` | integer | — | Category mode only. Applied by the actor after fetching (Petrovich has no price-range API). |
| `reviewSort` | select | `date_desc` | `date_desc` or `date_asc`. |
| `maxReviewsPerProduct` | integer | `20` | 1–100. |
| `maxItems` | integer | `30` | 1–10,000. Global cap on emitted records. |
| `proxyConfiguration` | object | — | Optional. Normal runs need no proxy; a residential browser session is used only as a fallback. |

### Examples

Search for cable products in St Petersburg:

```json
{
  "mode": "search",
  "searchQuery": "кабель",
  "maxItems": 50
}
```

Browse ceramic tiles, cheapest first, only items in stock:

```json
{
  "mode": "byCategory",
  "categoryUrls": ["https://petrovich.ru/catalog/10042/"],
  "sortBy": "price_asc",
  "inStockOnly": true,
  "maxItems": 100
}
```

Fetch specific products in Moscow:

```json
{
  "mode": "productDetails",
  "productUrls": ["https://petrovich.ru/product/970548/", "1181179"],
  "city": "msk"
}
```

Collect the newest reviews for a product:

```json
{
  "mode": "reviews",
  "productUrls": ["970548"],
  "reviewSort": "date_desc",
  "maxReviewsPerProduct": 20,
  "maxItems": 20
}
```

Inspect a category before browsing it:

```json
{
  "mode": "categoryInfo",
  "categoryUrls": ["10042"]
}
```

### What is in a product record

- `productUrl`, `sku`, `title`, `description`, `descriptionHtml`, `brand`, `article`.
- `price`, `currency`, `clubPrice`, `oldPrice`, `discountPercent`, `bonusPoints`.
- `availability`, `availabilityCode`, `isInStock`, `supplyDays`.
- `storeAvailability[]` — per-store stock (`storeCode`, `storeName`, `amount`, supply type).
- `deliveryOptions[]` — pickup/delivery options and dates.
- `specifications[]` — every characteristic Petrovich publishes (`name`, `value`, optional `unit`).
- `unit`, `unitFull`, `weightKg`, `dimensions` (`lengthMm`, `widthMm`, `heightMm`), `barcode`.
- `images[]`, `coverImage`, `videos[]` (preview + MP4/WebM/OGG URLs).
- `certificates[]` (type, code, registry link, PDF files), `instructions[]`.
- `promotions[]`, `badges[]`, `promoDetails[]`.
- `ratingValue`, `reviewCount`, `supplier`, `externalId`, `guid`, `isRent`.
- `breadcrumbs[]`, `category`, `categoryPath[]`, `categoryPathUrls[]`.
- `sectionCode`, `sectionTitle`, `sectionUrl`, `city`, `cityCode`, `lastPriceDate`.
- `recordType` (`product`, `review`, or `category`) and `scrapedAt`.

Empty fields are omitted — a field appears only when Petrovich actually publishes it
for that product. No nulls, placeholders, or invented values are emitted.

### Review records

Each review includes `reviewId`, `productCode`, `productUrl`, `productTitle`, `rating`,
`authorName`, `locationName`, `body`, `pros`, `cons`, `likes`, `dislikes`, `usefulness`,
`createdAt`, `isRecommend`, `images`, `videos`, and nested supplier/customer `comments`.

### Category records

Each `categoryInfo` record includes `categoryCode`, `categoryUrl`, `title`,
`productCount`, `breadcrumbs`, `categoryPath`, `subcategories[]`, `filters[]` (every
filter value with its product count) and `sortOptions[]`.

### Data source and reliability

Petrovich protects its storefront with QRATOR, which blocks datacenter IPs. The actor
does not fight that wall: it reads Petrovich's own anonymous JSON API, which is the
same API the website uses. The anonymous session is started from a nonce found on a
public page served through a Google Translate mirror. Once the session exists, data
requests go directly to Petrovich's API — no user cookies, no login, no proxy.

If the API path is unavailable, `search`, `byCategory`, and `productDetails` fall back
to a browser session (Camoufox) with a residential proxy, so the actor still returns
data. The `reviews` and `categoryInfo` modes need the API and say so clearly if it is
temporarily unavailable.

### Limitations

- **Search order:** Petrovich's search page has no sort control; search results are
  always in the site's default relevance order. Use `byCategory` if you need sorting.
- **"Newest":** the API has no newest-first sort. `sortBy: "new"` means only new
  arrivals (the `Новинки` filter), not a date ordering.
- **Price range:** Petrovich's API ignores price-range parameters. `minPrice` and
  `maxPrice` are applied by the actor after paging through a category, so they are
  available in `byCategory` mode only.
- **Cities:** the actor exposes the three city codes verified against the API:
  St Petersburg, Moscow, and Yekaterinburg. Other regions may appear without notice.
- **Catalogue page size:** the API returns at most 50 products per request; the actor
  pages through the rest with offsets. A category with tens of thousands of products
  can take a while at large `maxItems` values.
- **Search suggestions:** Petrovich's autocomplete service requires a private key, so
  it is not exposed as a mode.

### FAQ

**Do I need a proxy?**
No. The actor starts an anonymous API session and works without a proxy. A residential
proxy is used only if the browser fallback is needed.

**Can I use bare IDs?**
Yes. `productUrls` accepts numeric product IDs and `categoryUrls` accepts bare category
codes, in addition to full URLs.

**Why are some fields missing on some products?**
Petrovich does not publish every attribute for every product. The actor omits fields the
source does not have rather than filling them with empty values.

**Is this affiliated with Petrovich?**
No. It is an independent third-party tool that reads publicly visible product data.

# Actor input Schema

## `mode` (type: `string`):

What to collect. Search products, browse a category, fetch specific product pages, collect product reviews, or inspect a category (filters, subcategories, sort options).

## `searchQuery` (type: `string`):

Free-text query, e.g. `кабель`, `цемент`, `дрель`. Search results are always in Petrovich's default relevance order; `sortBy` has no effect in this mode.

## `categoryUrls` (type: `array`):

Petrovich catalog URLs, paths, or bare category codes, e.g. `https://petrovich.ru/catalog/100131139/` or `100131139`.

## `productUrls` (type: `array`):

Petrovich product URLs, paths, or bare numeric product IDs, e.g. `https://petrovich.ru/product/1181179/` or `1181179`.

## `city` (type: `string`):

Petrovich shows city-specific prices and stock. Choose the city whose data you want.

## `sortBy` (type: `string`):

Sort order for category listings. `new` means only new arrivals (the site has no newest-first sort). Search results are always in the site's default relevance order.

## `brand` (type: `string`):

Optional brand filter. Accepts a Petrovich brand slug (`makita`, `pdidtd`, `kitfort`) or the brand title shown in the category filters (`Makita`). Ignored in other modes.

## `onSale` (type: `boolean`):

Apply Petrovich's `Распродажа` (sale) filter in category listings.

## `onlyNew` (type: `boolean`):

Apply Petrovich's `Новинки` (new arrivals) filter in category listings.

## `onlyPromo` (type: `boolean`):

Apply Petrovich's `Акции` (promotions) filter in category listings.

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

Keep only products the site marks as currently available in the selected city. Applied after fetching, so the actor may read extra pages.

## `deliveryType` (type: `string`):

Server-side availability filter for category listings.

## `minRating` (type: `string`):

Server-side rating filter for category listings.

## `minPrice` (type: `integer`):

Optional lower price bound in RUB. Petrovich's API has no price-range parameter, so the actor pages through the listing and filters the results itself. Ignored in other modes.

## `maxPrice` (type: `integer`):

Optional upper price bound in RUB. Applied together with `minPrice` after fetching.

## `reviewSort` (type: `string`):

Order in which reviews are collected.

## `maxReviewsPerProduct` (type: `integer`):

Cap on reviews collected for each product. The overall `maxItems` cap still applies.

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

Hard cap on emitted records (products, reviews, or category records, depending on the mode).

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

Optional custom proxy for the browser fallback. No proxy is needed for normal runs: the actor uses Petrovich's anonymous API and only falls back to a residential browser session if the API path is unavailable.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "кабель",
  "categoryUrls": [],
  "productUrls": [],
  "city": "spb",
  "sortBy": "popular",
  "onSale": false,
  "onlyNew": false,
  "onlyPromo": false,
  "inStockOnly": false,
  "deliveryType": "any",
  "minRating": "any",
  "reviewSort": "date_desc",
  "maxReviewsPerProduct": 3,
  "maxItems": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset containing product records (recordType = product), plus review records (recordType = review) and category records (recordType = category) when those modes are used.

## `reviews` (type: `string`):

Same default dataset, filtered conceptually to records with recordType = review (mode=reviews).

## `categories` (type: `string`):

Same default dataset, filtered conceptually to records with recordType = category (mode=categoryInfo).

# 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 = {
    "mode": "search",
    "searchQuery": "кабель",
    "categoryUrls": [],
    "productUrls": [],
    "city": "spb",
    "sortBy": "popular",
    "onSale": false,
    "onlyNew": false,
    "onlyPromo": false,
    "inStockOnly": false,
    "deliveryType": "any",
    "minRating": "any",
    "reviewSort": "date_desc",
    "maxReviewsPerProduct": 3,
    "maxItems": 3,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("vexaloom-labs/petrovich-building-materials-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 = {
    "mode": "search",
    "searchQuery": "кабель",
    "categoryUrls": [],
    "productUrls": [],
    "city": "spb",
    "sortBy": "popular",
    "onSale": False,
    "onlyNew": False,
    "onlyPromo": False,
    "inStockOnly": False,
    "deliveryType": "any",
    "minRating": "any",
    "reviewSort": "date_desc",
    "maxReviewsPerProduct": 3,
    "maxItems": 3,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("vexaloom-labs/petrovich-building-materials-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 '{
  "mode": "search",
  "searchQuery": "кабель",
  "categoryUrls": [],
  "productUrls": [],
  "city": "spb",
  "sortBy": "popular",
  "onSale": false,
  "onlyNew": false,
  "onlyPromo": false,
  "inStockOnly": false,
  "deliveryType": "any",
  "minRating": "any",
  "reviewSort": "date_desc",
  "maxReviewsPerProduct": 3,
  "maxItems": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call vexaloom-labs/petrovich-building-materials-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/petrovich-building-materials-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/qsoPdoL686XBTML38/builds/LveIS3NxoF8d1SZ7B/openapi.json
