# Walmart Product, Price and Review Data Scraper (`khadinakbar/walmart-data-extractor`) Actor

Extract Walmart products from keyword searches, product URLs, or item IDs. Receive prices, availability, sellers, ratings, variants, specifications, images, and optional review records for retail research and monitoring.

- **URL**: https://apify.com/khadinakbar/walmart-data-extractor.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** E-commerce, MCP servers, Automation
- **Stats:** 9 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 product extracteds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Walmart Product, Price and Review Data Scraper

Extract structured Walmart product data from keyword searches, direct product URLs, or item IDs. The Actor returns prices, availability, sellers, ratings, product details, images, and optional customer review records in an analysis-ready dataset.

Use the output for retail research, catalog enrichment, assortment tracking, seller analysis, shopping applications, and AI workflows that need current public Walmart product information.

### Best fit

- Retail analysts comparing product assortment, pricing, and availability.
- Marketplace sellers researching competing listings and seller participation.
- Brand teams organizing ratings and review text for qualitative analysis.
- Data teams enriching catalogs from Walmart product URLs or item IDs.
- AI shopping and research agents that need structured product evidence.

### A practical research scenario

A retail analyst starts with a search for wireless headphones and collects product cards with prices, ratings, stock signals, and sellers. The analyst then sends selected product URLs through detail mode to add variants, specifications, images, and descriptions. Review extraction can add the customer language behind each rating, giving the final dataset both market signals and product-level context.

This sequence keeps discovery broad and enrichment focused while preserving a stable `itemId` for joining records.

### Input and quick start

#### Search Walmart products

```json
{
  "mode": "search",
  "searchQuery": "wireless headphones",
  "maxProducts": 20,
  "sortBy": "bestMatch"
}
```

#### Enrich product URLs

```json
{
  "mode": "productUrls",
  "productUrls": [
    "https://www.walmart.com/ip/JLab-Studio-2-Wireless-Headphones/13544111159"
  ],
  "includeVariants": true,
  "includeSpecifications": true,
  "includeReviews": true,
  "maxReviewsPerProduct": 10
}
```

#### Resolve Walmart item IDs

```json
{
  "mode": "itemIds",
  "itemIds": ["13544111159", "741224561"],
  "maxProducts": 10
}
```

### Input reference

| Field | Purpose |
| --- | --- |
| `mode` | Selects `search`, `productUrls`, or `itemIds`. |
| `searchQuery` | Keyword used in search mode. |
| `productUrls` | Walmart product detail URLs for full enrichment. |
| `itemIds` | Walmart numeric item identifiers. |
| `maxProducts` | Upper bound for product records. |
| `includeReviews` | Adds customer review rows to the dataset. |
| `maxReviewsPerProduct` | Upper bound for reviews associated with each product. |
| `includeVariants` | Includes available product configurations. |
| `includeSpecifications` | Includes the product specification map. |
| `minPrice`, `maxPrice` | Applies a price range to discovered products. |
| `brands` | Keeps products matching the selected brands. |
| `minRating` | Applies a minimum displayed rating. |
| `sortBy` | Uses the supported Walmart result-ordering options. |
| `proxyConfiguration` | Controls the US browsing network used for Walmart pages. |

### Output data

Product records can include:

- `itemId`, `productUrl`, `title`, `brand`, `model`, and `category`
- `currentPrice`, `listPrice`, `savings`, `currency`, and `onSale`
- `rating`, `reviewCount`, `inStock`, `sellerName`, and `sellerType`
- `pickupAvailable`, `shippingAvailable`, and `freeShipping`
- `images`, `variants`, `specifications`, `breadcrumbs`, and `badges`
- `scrapeSource` and `scrapedAt` for provenance

Review rows use `_type: "review"` and can include the parent `itemId`, review text, rating, author, purchase verification, community votes, photos, pros, cons, and submission time.

```json
{
  "itemId": "13544111159",
  "title": "JLab Studio 2 Wireless Headphones",
  "brand": "JLab",
  "currentPrice": 24.88,
  "currency": "USD",
  "rating": 4.5,
  "inStock": true,
  "sellerName": "Walmart.com",
  "scrapeSource": "product"
}
```

### AI agent workflows

The Actor works well as a focused data tool through Apify MCP or the Apify API. Its modes make intent explicit and its product and review rows have clear provenance.

Example agent request:

> Find Walmart listings for wireless headphones, return product IDs, prices, ratings, availability, and sellers, then enrich the strongest candidates with variants and specifications.

Useful routing guidance:

- Choose `search` for product discovery and comparison.
- Choose `productUrls` for richer product details and optional reviews.
- Choose `itemIds` when an upstream catalog already contains Walmart identifiers.
- Join product and review rows with `itemId`.
- Use `scrapeSource` when a workflow needs source provenance.

### Run through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~walmart-data-extractor/runs" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "search",
    "searchQuery": "wireless headphones",
    "maxProducts": 20,
    "includeReviews": false
  }'
```

The Apify token stays in the `Authorization` header. Results are available from the run's default dataset in JSON, CSV, Excel, and other supported formats.

### Data sourcing and recovery

The primary path uses Playwright with US residential sessions and extracts Walmart's structured page data. Product parsing follows multiple known page layouts for search cards, details, variants, specifications, and reviews.

When the direct path reaches its recovery threshold, the Actor can route the same search, item ID, or product URL request through its configured SerpApi Walmart provider. Recovered records follow the same caps, deduplication, dataset, and billing flow. The `scrapeSource` field distinguishes direct and provider-backed records.

### Pricing

This Actor uses Pay per event pricing with platform usage passed through. Product and optional review events are charged only when their corresponding records are written. Treat the live Pricing tab as the current source of truth for event prices and billing details.

Use `maxProducts` and `maxReviewsPerProduct` to keep each run aligned with the research brief.

### Best results

- Use search mode for discovery and product URL mode for full detail enrichment.
- Keep the default US residential proxy configuration for consistent Walmart.com product context.
- Start with a focused product cap, inspect the dataset, and expand the next run around the most useful categories or brands.
- Keep variants and specifications enabled for catalog work; use compact output options for lighter monitoring feeds.
- Use review extraction on selected products when customer language is part of the analysis.

### Builder's note

I designed this Actor around a practical two-stage retail workflow: discover many products with compact search records, then enrich a selected set with full details and reviews. The stable `itemId`, explicit record types, and `scrapeSource` field make that workflow straightforward for spreadsheets, databases, and AI agents.

### Continue the workflow

- Then use [Walmart Reviews Scraper - Ratings, Photos & Verified](https://apify.com/khadinakbar/walmart-reviews-scraper) to add Walmart engagement evidence to records selected with Walmart Product, Price and Review Data Scraper.
- Then use [Wayfair Scraper — Prices, Specs, Ratings & SKUs](https://apify.com/khadinakbar/wayfair-scraper) to extend Walmart Product, Price and Review Data Scraper with a neighboring commerce research source when the brief calls for Wayfair data.

### Responsible use

This Actor collects publicly available Walmart product and review information. Use the dataset for legitimate research and automation in line with applicable laws, platform terms, and your organization's data-governance requirements.

# Actor input Schema

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

Which extraction surface to scrape on Walmart.com. `search` runs a keyword search (returns search-card data — title, price, brand, rating, stock — for many products fast); `productUrls` fetches detail pages directly (returns full data — variants, specifications, image gallery, description — per URL); `itemIds` looks up each ID via the search engine and returns search-card data. Defaults to `search`.

## `searchQuery` (type: `string`):

Free-text query run on Walmart's search engine (e.g., 'wireless headphones', 'samsung 65 inch tv'). Required when `mode = search`. To narrow by category, append a Walmart `cat_id` filter to the URL via the `sortBy` + filters fields, or include the category name in the keyword itself.

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

Direct Walmart product detail URLs (e.g., `https://www.walmart.com/ip/JLab-Studio-2-Wireless-Headphones/13544111159`). Required when `mode = productUrls`. Each URL produces one full product record with variants, specifications, and image gallery. NOT search URLs — those use `mode = search`.

## `itemIds` (type: `array`):

Numeric Walmart item IDs (e.g., `13544111159`). Required when `mode = itemIds`. Each ID is resolved via Walmart's search engine (more reliable than the slug-less /ip/{id} URL which PerimeterX often blocks) and returned as a search-card record (title, price, brand, rating, stock, seller). For full detail with variants and specs, use `productUrls` with the canonical slug URL instead.

## `maxProducts` (type: `integer`):

Upper bound on total products written to the dataset. Higher values cost more (each product is $0.003). The example prefill is intentionally small so Apify health checks finish quickly; raise it for production runs. Hard cap 500 — for larger jobs split into multiple runs to keep cost predictable.

## `includeReviews` (type: `boolean`):

When true, each product also fetches its customer reviews and pushes them as separate records into the dataset (each tagged `_type: review`). Reviews are charged separately at $0.002 each. Off by default.

## `maxReviewsPerProduct` (type: `integer`):

Upper bound on reviews scraped per product when `includeReviews = true`. Default 20. Hard cap 200 per product — most signal lives in the first 20 reviews.

## `includeVariants` (type: `boolean`):

Include the `variants` array on product detail records (size/color/configuration options). Default true. Disable to shrink record size when variants aren't needed.

## `includeSpecifications` (type: `boolean`):

Include the `specifications` object on product detail records (manufacturer-supplied spec sheet). Default true. Disable to shrink record size when specs aren't needed.

## `minPrice` (type: `integer`):

Filter out products whose current price is below this value. Applied client-side; products without a parsed price are NOT filtered out. Omit for no lower bound.

## `maxPrice` (type: `integer`):

Filter out products whose current price is above this value. Applied client-side; products without a parsed price are NOT filtered out. Omit for no upper bound.

## `brands` (type: `array`):

Optional case-insensitive substring match against the product's brand (e.g., \['Apple', 'Samsung']). Products with a matching brand are kept; products with no brand attribute are dropped. Omit to disable brand filtering.

## `minRating` (type: `string`):

Filter out products with an average rating below this value (1.0–5.0). Products without ratings are NOT filtered. Omit to disable rating filtering.

## `sortBy` (type: `string`):

Sort order applied to search results. Ignored for `productUrls` and `itemIds` modes. `bestMatch` = Walmart's default ranking; `priceLow`/`priceHigh` = price ascending/descending; `rating` = highest-rated first; `newest` = recently added; `bestSelling` = top sellers.

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

Apify proxy configuration. Defaults to Apify Residential proxies pinned to US — required because Walmart geo-locks pricing/availability and runs Akamai + PerimeterX. Override only if you have a specific reason (e.g., your own residential pool).

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "samsung 65 inch tv",
  "maxProducts": 1,
  "includeReviews": false,
  "maxReviewsPerProduct": 20,
  "includeVariants": true,
  "includeSpecifications": true,
  "sortBy": "bestMatch",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

All scraped Walmart products (and reviews when includeReviews=true). Download as JSON, CSV, Excel, HTML, or RSS.

## `runSummary` (type: `string`):

End-of-run JSON with counts, charges, errors, and warning samples.

## `output` (type: `string`):

Terminal outcome, persisted item count, and charged event counts for agents and automations.

# 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",
    "searchQuery": "wireless headphones",
    "maxProducts": 1,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/walmart-data-extractor").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",
    "searchQuery": "wireless headphones",
    "maxProducts": 1,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/walmart-data-extractor").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",
  "searchQuery": "wireless headphones",
  "maxProducts": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call khadinakbar/walmart-data-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/walmart-data-extractor"
        }
    }
}

```

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/EXbWJQaF0UFGm4Ute/builds/pqoUTReADTGQYTVPL/openapi.json
