# Walmart Scraper — Products, Prices & Price-Drop Monitoring (`commanding_hotdog/walmart-scraper`) Actor

Walmart scraper and price tracker: products, prices, ratings and stock. Only-changes mode returns just price drops, so you pay only for updates.

- **URL**: https://apify.com/commanding_hotdog/walmart-scraper.md
- **Developed by:** [qingwa](https://apify.com/commanding_hotdog) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Walmart Scraper — Products, Prices & Price-Drop Monitoring

Track Walmart prices daily and pay only when something actually changes. Keyword search plus an `onlyChanges` monitor mode — all in one Actor, with built-in residential proxies. No proxy setup, no API key, no browser.

Walmart blocks datacenter IPs with a "Robot or human?" challenge. This Actor routes every request through residential IPs, so it works where a plain HTTP scraper dies.

### What it does

- **Search** — keyword search returns product listings: title, price, original price, rating, review count, seller, image, product URL, rank, sponsored flag.
- **onlyChanges monitoring** — give it your keywords (and optionally the exact products to watch), schedule it daily, and each run returns *only* the products whose price or stock changed (price drop, price up, back in stock, out of stock, or brand-new). Unchanged products are skipped and **never billed**.
- **Watch specific products** — paste product URLs in `productUrls` and the results are filtered to those item IDs. Give the keywords that surface them (usually the product name). Products that don't appear in the search results are listed in the run's `OUTPUT` as `watchedNotFound` instead of failing silently.

### Daily monitor setup

1. Put your keywords in `searchKeywords` (e.g. `["Monster Open Flex Earbuds"]`).
2. Optionally paste the exact product URLs in `productUrls` to watch only those items.
3. Turn on `onlyChanges`.
4. Schedule the Actor to run once a day (Apify → Schedules).
5. Each morning you get a short dataset: only the products that moved.

The price snapshot lives in a named key-value store (`stateStoreName`, default `walmart-monitor-state`) and is maintained on **every** run — so a full run between monitor runs never causes the same products to be reported twice. Use a different store name per list if you monitor several lists.

### Pricing

| Event | Price |
|---|---|
| `listing` (per search result) | $0.002 |
| `detail` (per changed product in onlyChanges mode) | $0.003 |
| Actor Start | $0.00005 |

The first 20 items of every run are free. Unchanged products in `onlyChanges` mode are never charged.

### Input

| Field | Description |
|---|---|
| `searchKeywords` | Keywords to search, e.g. `["wireless headphones", "lego"]` |
| `productUrls` | Optional filter: product URLs (`https://www.walmart.com/ip/...`) or bare item IDs — only matching listings are returned |
| `maxPagesPerSearch` | Search pages per keyword (1–10, default 3) |
| `maxResults` | Max items per run (default 200) |
| `onlyChanges` | Monitor mode: return only changed products |
| `stateStoreName` | Snapshot store name (default `walmart-monitor-state`) |
| `requestConcurrency` | Parallel requests (1–5, default 3) |

### Output

Dataset rows have `itemType` `listing` or `change`. Change rows add `changeType` (`PRICE_DROP`, `PRICE_UP`, `BACK_IN_STOCK`, `OUT_OF_STOCK`, `NEW`), `previousPrice`, and `priceChange`. The run's `OUTPUT` record reports `itemsPushed`, `skippedUnchanged`, `blockedRequests`, `parseErrors`, and `watchedNotFound`.

### Honest limitation

Everything runs through Walmart search. Walmart's product pages (`/ip/`) challenge even residential IPs, so this Actor does not fetch them — product data comes from search results, which carry title, price, rating, review count, seller, and availability. If you need full descriptions or specifications, use a product-page scraper; for price tracking, search has everything that matters.

### Use cases

- **Dropshipping** — watch your sourced products daily; catch a price rise before it eats your margin.
- **Competitive pricing** — track rivals' Walmart listings and react to their moves.
- **MAP enforcement** — check that resellers stay above your minimum advertised price.
- **Deal hunting** — run `onlyChanges` on a watchlist and get alerted on price drops.

### Notes

- Prices are US online prices (walmart.com). Store/zip-level pricing is not supported.
- Search results are paginated; Walmart caps visible pagination, so split broad keywords with filters if you need full coverage.
- If a page returns no items, the run logs diagnostics (which embedded data blocks were present) instead of failing silently.

# Actor input Schema

## `maxPagesPerSearch` (type: `integer`):

How many search result pages to fetch per keyword (1-10).

## `maxResults` (type: `integer`):

Maximum items to return in one run.

## `onlyChanges` (type: `boolean`):

Monitor mode. Compares price and availability with the previous run and returns only products that changed (price up/down, back in stock, out of stock, or new). Unchanged products are skipped and never billed. The price snapshot is kept in stateStoreName and updated on every run.

## `productUrls` (type: `array`):

Optional filter: Walmart product URLs (https://www.walmart.com/ip/...) or bare item IDs. Only search results matching these items are returned. Give the keywords in searchKeywords that surface them (usually the product name). Products not found in the search results are listed in the run OUTPUT as watchedNotFound.

## `requestConcurrency` (type: `integer`):

How many requests run in parallel (1-5).

## `searchKeywords` (type: `array`):

Keywords to search on Walmart, e.g. \["wireless headphones", "lego"]. Each keyword returns product listings; in onlyChanges mode the same keywords are re-searched every run and only price/stock changes are returned.

## `stateStoreName` (type: `string`):

Named key-value store holding the price snapshot for onlyChanges. Use a different name per monitored list so histories do not mix.

## Actor input object example

```json
{
  "maxPagesPerSearch": 3,
  "maxResults": 200,
  "onlyChanges": false,
  "productUrls": [],
  "requestConcurrency": 3,
  "searchKeywords": [
    "wireless headphones"
  ],
  "stateStoreName": "walmart-monitor-state"
}
```

# 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 = {
    "maxPagesPerSearch": 3,
    "maxResults": 200,
    "productUrls": [],
    "requestConcurrency": 3,
    "searchKeywords": [
        "wireless headphones"
    ],
    "stateStoreName": "walmart-monitor-state"
};

// Run the Actor and wait for it to finish
const run = await client.actor("commanding_hotdog/walmart-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 = {
    "maxPagesPerSearch": 3,
    "maxResults": 200,
    "productUrls": [],
    "requestConcurrency": 3,
    "searchKeywords": ["wireless headphones"],
    "stateStoreName": "walmart-monitor-state",
}

# Run the Actor and wait for it to finish
run = client.actor("commanding_hotdog/walmart-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 '{
  "maxPagesPerSearch": 3,
  "maxResults": 200,
  "productUrls": [],
  "requestConcurrency": 3,
  "searchKeywords": [
    "wireless headphones"
  ],
  "stateStoreName": "walmart-monitor-state"
}' |
apify call commanding_hotdog/walmart-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,commanding_hotdog/walmart-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/M5YFS7k28cBk1k1Q9/builds/n4WErMSRcTdsKgehZ/openapi.json
