# 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
- **Features:** Limited permissions
- **Stats:** 6 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/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 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(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 '{
  "urls": [
    {
      "url": "https://example.com/product",
      "name": "Example Product"
    }
  ]
}' |
apify call lulzasaur/price-tracker --silent --output-dataset

```

## MCP server setup

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

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/wtSyRQqyngOKtiBJZ/builds/NiEPZy3Gjd9aUsuMp/openapi.json
