# Competitor Price Tracker - Monitor Any Product URL (`lulzasaur/price-tracker`) Actor

Track competitor prices on any e-commerce site. Monitor Shopify, Amazon, eBay, Walmart, and custom stores. Get instant alerts on price drops, increases, and stock changes. Perfect for small businesses doing competitive pricing.

- **URL**: https://apify.com/lulzasaur/price-tracker.md
- **Developed by:** [lulz bot](https://apify.com/lulzasaur) (community)
- **Categories:** Other
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Competitor Price Tracker

Monitor competitor product prices on any e-commerce site. Get instant alerts when prices change.

### What It Does

This actor takes a list of competitor product URLs, scrapes each one to extract the current price, compares it against the stored price history, and sends alerts when prices change. It works with virtually any e-commerce site including Shopify, Amazon, eBay, Walmart, WooCommerce, BigCommerce, and custom stores.

### Features

- **Universal Price Extraction** - Uses 6 different strategies to find prices on any e-commerce page (JSON-LD, Open Graph, microdata, CSS selectors, Shopify-specific, regex patterns)
- **Persistent Price History** - Stores up to 30 data points per product across runs using Apify Key-Value Store
- **Discord Alerts** - Instant notifications to your Discord channel on price changes
- **Custom Webhooks** - Send price change data to any URL (Zapier, Make, n8n, your own server)
- **Threshold Filtering** - Only alert when changes exceed a percentage you set
- **Stock Monitoring** - Detects out-of-stock status changes
- **Your Price Comparison** - Set your own price to see how competitors compare

### Input Example

```json
{
    "urls": [
        {
            "url": "https://competitor-store.com/products/widget-pro",
            "name": "Widget Pro (Competitor A)",
            "expectedPrice": 29.99
        },
        {
            "url": "https://amazon.com/dp/B08N5WRWNW",
            "name": "Widget Pro (Amazon)"
        },
        {
            "url": "https://another-store.com/widget",
            "name": "Widget (Store B)"
        }
    ],
    "discordWebhookUrl": "https://discord.com/api/webhooks/...",
    "alertOnIncrease": true,
    "alertThresholdPercent": 5,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
}
````

### Output

Each monitored URL produces a result object:

| Field | Description |
|-------|-------------|
| `url` | The monitored product URL |
| `name` | Product name (your label or extracted from page) |
| `currentPrice` | Current price found on the page |
| `previousPrice` | Price from the last run |
| `priceChange` | Dollar amount of change |
| `priceChangePercent` | Percentage change |
| `alertType` | `price_drop`, `price_increase`, `new_product`, `out_of_stock`, or `null` |
| `productTitle` | Title extracted from the product page |
| `currency` | Detected currency (USD, EUR, GBP, etc.) |
| `inStock` | Whether the product appears to be in stock |
| `imageUrl` | Product image URL |
| `checkedAt` | Timestamp of this check |
| `priceHistory` | Last 10 price data points |

### Setting Up Scheduled Monitoring

1. **Create the actor run** with your product URLs and alert settings
2. **Set up a Schedule** in the Apify Console:
   - Go to your actor > Schedules
   - Create a new schedule (e.g., every 6 hours, daily, etc.)
   - The actor will compare against the previous run's prices automatically

### Discord Integration

1. In your Discord server, go to **Server Settings > Integrations > Webhooks**
2. Click **New Webhook**, choose a channel, and copy the webhook URL
3. Paste the URL into the `discordWebhookUrl` input field

Alerts include the product name, old price, new price, percentage change, and a thumbnail image when available.

### Custom Webhook Integration

The actor sends a POST request with this JSON payload:

```json
{
    "source": "apify-price-tracker",
    "alerts": [
        {
            "url": "https://...",
            "name": "Product Name",
            "currentPrice": 24.99,
            "previousPrice": 29.99,
            "priceChange": -5,
            "priceChangePercent": "-16.7%",
            "alertType": "price_drop",
            "currency": "USD",
            "inStock": true
        }
    ],
    "totalChanges": 1,
    "timestamp": "2026-03-20T12:00:00.000Z"
}
```

This works with Zapier Webhooks, Make (Integromat) HTTP modules, n8n webhook nodes, or your own API endpoint.

### Supported Platforms

The price extraction engine handles:

- **Shopify** stores (all themes)
- **Amazon** product pages
- **eBay** listings
- **Walmart** product pages
- **WooCommerce** stores
- **BigCommerce** stores
- **Target** product pages
- **Any site with structured data** (JSON-LD, Open Graph, microdata)
- **Any site with standard price CSS classes**

### Price History

Price history is persisted across runs in the Apify Key-Value Store (`price-tracker-state`). Each product keeps up to 30 data points. The latest summary is available at the `latest-summary` key.

### Tips

- Start with a small list of URLs to verify price extraction works for your target sites
- Use the `alertThresholdPercent` to avoid noise from tiny price fluctuations (e.g., set to 5 for 5% threshold)
- Schedule runs every 4-12 hours for a good balance of freshness vs. compute cost
- The first run will mark all products as `new_product` since there is no history yet
- Use Apify Proxy for better reliability, especially with Amazon and Walmart

***

### Run on Apify

This scraper runs on the [Apify platform](https://apify.com/?fpr=lulzasaur) — a full-stack web scraping and automation cloud. Sign up for a free account to get started with 30-day trial of all features.

[Try Apify free →](https://apify.com/?fpr=lulzasaur)

# Actor input Schema

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

List of product URLs to track. Each item needs a 'url' field. Optional: 'name' (friendly label) and 'expectedPrice' (alert if price differs).

## `discordWebhookUrl` (type: `string`):

Discord webhook URL for price change alerts. Create one in Discord: Server Settings > Integrations > Webhooks.

## `webhookUrl` (type: `string`):

Custom webhook URL to POST price change alerts as JSON.

## `emailTo` (type: `string`):

Email address for price change notifications (stored in Key-Value Store for external email service).

## `alertOnIncrease` (type: `boolean`):

Send alerts when prices go up (not just down).

## `alertThresholdPercent` (type: `number`):

Minimum percentage change to trigger an alert. Set to 0 to alert on any change.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://example.com/product",
      "name": "Example Product"
    }
  ],
  "alertOnIncrease": true,
  "alertThresholdPercent": 0
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        {
            "url": "https://example.com/product",
            "name": "Example Product"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lulzasaur/price-tracker").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": [{
            "url": "https://example.com/product",
            "name": "Example Product",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("lulzasaur/price-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    {
      "url": "https://example.com/product",
      "name": "Example Product"
    }
  ]
}' |
apify call lulzasaur/price-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lulzasaur/price-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Competitor Price Tracker - Monitor Any Product URL",
        "description": "Track competitor prices on any e-commerce site. Monitor Shopify, Amazon, eBay, Walmart, and custom stores. Get instant alerts on price drops, increases, and stock changes. Perfect for small businesses doing competitive pricing.",
        "version": "1.0",
        "x-build-id": "NiEPZy3Gjd9aUsuMp"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lulzasaur~price-tracker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lulzasaur-price-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/lulzasaur~price-tracker/runs": {
            "post": {
                "operationId": "runs-sync-lulzasaur-price-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/lulzasaur~price-tracker/run-sync": {
            "post": {
                "operationId": "run-sync-lulzasaur-price-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "Product URLs to Monitor",
                        "type": "array",
                        "description": "List of product URLs to track. Each item needs a 'url' field. Optional: 'name' (friendly label) and 'expectedPrice' (alert if price differs).",
                        "default": [
                            {
                                "url": "https://example.com/product",
                                "name": "Example Product"
                            }
                        ]
                    },
                    "discordWebhookUrl": {
                        "title": "Discord Webhook URL",
                        "type": "string",
                        "description": "Discord webhook URL for price change alerts. Create one in Discord: Server Settings > Integrations > Webhooks."
                    },
                    "webhookUrl": {
                        "title": "Custom Webhook URL",
                        "type": "string",
                        "description": "Custom webhook URL to POST price change alerts as JSON."
                    },
                    "emailTo": {
                        "title": "Email Address",
                        "type": "string",
                        "description": "Email address for price change notifications (stored in Key-Value Store for external email service)."
                    },
                    "alertOnIncrease": {
                        "title": "Alert on Price Increase",
                        "type": "boolean",
                        "description": "Send alerts when prices go up (not just down).",
                        "default": true
                    },
                    "alertThresholdPercent": {
                        "title": "Alert Threshold (%)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Minimum percentage change to trigger an alert. Set to 0 to alert on any change.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
