# Price Comparison Scraper (`credible_sandal/price-comparison-scraper`) Actor

The Price Comparison Scraper searches top online retailers all at once to save you time and money.
Type in any product name, and it will instantly compare prices from Amazon, Walmart, Target, and eBay with helpful insights.

- **URL**: https://apify.com/credible_sandal/price-comparison-scraper.md
- **Developed by:** [RK K](https://apify.com/credible_sandal) (community)
- **Categories:** E-commerce, Other
- **Stats:** 33 total users, 4 monthly users, 56.9% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.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

## Price Comparison Scraper

Compare prices across 7 major retailers: Amazon, Walmart, Best Buy, Target, eBay, Newegg, and Costco to find the best deals.

### Features

- **📋 Watchlist Monitoring** - Track multiple products with target prices and get alerts when they hit your target ⭐ NEW!
- **🔥 Historical Price Tracking** - Automatically tracks prices over time to detect all-time lows
- **📊 Smart Deal Scoring (0-100)** - AI-powered analysis rates each deal with historical context
- **🎯 Intelligent Recommendations** - Get clear BUY NOW, STRONG BUY, GOOD DEAL, CONSIDER, or WAIT advice
- **📈 Price Trend Analysis** - See if prices are rising, falling, or stable
- **💰 All-Time Low Detection** - Get alerted when products hit their lowest price ever
- **🔔 Discord Price Alerts** - Get instant notifications on price drops via Discord webhooks
- **🛒 Multi-Platform Search** - Scrapes 7 major e-commerce sites in parallel
- **📉 Historical Averages** - Compare current prices to 7-day, 30-day, and all-time averages
- **⚡ Fast Execution** - Results in 15-25 seconds
- **🔒 Reliable Scraping** - Residential proxy support for consistent results

### Input Configuration

#### Basic Search

```json
{
  "product_name": "wireless mouse",
  "max_results_per_site": 2,
  "sites": ["amazon", "walmart", "bestbuy"],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "timeout": 20
}
```

#### With Discord Price Alerts

```json
{
  "product_name": "Sony WH-1000XM5",
  "max_results_per_site": 3,
  "sites": ["amazon", "walmart", "bestbuy", "target", "newegg"],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "enable_alerts": true,
  "discord_webhook_url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN",
  "alert_threshold_percentage": 5.0,
  "alert_on_all_time_low": true,
  "send_test_notification": false
}
```

#### Watchlist Monitoring Mode ⭐ NEW!

```json
{
  "mode": "monitor",
  "max_results_per_site": 2,
  "sites": ["amazon", "walmart", "bestbuy"],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "watchlist": [
    {
      "product_name": "iPhone 15 Pro",
      "target_price": 999.99,
      "stores": ["amazon", "bestbuy"],
      "enabled": true
    },
    {
      "product_name": "Sony WH-1000XM5",
      "target_price": 299.99,
      "enabled": true
    },
    {
      "product_name": "MacBook Air M2",
      "target_price": 1099.00,
      "stores": ["amazon", "bestbuy", "walmart"],
      "enabled": true
    }
  ],
  "enable_alerts": true,
  "discord_webhook_url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN"
}
```

#### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| **`mode`** ⭐ | string | No | search | Operating mode: `search` (one-time) or `monitor` (watchlist) |
| `product_name` | string | If search mode | - | Product to search for (2-200 chars) |
| `max_results_per_site` | integer | No | 5 | Results per site (1-20) |
| `sites` | array | No | amazon, walmart, bestbuy | Sites to scrape: `amazon`, `walmart`, `bestbuy`, `target`, `newegg` |
| `proxy` | object | Recommended | Apify proxy | Proxy configuration (required on Apify) |
| `timeout` | integer | No | 30 | Timeout per site in seconds (10-120) |
| **`watchlist`** ⭐ | array | If monitor mode | - | Array of products to monitor with optional target prices |
| **`watchlist_id`** ⭐ | string | Alternative to watchlist | - | Load saved watchlist from storage by ID |
| **`enable_alerts`** | boolean | No | false | Enable Discord price drop alerts |
| **`discord_webhook_url`** | string | If alerts enabled | - | Discord webhook URL for notifications |
| **`alert_threshold_percentage`** | float | No | 5.0 | Minimum price drop % to trigger alert (1-50) |
| **`alert_on_all_time_low`** | boolean | No | true | Send special alerts for all-time low prices |
| **`send_test_notification`** | boolean | No | false | Send test notification to verify webhook |

### Output

The actor returns a comprehensive comparison with:

#### Smart Recommendations

- **Best Overall Deal** - Top-rated deal based on comprehensive scoring (Score: 0-100)
- **Top Deals** - Top 5 products ranked by deal quality
- **Deal Analysis** - Overall market assessment and insights

#### Each Product Includes

- **Deal Score (0-100)** - Intelligent rating based on:
  - Price competitiveness vs. current market (30%)
  - Discount percentage (25%)
  - Seller reputation (20%)
  - **Historical price context (15%)** ⭐ NEW!
  - Shipping cost (5%)
  - Product rating (5%)
- **Recommendation** - Clear action: BUY NOW 🔥, STRONG BUY ✅, GOOD DEAL 👍, CONSIDER ⚖️, or WAIT ⏳
- **Reason** - Explanation of why it's a good or bad deal
- **Historical Insights** - Price trends, all-time lows, and historical context

#### Traditional Metrics

- **Lowest price** - Cheapest option found
- **Best value** - Best price including shipping
- **Best rated** - Highest rated product
- **Best discount** - Biggest savings
- **Price range** - Min, max, and average prices
- **Results by store** - All products organized by site with average scores

### Example Output

#### After 2 Weeks (With History)

```
🏆 BEST OVERALL DEAL (Score: 95/100)
   🔥 BUY NOW
   🎯 Confidence: HIGH
   Store: amazon
   Price: $89.99
   ✓ FREE SHIPPING
   Product: Wireless Mouse - Gaming Edition
   Reason: Excellent deal - ALL-TIME LOW, 55% off, Prime eligible, 18% below 30-day avg

   📊 Historical Context:
      • 🔥 ALL-TIME LOW! ($89.99)
      • 📉 Price trending down
      • 📊 Tracked for 14 days (42 checks)

📊 DEAL ANALYSIS
Overall: Excellent deals available
Average Deal Score: 81.2/100
Insights: 2 excellent deals found, Most options are good values

🎯 TOP DEALS:
   #1. amazon: $89.99 (Score: 95/100 - BUY NOW) 🔥 ALL-TIME LOW
   #2. walmart: $94.99 (Score: 85/100 - STRONG BUY)
   #3. target: $99.99 (Score: 78/100 - GOOD DEAL)

📊 HISTORICAL TRACKING:
   Products tracked: 8/8
   🔥 All-time lows found: 1
   • amazon: Tracked 14 days
     🔥 ALL-TIME LOW: $89.99
   • walmart: Tracked 7 days
     Low: $89.99 | High: $129.99
```

#### First Run (No History Yet)

```
🏆 BEST OVERALL DEAL (Score: 85/100)
   ✅ STRONG BUY
   ⚠️ Confidence: LOW
   Store: amazon
   Price: $89.99
   Product: Wireless Mouse
   Reason: Very good deal - lowest price available, Prime eligible

   ℹ️  CONFIDENCE NOTE:
      First time tracking - recommendation based on current market only.
      Run again tomorrow to build price history for more confident analysis.

⚠️  FIRST RUN - BUILDING PRICE HISTORY
======================================================================
This is the first time tracking these products.
Recommendations are based on TODAY'S market comparison only.

💡 TO GET CONFIDENT RECOMMENDATIONS:
   • Run this search again tomorrow
   • After 3-7 days: Detect trends and all-time lows
   • After 2 weeks: Highly confident 'BUY NOW' signals

Price history will build automatically with each run.
======================================================================
```

### Recommended Configurations

#### Quick Search (15-20 seconds)

```json
{
  "product_name": "your product",
  "max_results_per_site": 2,
  "sites": ["amazon", "walmart", "bestbuy"],
  "proxy": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]},
  "timeout": 20
}
```

#### Complete Comparison (25-35 seconds)

```json
{
  "product_name": "your product",
  "max_results_per_site": 3,
  "sites": ["amazon", "walmart", "bestbuy", "target", "ebay", "newegg", "costco"],
  "proxy": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]},
  "timeout": 30
}
```

#### Electronics Focus (20-25 seconds)

```json
{
  "product_name": "gaming laptop",
  "max_results_per_site": 3,
  "sites": ["bestbuy", "newegg", "amazon", "walmart"],
  "proxy": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]},
  "timeout": 25
}
```

### Deal Score Guide

- **90-100** 🔥 - **BUY NOW** - Excellent deal, buy immediately
  - Often includes all-time lows or near-record prices
  - Significant discounts + competitive pricing
  - Historical data shows this is exceptional value
- **75-89** ✅ - **STRONG BUY** - Very good deal, strong buy recommendation
  - Below average historical pricing
  - Good combination of price and quality
- **60-74** 👍 - **GOOD DEAL** - Fair price, reasonable value
  - Around historical average or slightly below
  - Acceptable but not exceptional
- **40-59** ⚖️ - **CONSIDER** - Consider alternatives, not the best value
  - Above historical average
  - May want to wait for better prices
- **0-39** ⏳ - **WAIT** - Poor value, wait for better deal
  - Significantly above historical averages
  - Better deals likely coming soon

### Confidence Levels

Each recommendation includes a confidence level based on available historical data:

| Confidence | Meaning | Days Tracked | What to Do |
|------------|---------|--------------|------------|
| **⚠️ LOW** | First time tracking | 0 days | Run again tomorrow to start building history |
| **📊 MODERATE** | Building history | 1-2 days | Check back in a few days for trends |
| **✅ GOOD** | Patterns emerging | 3-6 days | One more week for high confidence |
| **🎯 HIGH** | Rich historical data | 7+ days | Confident recommendations with verified trends |

**Note:** Recommendations with LOW confidence are based on current market comparison only and don't yet have historical context. Higher confidence = more reliable "BUY NOW" signals.

### Historical Price Tracking

The actor automatically tracks price history for products you search. The more you use it, the smarter it gets!

#### How It Works

1. **First Run** - Creates price history, gives neutral historical score (50/100)
2. **Subsequent Runs** - Compares to history, detects trends, identifies all-time lows
3. **Continuous Improvement** - Keeps last 90 days of data for accurate analysis

#### Historical Insights Provided

- 🔥 **All-Time Low Detection** - "This is the best price ever!"
- 📉 **Price Trends** - Rising, falling, or stable
- 📊 **Historical Averages** - 7-day, 30-day, and all-time averages
- 💰 **Comparison** - How current price compares to history
- ⚡ **Volatility** - Price stability indicators

#### Storage

- Uses Apify Key-Value Store (included, no extra cost)
- Automatically managed - no configuration needed
- Keeps last 90 days of price snapshots
- Minimal storage footprint (~1KB per product)

### Discord Price Alerts ⭐ NEW!

Get instant notifications when prices drop! The actor can send beautiful Discord notifications with rich formatting when it detects price drops or all-time lows.

#### Setup Discord Webhook (2 minutes)

1. **Open Discord** and go to your desired server/channel
2. **Click the gear icon** next to the channel name → Integrations
3. **Click "Create Webhook"** or "View Webhooks" → "New Webhook"
4. **Name it** (e.g., "Price Alerts") and optionally set an icon
5. **Copy the Webhook URL** (looks like: `https://discord.com/api/webhooks/...`)
6. **Paste the URL** into the `discord_webhook_url` input parameter

#### How It Works

The actor will:

- ✅ Compare current prices to historical averages (7-day, 30-day)
- ✅ Send Discord alert if price drops below your threshold (default: 5%)
- ✅ Send special alerts for all-time low prices
- ✅ Include deal score, historical context, and recommendation
- ✅ Show product image, rating, and direct purchase link

#### Alert Features

**Price Drop Alerts:**

- Triggered when price drops by X% compared to historical average
- Customizable threshold (1-50%)
- Shows old vs. new price, percentage savings
- Includes historical context (vs. 30-day average, trend, etc.)

**All-Time Low Alerts:**

- Special notification when product hits lowest price ever
- Highlighted with 🔥 emoji for urgency
- Shows savings vs. all-time high and 30-day average

**Rich Formatting:**

- Color-coded embeds (red = hot deal, orange = good deal, blue = moderate)
- Product image thumbnail
- Star ratings and review counts
- Direct "Buy Now" links
- Historical trend indicators

#### Example Discord Alert

```
🔥 PRICE DROP ALERT! (-12.3%)

💰 Sony WH-1000XM5 Headphones
$349.99 → $306.99 (-$43.00)

Store: Amazon
✅ Prime Eligible
💰 Original Discount: 13% off
⭐⭐⭐⭐⭐ 4.7/5 (3,421 reviews)

📊 Historical Context:
🔥 ALL-TIME LOW!
📉 12% below 30-day average
📉 Trend: Falling

✅ STRONG BUY (Score: 92/100)
Excellent deal - ALL-TIME LOW, Prime eligible, 12% below 30-day avg

Price Comparison Scraper • Tracking for 14 days
```

#### Test Your Webhook

Set `send_test_notification: true` to send a test message and verify your webhook is working:

```json
{
  "product_name": "wireless mouse",
  "enable_alerts": true,
  "discord_webhook_url": "https://discord.com/api/webhooks/...",
  "send_test_notification": true
}
```

You'll receive a confirmation message in Discord showing that alerts are active.

#### Use Cases

**1. Monitor Specific Products Daily**

- Schedule the actor to run daily via Apify Scheduler
- Get alerts when tracked products drop in price
- Perfect for wishlist items or products you're waiting to buy

**2. Track Competitor Pricing**

- Monitor competitor products
- Get alerts when they change prices
- React quickly to market changes

**3. Deal Hunting**

- Search for products you're interested in
- Get alerted to all-time lows
- Never miss the best deals

#### Cost

Discord webhooks are **100% FREE** with unlimited messages. No additional costs beyond normal actor usage.

### Watchlist Monitoring ⭐ NEW!

Track multiple products simultaneously and get alerted when they hit your target prices! Perfect for monitoring wishlists, building a deal-hunting strategy, or tracking competitor pricing.

#### How It Works

Instead of searching for one product at a time, watchlist mode lets you monitor multiple products in a single run:

1. **Set mode to "monitor"** in the input configuration
2. **Provide a watchlist** - either directly in the input or load from storage
3. **Set target prices** (optional) for each product
4. **Enable Discord alerts** to get notified when products hit your targets
5. **Schedule it** to run daily and never miss a deal!

#### Watchlist Structure

Each watchlist item can have:

```json
{
  "product_name": "iPhone 15 Pro",           // Required: product to search for
  "target_price": 999.99,                     // Optional: alert when price hits this
  "stores": ["amazon", "bestbuy"],            // Optional: specific stores (uses default if omitted)
  "enabled": true                             // Optional: whether to monitor (default: true)
}
```

#### Example: Daily Deal Monitoring

```json
{
  "mode": "monitor",
  "max_results_per_site": 2,
  "sites": ["amazon", "walmart", "bestbuy"],
  "watchlist": [
    {
      "product_name": "iPhone 15 Pro 256GB",
      "target_price": 1099.00,
      "stores": ["amazon", "bestbuy"],
      "enabled": true
    },
    {
      "product_name": "Sony WH-1000XM5",
      "target_price": 299.99,
      "enabled": true
    },
    {
      "product_name": "Apple AirPods Pro 2",
      "target_price": 199.99,
      "stores": ["amazon", "walmart", "target"],
      "enabled": true
    }
  ],
  "enable_alerts": true,
  "discord_webhook_url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_TOKEN",
  "alert_threshold_percentage": 5.0,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

#### Target Price Alerts

When a product's price drops to or below your target price, you'll receive a special Discord notification:

```
🎯 TARGET PRICE HIT! Your target of $299.99 was reached!

🎯 TARGET PRICE: Sony WH-1000XM5
✅ Your target price of $299.99 was reached!

Current Price: $289.99
You're saving: $10.00 (3% below target)

Store: Amazon
✅ Prime Eligible
⭐⭐⭐⭐⭐ 4.8/5 (5,234 reviews)

📊 Historical Context:
🔥 This is an ALL-TIME LOW!
📉 $15.00 below 30-day average (5%)
📅 Tracked for 21 days

✅ STRONG BUY (Score: 94/100)
Excellent deal - TARGET PRICE HIT, ALL-TIME LOW, Prime eligible
```

#### Saving and Loading Watchlists

You can save watchlists to Apify storage and reuse them:

**Option 1: Provide watchlist directly** (shown above)

**Option 2: Load from storage by ID**

```json
{
  "mode": "monitor",
  "watchlist_id": "my-tech-wishlist",
  "enable_alerts": true,
  "discord_webhook_url": "https://discord.com/api/webhooks/...",
  "proxy": {"useApifyProxy": true}
}
```

Watchlists are automatically saved to Apify Key-Value Store (free, included with all Apify accounts).

#### Use Cases

**1. Personal Wishlist Monitoring**

- Track 5-10 products you want to buy
- Set target prices for each
- Get alerted when any hit your target
- Schedule daily runs

**2. Deal Hunter Strategy**

- Monitor popular products across categories
- Use historical tracking to identify patterns
- Get notified of all-time lows
- Build a reputation for finding the best deals

**3. Price Match Guarantee Tracking**

- Monitor products you recently purchased
- Get alerts if prices drop below what you paid
- Take advantage of price match policies within 30 days
- Schedule runs every 3 days

**4. Competitor Price Intelligence**

- Track competitor products
- Monitor pricing strategies
- React to market changes
- Schedule hourly runs during sales events

#### Scheduling Watchlist Monitoring

To get the most value from watchlist monitoring, schedule it to run automatically:

1. Go to your Apify Actor → **Schedules** tab
2. Click **Create Schedule**
3. Set frequency: Daily at midnight (or custom)
4. Input: Your watchlist configuration
5. Enable notifications: Discord alerts ON

**Recommended frequencies:**

- **Daily**: Personal wishlists (low urgency)
- **Every 6 hours**: Active deal hunting (medium urgency)
- **Hourly**: Competitor tracking or flash sales (high urgency)

**Cost optimization:**

- Use fewer results per site (e.g., `max_results_per_site: 1-2`)
- Monitor fewer stores per product
- Disable items you're no longer interested in (`enabled: false`)

#### Monitoring Output

In monitor mode, you'll get:

```
======================================================================
WATCHLIST MONITORING COMPLETE
======================================================================
Products monitored: 3
🎯 Target price hits: 1
   • Sony WH-1000XM5: $289.99 (target: $299.99)

Total results: 18
Sites searched: 3
Sites succeeded: 3
Success rate: 100.0%
```

All results are saved to the dataset, including:

- All products found for each watchlist item
- Deal scores and recommendations
- Historical tracking data
- Target price hit indicators

### Proxy Configuration

**IMPORTANT:** Residential proxy is strongly recommended when running on Apify platform. E-commerce sites block datacenter IPs.

```json
{
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

# Actor input Schema

## `mode` (type: `string`):

Operating mode: 'search' for one-time search, 'monitor' for watchlist monitoring

## `product_name` (type: `string`):

Product name or search query (required in 'search' mode, ignored in 'monitor' mode)

## `max_results_per_site` (type: `integer`):

Maximum number of products to scrape from each site

## `sites` (type: `array`):

Select retailers to search. Recommended: amazon, walmart, bestbuy, target, newegg. Note: eBay and Costco are unstable and may have lower success rates.

## `proxy` (type: `object`):

Proxy settings (recommended to use Apify proxy to avoid blocking)

## `timeout` (type: `integer`):

Page load timeout in seconds

## `use_fast_mode` (type: `boolean`):

Enable fast mode (extract from search results only, don't visit product pages)

## `include_shipping` (type: `boolean`):

Include shipping costs in price comparison

## `enable_alerts` (type: `boolean`):

Get instant Discord notifications when prices drop below your threshold or hit all-time lows (100% FREE)

## `discord_webhook_url` (type: `string`):

Your Discord webhook URL for receiving price alerts. To create: Open Discord → Channel Settings → Integrations → Webhooks → New Webhook → Copy Webhook URL

## `alert_threshold_percentage` (type: `number`):

Minimum price drop percentage to trigger an alert (e.g., 5 = alert on 5%+ price drops)

## `alert_on_all_time_low` (type: `boolean`):

Send special alerts when products hit their lowest price ever (recommended)

## `send_test_notification` (type: `boolean`):

Send a test message to your Discord channel to verify the webhook is working

## `watchlist` (type: `array`):

List of products to monitor (only used in 'monitor' mode). Each item should have product_name, optional target_price, and optional stores array

## `watchlist_id` (type: `string`):

Load a previously saved watchlist from Apify Key-Value Store by ID (alternative to providing watchlist array directly). Only used in 'monitor' mode. If both watchlist and watchlist_id are provided, watchlist takes precedence.

## Actor input object example

```json
{
  "mode": "search",
  "product_name": "wireless mouse",
  "max_results_per_site": 3,
  "sites": [
    "amazon",
    "walmart",
    "bestbuy"
  ],
  "proxy": {
    "useApifyProxy": true
  },
  "timeout": 30,
  "use_fast_mode": false,
  "include_shipping": true,
  "enable_alerts": false,
  "discord_webhook_url": "https://discord.com/api/webhooks/123456789/abcdefghijklmnop",
  "alert_threshold_percentage": 5,
  "alert_on_all_time_low": true,
  "send_test_notification": false,
  "watchlist": [
    {
      "product_name": "iPhone 15 Pro",
      "target_price": 999.99,
      "stores": [
        "amazon",
        "bestbuy"
      ],
      "enabled": true
    },
    {
      "product_name": "Sony WH-1000XM5",
      "target_price": 299.99,
      "enabled": true
    }
  ],
  "watchlist_id": "my-tech-wishlist"
}
```

# 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 = {
    "mode": "search",
    "product_name": "wireless mouse",
    "max_results_per_site": 3,
    "sites": [
        "amazon",
        "walmart",
        "bestbuy"
    ],
    "proxy": {
        "useApifyProxy": true
    },
    "timeout": 30,
    "use_fast_mode": false,
    "include_shipping": true,
    "enable_alerts": false,
    "alert_threshold_percentage": 5,
    "alert_on_all_time_low": true,
    "send_test_notification": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("credible_sandal/price-comparison-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 = {
    "mode": "search",
    "product_name": "wireless mouse",
    "max_results_per_site": 3,
    "sites": [
        "amazon",
        "walmart",
        "bestbuy",
    ],
    "proxy": { "useApifyProxy": True },
    "timeout": 30,
    "use_fast_mode": False,
    "include_shipping": True,
    "enable_alerts": False,
    "alert_threshold_percentage": 5,
    "alert_on_all_time_low": True,
    "send_test_notification": False,
}

# Run the Actor and wait for it to finish
run = client.actor("credible_sandal/price-comparison-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 '{
  "mode": "search",
  "product_name": "wireless mouse",
  "max_results_per_site": 3,
  "sites": [
    "amazon",
    "walmart",
    "bestbuy"
  ],
  "proxy": {
    "useApifyProxy": true
  },
  "timeout": 30,
  "use_fast_mode": false,
  "include_shipping": true,
  "enable_alerts": false,
  "alert_threshold_percentage": 5,
  "alert_on_all_time_low": true,
  "send_test_notification": false
}' |
apify call credible_sandal/price-comparison-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,credible_sandal/price-comparison-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/ulrQlHYL6U8HdvArI/builds/uRnvaZzkdlKzQQ5D1/openapi.json
