# Price Battle Map (`eastonkim_praha/price-battle-map`) Actor

Shows where every brand sits on the shelf by price band: crowded bands, open bands, and the same model's price across shops. Reads retailer category pages or the results of other shop scrapers.

- **URL**: https://apify.com/eastonkim_praha/price-battle-map.md
- **Developed by:** [Easton Kim](https://apify.com/eastonkim_praha) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

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

## Price Battle Map

See where every brand sits on the shelf, by price band. Find the bands that are crowded, the bands nobody sells in, and the models that cost more in one shop than in another.

### What it does

Give it a retailer's category page, or the results of shop scrapers from Apify Store. It reduces every listing to one model, puts each model in a price band, and returns:

- **A dataset**: one row per shop and model, with brand, price, list price, coupon code and price band.
- **`report.html`**: a price ladder chart. One row per price band, one coloured block per brand, open bands highlighted. Below it, the same model compared across shops, largest gaps first.
- **`SUMMARY`**: the same result as JSON, ready for an AI agent or a spreadsheet.

Set **Your brand** and the report also lists the bands where rivals sell and you don't.

### Example

Czech phone shelf, 3 to 4 October 2026: 118 models from three shops. Each square is one model, at its lowest shop price.

🟦 Samsung · ⬛ Xiaomi · 🟧 Apple · 🟩 Google · ⬜ other brands

```
70–75k  🟧🟧  2
65–70k  OPEN
60–65k  OPEN
55–60k  🟦  1
50–55k  OPEN
45–50k  🟦🟦⬜  3
40–45k  🟦🟦🟦🟧  4
35–40k  🟦🟧🟧⬜  4
30–35k  🟦🟦🟦🟧🟧🟧🟩🟩⬜  9
25–30k  🟦🟦🟦🟦🟦⬛🟧🟧🟧🟧🟩🟩  12
20–25k  🟦🟦🟦🟦⬛⬛🟧🟧🟧🟧🟩🟩⬜⬜  14
15–20k  🟦🟦🟦🟦🟦🟦🟦🟦🟦⬛⬛🟧🟧🟩🟩🟩🟩⬜⬜⬜  20
10–15k  🟦🟦🟦🟦🟦🟦🟦⬛⬛⬛⬛⬛🟩🟩🟩⬜⬜⬜⬜⬜  20
5–10k   🟦🟦🟦🟦🟦🟦🟦🟦🟦⬛⬛⬛⬛⬛⬛⬛⬛⬛⬜⬜⬜⬜  22
0–5k    🟦⬛⬛⬛⬛⬛⬜  7
```

Three bands are open, and most of the shelf sits below 20,000 CZK. In `report.html` the same ladder is drawn as a colour chart, followed by the shop comparison:

| Model | alza.cz | datart.cz | mironet.cz | Gap |
|---|---|---|---|---|
| Samsung Galaxy S26 Ultra 256GB | 34,011 | 37,790 | **27,990** | 26% |
| Samsung Galaxy A57 256GB | 13,990 | 15,990 | **11,990** | 25% |
| Apple iPhone 16 128GB | 22,990 | | **20,990** | 9% |

### Why

Sales and pricing teams ask two questions before every launch: where is the gap, and who is undercutting us? Answering them usually means a person copying prices into a spreadsheet. This Actor does it in a minute and can run every week.

### Two ways to feed it

1. **Category pages** it reads itself. It uses the structured product data (schema.org) that shops publish for search engines, and has a built-in preset for mironet.cz.
2. **Results from other Actors**. Run an Alza, Datart or other shop scraper from Apify Store, then pick its dataset under *Results from other Actors*. Product name, price, brand and coupon price are picked up automatically.

Both can be combined in one run.

### Input

| Field | What it is |
|---|---|
| Category pages | Category URLs the Actor reads itself |
| Results from other Actors | Datasets from shop scrapers |
| Price band size | Width of a band, default 5,000 |
| Ignore products cheaper than | Removes accessories, default 3,000 |
| Count colours as one model | Five colours count once, at the lowest price |
| Leave out unboxed and used items | New stock only, on by default |
| Your brand | Optional. Shows the bands you are missing from |

### How models are matched

Shops name the same phone differently. "Mobilní telefon Samsung Galaxy S26 5G 12 GB / 256 GB (SM-S942B) černý" and "SAMSUNG Galaxy S26 5G 12+256GB černá" both become "Samsung Galaxy S26 256GB". Colour, RAM and network labels are dropped; brand, model and storage are kept.

### Fair use

For category pages it identifies itself in the user agent, reads public pages only, waits between requests and does not use site search. If a shop refuses the request, the Actor reports it and moves on. Check the retailer's robots.txt and terms before you run it.

### Limits

- Built and tested on Czech mobile phone categories. Other categories may need the CSS selectors under Advanced.
- Coupon prices are used when the source dataset provides them. Cashback and trade-in bonuses are not applied.
- Model matching is rule-based and can miss unusual names.
- One currency per run. No conversion.

# Actor input Schema

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

Retailer category pages that list products with prices, for example a mobile phones category.

## `datasets` (type: `array`):

Datasets produced by shop scrapers from Apify Store, for example an Alza or Allegro scraper. Their products are added to the map.

## `maxPagesPerUrl` (type: `integer`):

How many result pages to read for each category URL.

## `bandSize` (type: `integer`):

Width of one price band, in the shop's currency.

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

Filters out accessories that appear in the category.

## `mergeVariants` (type: `boolean`):

The same phone in five colours counts once, at its lowest price.

## `excludeUsed` (type: `boolean`):

Skips listings marked as unboxed, used or refurbished, so the map shows new stock only.

## `focusBrand` (type: `string`):

The report lists price bands where rivals sell and this brand does not.

## `currency` (type: `string`):

Shown in the output. Prices are not converted.

## `brands` (type: `array`):

Used when the shop does not declare the brand. Leave empty for the built-in list.

## `useApifyProxy` (type: `boolean`):

Turn on if the shop refuses the request.

## `productSelector` (type: `string`):

Only needed when the shop has no structured product data. Fill all three selectors.

## `nameSelector` (type: `string`):

Inside the product box.

## `priceSelector` (type: `string`):

Inside the product box.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.mironet.cz/telefony/mobilni-telefony+c10737/"
    }
  ],
  "maxPagesPerUrl": 5,
  "bandSize": 5000,
  "minPrice": 3000,
  "mergeVariants": true,
  "excludeUsed": true,
  "focusBrand": "Samsung",
  "currency": "CZK",
  "useApifyProxy": false
}
```

# Actor output Schema

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

No description

## `report` (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://www.mironet.cz/telefony/mobilni-telefony+c10737/"
        }
    ],
    "focusBrand": "Samsung"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eastonkim_praha/price-battle-map").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.mironet.cz/telefony/mobilni-telefony+c10737/" }],
    "focusBrand": "Samsung",
}

# Run the Actor and wait for it to finish
run = client.actor("eastonkim_praha/price-battle-map").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.mironet.cz/telefony/mobilni-telefony+c10737/"
    }
  ],
  "focusBrand": "Samsung"
}' |
apify call eastonkim_praha/price-battle-map --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eastonkim_praha/price-battle-map"
        }
    }
}
```

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/M5SQKNxfqVIX3HZ0l/builds/Irl2tDOhcp8tcGw5n/openapi.json
