# Competitor Price Index — Daily Price Position vs Competitors (`xtracto/competitor-price-index`) Actor

Track where your prices stand against the competitor product pages you choose, across Shopify stores, Amazon, Newegg and most online shops. Each run gives your rank, price index and gap to the cheapest competitor, and reports undercuts and competitor price moves.

- **URL**: https://apify.com/xtracto/competitor-price-index.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Competitor Price Index — Daily Price Position vs Competitors

Know where your prices stand. For each product you sell, give your price (or your product page) and the competitor product pages to compare against. Each run tells you your rank, your price index against the competitor average, your gap to the cheapest competitor, and what changed since the last run: undercuts, competitor price drops and rises.

### Why use this actor

- **One number per product**: price index (100 = market average, below 100 = cheaper than average), plus rank and gap to the cheapest rival.
- **Alerts that matter**: `undercut` (someone just beat your price), `became_cheapest`, `rank_changed`, `competitor_price_drop` / `competitor_price_increase`, `index_changed`.
- **A basket view**: the average index across all your products, stored with every run.
- **Works across stores**: Shopify stores, Amazon, Newegg, and shops that publish standard product data (IKEA, Nike, B\&H, most WooCommerce and Magento shops).
- **Apples to apples**: competitor prices in another currency are shown but kept out of the index, so a foreign-currency listing never looks like a 99% undercut.
- No account, no login, no API key.

### How it works

1. List your products: a name, your price (or your own product page) and the competitor pages for the same or equivalent product.
2. Schedule the actor daily.
3. Each run reads every page once, computes your position for each product and compares it with the previous run.
4. One row per product comes out, plus a basket summary. Connect a webhook or integration to get alerts.

### Input

```json
{
  "products": [
    {
      "name": "Bookcase",
      "myPrice": 70,
      "competitorUrls": [
        "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
        "https://www.amazon.com/dp/B09B8V1LZ3",
        "https://en.wikipedia.org/wiki/Bookcase"
      ]
    }
  ],
  "currency": "USD",
  "indexChangeThreshold": 2,
  "onlyReportChanges": false,
  "maxConcurrency": 4,
  "timeoutSecs": 45
}
```

| Field | Type | Description |
|---|---|---|
| `products` | array | Objects with `name`, `myPrice` **or** `myUrl` (your own product page, read each run), and `competitorUrls` |
| `currency` | string | Your prices' currency |
| `indexChangeThreshold` | integer | Report `index_changed` when your index moves by at least this many points |
| `onlyReportChanges` | boolean | Output only products with an event (plus first-run baselines) |
| `maxConcurrency`, `timeoutSecs` | integer | Parallel page reads and time budget per page |
| `proxyConfiguration` | object | Optional residential proxy support. For Amazon, use the store's own country |

### Output

Real row from a first run on 2026-10-22, run from outside the US. It shows all three competitor outcomes: counted, listed in another currency (Amazon showed a local-currency price, so it is kept out of the index), and unreadable (not a product page):

```json
{
  "product": "Bookcase",
  "currency": "USD",
  "myPrice": 70.0,
  "competitorsCounted": 1,
  "cheapestCompetitorPrice": 79.0,
  "cheapestCompetitorUrl": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
  "averageCompetitorPrice": 79.0,
  "priceIndex": 88.61,
  "gapToCheapestPercent": -11.39,
  "myRank": 1,
  "rankOutOf": 2,
  "firstRun": true,
  "events": [],
  "competitorChanges": [],
  "competitors": [
    { "url": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/", "title": "BILLY, Bookcase, white, 31 1/2x11x79 1/2 \"", "price": 79.0, "currency": "USD", "availability": "unknown", "source": "S3-structured", "currencyVerified": true, "inIndex": true, "myGapPercent": -11.39 },
    { "url": "https://www.amazon.com/dp/B09B8V1LZ3", "title": "Amazon Echo Dot (newest model) - …", "price": 1984605.0, "currency": "IDR", "availability": "unknown", "source": "S2-amazon", "currencyVerified": true, "inIndex": false }
  ],
  "unreadable": [{ "url": "https://en.wikipedia.org/wiki/Bookcase", "error": "no_price_found" }]
}
```

On a later run where a competitor drops below you, the same row carries for example `"events": ["undercut", "rank_changed", "competitor_price_drop", "index_changed"]` and `"competitorChanges": [{"url": "…", "from": 120, "to": 100.0, "changePercent": -16.67}]`.

| Field | Type | Description |
|---|---|---|
| `priceIndex` | number | Your price ÷ average counted competitor price × 100 |
| `myRank`, `rankOutOf` | integer | 1 = cheapest among you and the counted competitors |
| `gapToCheapestPercent` | number | How far above (+) or below (−) the cheapest competitor you are |
| `cheapestCompetitorPrice`, `cheapestCompetitorUrl`, `averageCompetitorPrice` | | The market you are compared with |
| `events` | array | `undercut`, `became_cheapest`, `rank_changed`, `competitor_price_drop`, `competitor_price_increase`, `index_changed` |
| `competitorChanges` | array | Competitor price moves since the last run |
| `competitors` | array | Every competitor's price, currency, stock, data source and your gap to it. `inIndex: false` = not counted (other currency or no price) |
| `unreadable` | array | Competitor pages that could not be read this run |
| `previousMyPrice`, `previousMyRank`, `previousPriceIndex` | | From the previous run |

The run's key-value store also gets an `INDEX_SUMMARY` record: number of products indexed, the basket's average price index and any skipped products.

### Notes and limits

- **First run = baseline.** Events start from the second run.
- You choose what counts as a competitor product; the actor compares the prices of the pages you give it.
- Stores whose prices only appear after scripts run in the browser, or that refuse automated visitors, show up in `unreadable`.
- A product with no readable competitor in your currency is skipped and named in the status message. A run where no product could be indexed is marked failed.

### Related actors

| Actor | Use it for |
|---|---|
| Price & Stock Monitor | Price drop and restock alerts per product, per variant |
| Hotel Rate Parity Monitor | Rate parity for hotels across booking sites |

# Actor input Schema

## `products` (type: `array`):

One object per product you sell: name, your price (myPrice) or your product page (myUrl), and the competitor product pages to compare against (competitorUrls). Works with Shopify stores, Amazon, Newegg and shops that publish standard product data (IKEA, Nike, B\&H, most WooCommerce/Magento).

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

Your prices' currency. Competitor prices in another currency are listed but left out of the index.

## `indexChangeThreshold` (type: `integer`):

Report index_changed when your price index moves by at least this many points.

## `onlyReportChanges` (type: `boolean`):

Output only products with an event (plus first-run baselines).

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

How many competitor pages to read at the same time.

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

How long to wait for one page before counting it as failed.

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

Optional. For Amazon use RESIDENTIAL in the store's country.

## Actor input object example

```json
{
  "products": [
    {
      "name": "Men's running sneaker",
      "myPrice": 110,
      "competitorUrls": [
        "https://www.allbirds.com/products/mens-tree-runners",
        "https://www.nike.com/t/air-force-1-07-mens-shoes-jBrhbr/CW2288-111"
      ]
    }
  ],
  "currency": "USD",
  "indexChangeThreshold": 2,
  "onlyReportChanges": false,
  "maxConcurrency": 4,
  "timeoutSecs": 45,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per product (or per changed product with onlyReportChanges), stored in the run's default dataset.

# 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 = {
    "products": [
        {
            "name": "Men's running sneaker",
            "myPrice": 110,
            "competitorUrls": [
                "https://www.allbirds.com/products/mens-tree-runners",
                "https://www.nike.com/t/air-force-1-07-mens-shoes-jBrhbr/CW2288-111"
            ]
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/competitor-price-index").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 = {
    "products": [{
            "name": "Men's running sneaker",
            "myPrice": 110,
            "competitorUrls": [
                "https://www.allbirds.com/products/mens-tree-runners",
                "https://www.nike.com/t/air-force-1-07-mens-shoes-jBrhbr/CW2288-111",
            ],
        }],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/competitor-price-index").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 '{
  "products": [
    {
      "name": "Men'\''s running sneaker",
      "myPrice": 110,
      "competitorUrls": [
        "https://www.allbirds.com/products/mens-tree-runners",
        "https://www.nike.com/t/air-force-1-07-mens-shoes-jBrhbr/CW2288-111"
      ]
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call xtracto/competitor-price-index --silent --output-dataset

```

## MCP server setup

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

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/DzoFm14zOeVaxFyJb/builds/Ow4We019pLJe53y4Y/openapi.json
