# Polish Electronics Scraper (x-kom, Media Expert) (`barking_kelp/polish-electronics-scraper`) Actor

Scrapes product listings, prices, EAN and specs from x-kom.pl and mediaexpert.pl into one unified format for price monitoring in Poland.

- **URL**: https://apify.com/barking_kelp/polish-electronics-scraper.md
- **Developed by:** [9839_ser](https://apify.com/barking_kelp) (community)
- **Security:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 90.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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/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

## Polish Electronics Scraper (x-kom, Media Expert)

Збирає товари й ціни з **x-kom.pl** і **mediaexpert.pl** в одну таблицю з однаковими полями для обох магазинів. Підходить для моніторингу цін, порівняння асортименту й відстеження акцій.

### Що вміє

- Приймає посилання на категорії й на окремі товари.
- Сам проходить усі сторінки категорії до заданого ліміту.
- Повертає поточну ціну, стару ціну під час акції, найнижчу ціну за 30 днів (Omnibus), наявність, продавця, рейтинг, фото, бренд, категорію.
- Не дублює товари, якщо вони трапляються в кількох посиланнях.
- Повідомляє, якщо якесь посилання не дало жодного товару.

### Вхідні дані

| Поле | Опис |
|---|---|
| **Start URLs** | Посилання на категорії чи товари x-kom.pl або mediaexpert.pl. Магазин визначається автоматично. |
| **Max items per start URL** | Скільки товарів максимум брати з одного посилання. Порожнє поле означає без ліміту. |
| **Include product details** | Додатково відкривати сторінку кожного товару, щоб отримати характеристики, для x-kom ще й акційну та стару ціну, для Media Expert код виробника. Вимкнено за замовчуванням, бо на кожен товар іде окремий запит і запуск стає значно дорожчим. |
| **Proxy configuration** | За замовчуванням польський residential-проксі Apify. Без нього магазини блокують запити, тож міняти не радимо. |

Приклад:

```json
{
  "startUrls": [
    {"url": "https://www.x-kom.pl/g-2/c/159-laptopy-notebooki-ultrabooki.html"},
    {"url": "https://www.mediaexpert.pl/komputery-i-tablety/laptopy-i-ultrabooki/laptopy"}
  ],
  "maxItemsPerStartUrl": 500,
  "includeDetails": false
}
```

### Результат

Один рядок на товар. У вкладці **Prices** основні поля, у вкладці **All fields** усі.

| Поле | Що містить |
|---|---|
| `store` | `x-kom` або `mediaexpert` |
| `product_id`, `url`, `name` | ID товару в магазині, посилання, назва |
| `brand`, `category`, `category_path` | бренд, категорія, шлях категорій |
| `price`, `currency` | поточна ціна, PLN |
| `price_old` | стара (закреслена) ціна, якщо діє акція |
| `price_lowest_30d` | найнижча ціна за останні 30 днів, якщо магазин її показує (Media Expert показує, x-kom зазвичай ні) |
| `availability` | `in_stock`, `out_of_stock`, `preorder` або `unknown`; `availability_raw` містить текст магазину |
| `seller` | продавець (магазин чи партнер маркетплейсу) |
| `rating`, `reviews_count` | рейтинг за шкалою 5 і кількість відгуків |
| `image` | посилання на фото |
| `ean` | штрихкоди EAN/GTIN (лише перевірені, без внутрішніх кодів магазину) |
| `mpn` | код виробника |
| `specs` | характеристики (з **Include product details**) |
| `scraped_at` | час збору |

Приклад рядка:

```json
{
  "store": "mediaexpert",
  "product_id": "2155053237",
  "url": "https://www.mediaexpert.pl/komputery-i-tablety/laptopy-i-ultrabooki/laptopy/laptop-lenovo-ideapad-slim-3-15amn8-15-6-ips-r5-40-16gb-ram-512gb-ssd",
  "name": "Laptop LENOVO IdeaPad Slim 3 15AMN8 15.6\" IPS R5-40 16GB RAM 512GB SSD",
  "brand": "LENOVO",
  "category": "Laptopy",
  "category_path": ["Komputery i tablety", "Laptopy i ultrabooki", "Laptopy"],
  "price": 2399.99,
  "price_old": 2595.0,
  "price_lowest_30d": 2499.99,
  "currency": "PLN",
  "availability": "in_stock",
  "availability_raw": "Dostępny od ręki",
  "seller": "Media Expert",
  "rating": null,
  "reviews_count": 0,
  "image": "https://prod-api.mediaexpert.pl/api/images/gallery_500_500/thumbnails/images/12/12972063/Laptop-LENOVO-IdeaPad-Slim-3-82XQ01PHPB-15-6-IPS-R5-40-16GB-RAM-512GB-SSD-01.jpg",
  "ean": ["0199276373359"],
  "mpn": null,
  "specs": null,
  "scraped_at": "2026-11-03T14:34:54Z"
}
```

#### Що варто знати

- **x-kom не публікує EAN.** Щоб зіставляти однакові товари між магазинами, використовуйте `mpn` (код виробника).
- Що дає **Include product details** для кожного магазину:
  | Магазин | Без деталей | Додається з деталями |
  |---|---|---|
  | x-kom | `mpn` (EAN магазин не публікує) | `specs`, точніший шлях категорій, акційна ціна в `price` і стара ціна в `price_old` |
  | Media Expert | `ean` | `mpn`, `specs` |
- **x-kom без деталей повертає базову ціну.** Акційну ціну (зокрема короткі акції на кшталт «Gorący strzał») і стару ціну x-kom віддає тільки зі сторінки товару, тож для моніторингу акцій на x-kom вмикайте **Include product details**. У Media Expert акційна, стара й найнижча за 30 днів ціни є і без деталей.
- Якщо в **Start URLs** вказано посилання на окремий товар, характеристики й код виробника повертаються завжди, незалежно від **Include product details**.
- Інші магазини не підтримуються. Посилання з інших сайтів пропускаються.

### Статус запуску

- Усі посилання дали товари: запуск **Succeeded**, у статусі кількість зібраних товарів.
- Частина посилань не дала жодного товару: запуск **Succeeded**, але статус попереджає й називає ці посилання (перші три й кількість решти) (наприклад, порожня категорія або тимчасове блокування).
- Жодне посилання не дало товарів: запуск **Failed**.

# Actor input Schema

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

Category or product URLs from x-kom.pl or mediaexpert.pl. The store is detected from the domain.

## `maxItemsPerStartUrl` (type: `integer`):

Stop paginating a start URL after this many products. Leave empty for no limit.

## `includeDetails` (type: `boolean`):

Fetch each product page: adds full specs for both stores, the promo and old price for x-kom (the x-kom listing has the base price only) and MPN for Media Expert. Extra requests per product make the run roughly 100x more expensive than listing-only. x-kom MPN and Media Expert EAN are already in the listing.

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

Polish residential proxy is required: Apify datacenter proxies were tested and get blocked by x-kom (listing) and Media Expert (product pages).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.x-kom.pl/g-2/c/159-laptopy-notebooki-ultrabooki.html"
    }
  ],
  "maxItemsPerStartUrl": 500,
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}
```

# Actor output Schema

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

Scraped products with the main price fields (dataset view 'overview').

## `productsFull` (type: `string`):

Scraped products with every field, including EAN, MPN and specs (dataset view 'full').

# 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://www.x-kom.pl/g-2/c/159-laptopy-notebooki-ultrabooki.html"
        }
    ],
    "maxItemsPerStartUrl": 500,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "PL"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("barking_kelp/polish-electronics-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://www.x-kom.pl/g-2/c/159-laptopy-notebooki-ultrabooki.html" }],
    "maxItemsPerStartUrl": 500,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "PL",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("barking_kelp/polish-electronics-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://www.x-kom.pl/g-2/c/159-laptopy-notebooki-ultrabooki.html"
    }
  ],
  "maxItemsPerStartUrl": 500,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}' |
apify call barking_kelp/polish-electronics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,barking_kelp/polish-electronics-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/rUwJXbg9Uluse5uhM/builds/EwA46DcaDoRWaeyK6/openapi.json
