# Walmart Scraper (`datascrapers/walmart-scraper`) Actor

Scrape Walmart search, category, and product pages. Extract listing data with optional product details and nested reviews. Supports ZIP-based pickup/delivery context.

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

## Pricing

from $1.20 / 1,000 product scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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** creates a structured dataset of product records collected from [Walmart.com](https://www.walmart.com). Each dataset item represents one product and can include the item identifier, title, brand, price, rating, review count, availability, seller, store context, and — when enabled — full product details and nested customer reviews. Query the source using search keywords or Walmart search, category, or product URLs, control the result limit with `maxItems`, and retrieve records through the Apify Dataset API or export them as JSON, CSV, Excel, or HTML.

### Dataset at a glance

| Property | Value |
|---|---|
| Source | walmart.com |
| Record unit | One product listing |
| Input methods | Search keywords, search/category/product URLs, optional US ZIP code |
| Main identifiers | `usItemId`, `url` |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel, HTML |
| Update model | Fresh records per Actor run |
| Pricing | Pay per event, from $1.50 per 1,000 products |

### Coverage and available records

The Actor collects products from three source types:

- **Search results** — products returned for one or more `searchQueries`.
- **Category/browse pages** — products on `/browse` and `/cp` URLs.
- **Product pages** — a single product given a `/ip` URL.

Supported behavior:

- Optional **US ZIP code** (`zipCode`) sets store pickup/delivery context, and `fulfillmentMethod` filters listings to `Pickup`, `Delivery`, or `Shipping`.
- Optional **product details** (`scrapeProductDetails`) enriches each product with description, images, and category path.
- Optional **product reviews** (`scrapeProductReviews`) attaches a nested `reviews` array to each product row; reviews are never stored as separate dataset rows.
- Pagination and result limits are controlled with `maxPages` and `maxItems` (`0` = unlimited).

Fields such as `description`, `categoryPath`, `storeName`, and `reviews` are conditional and present only when the corresponding option is enabled or when Walmart returns the value.

### Data dictionary

| Field | Type | Nullable | Description | Example |
|---|---:|---|---|---|
| `sourceQuery` | string | No | Search term or URL that produced the record | `tomatoes` |
| `usItemId` | string | No | Walmart item identifier | `930274152` |
| `name` | string | No | Product title | `Fresh Roma Tomato, Each` |
| `brand` | string | Yes | Product brand | `Marketside` |
| `url` | string | No | Product page URL | `https://www.walmart.com/ip/930274152` |
| `imageUrl` | string | Yes | Primary product image URL | `https://i5.walmartimages.com/...` |
| `price` | number | Yes | Current price | `0.98` |
| `currency` | string | Yes | Price currency code | `USD` |
| `unitPrice` | string | Yes | Per-unit price label | `$0.98 each` |
| `averageRating` | number | Yes | Aggregate star rating | `4.5` |
| `numberOfReviews` | number | Yes | Total review count | `182` |
| `availabilityStatus` | string | Yes | Stock status | `In stock` |
| `sellerName` | string | Yes | Seller name | `Walmart` |
| `zipCode` | string | Yes | ZIP used for store context | `72076` |
| `storeName` | string | Yes | Store name when ZIP is set | `Supercenter #5700` |
| `description` | string | Yes | Full product description (details enabled) | `...` |
| `categoryPath` | array | Yes | Category breadcrumb (details enabled) | `["Food", "Produce"]` |
| `reviewsScraped` | number | Yes | Count of attached reviews | `20` |
| `reviews` | array | Yes | Nested review objects (reviews enabled) | `[{...}]` |

Use `usItemId` (fallback `url`) as the stable field for deduplication.

### Example dataset record

```json
{
  "sourceQuery": "tomatoes",
  "usItemId": "930274152",
  "name": "Fresh Roma Tomato, Each",
  "brand": "Marketside",
  "url": "https://www.walmart.com/ip/930274152",
  "imageUrl": "https://i5.walmartimages.com/asr/example.jpeg",
  "price": 0.98,
  "currency": "USD",
  "unitPrice": "$0.98 each",
  "averageRating": 4.5,
  "numberOfReviews": 182,
  "availabilityStatus": "In stock",
  "sellerName": "Walmart",
  "zipCode": "72076",
  "storeName": "Supercenter #5700"
}
```

This record was produced by a search for `tomatoes` with `zipCode` set to `72076` and details/reviews disabled.

### Query and input reference

| Input | Type | Required | Default | Accepted values | Description |
|---|---:|---|---|---|---|
| `searchQueries` | array | No | `["tomatoes"]` | Any strings | Keywords to search on Walmart.com. |
| `startUrls` | array | No | — | Search, `/browse`, `/cp`, `/ip` URLs | Walmart URLs to start from. |
| `zipCode` | string | No | — | US ZIP | Sets store pickup/delivery context. |
| `fulfillmentMethod` | string | No | — | `Pickup`, `Delivery`, `Shipping` | Fulfillment filter after ZIP is set. |
| `scrapeProductDetails` | boolean | No | `false` | `true` / `false` | Fetch full product details (billed as `product-details`). |
| `scrapeProductReviews` | boolean | No | `false` | `true` / `false` | Attach nested reviews (billed as `product-reviews`). |
| `maxReviews` | integer | No | `20` | `0` = all | Max reviews attached per product. |
| `maxItems` | integer | No | `0` | `0` = unlimited | Max product records. |
| `maxPages` | integer | No | `0` | `0` = unlimited | Max listing pages per query/URL. |
| `maxConcurrency` | integer | No | `5` | 1–20 | Parallel workers for details/reviews. |
| `proxyConfiguration` | object | No | Apify residential | Proxy editor | Proxy settings. |

Minimal request:

```json
{ "searchQueries": ["tomatoes"], "maxItems": 20 }
```

Advanced request (store context plus details and reviews):

```json
{
  "searchQueries": ["tomatoes"],
  "zipCode": "72076",
  "fulfillmentMethod": "Pickup",
  "scrapeProductDetails": true,
  "scrapeProductReviews": true,
  "maxReviews": 20,
  "maxItems": 100,
  "maxPages": 1,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Retrieve the data through the API

1. Start the Actor with a JSON input.
2. Wait for the run to finish, or use the synchronous endpoint for small jobs.
3. Retrieve items from the run's default dataset.
4. Paginate or export the dataset.

Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("datascrapers/walmart-scraper").call(
    run_input={"searchQueries": ["tomatoes"], "maxItems": 50}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["name"], item.get("price"))
```

For other languages, use the generated API tab on the Actor page.

### Data quality and record handling

- **Completeness** — listing fields (`usItemId`, `name`, `url`, `price`) are returned when Walmart exposes them; enrichment fields are conditional on the corresponding option.
- **Source changes** — Walmart page structure changes can cause individual fields to come back empty; rows are still written with the fields that were found.
- **Deduplication** — the Actor writes one row per product per run and does not persist dedup state across runs. Deduplicate on `usItemId` (fallback `url`) when merging runs.
- **Retry/error behavior** — detail and review enrichment fail soft, so a failed detail call does not discard the listing row already collected.
- **Normalization** — `price` is numeric with a separate `currency` code; `unitPrice` keeps Walmart's display string.
- **Raw vs derived** — `averageRating` and `numberOfReviews` are read from the listing; `reviewsScraped` counts the reviews the Actor attached.

### Export and pipeline examples

| Destination | Recommended method | Typical use |
|---|---|---|
| PostgreSQL/Supabase | Dataset API or webhook consumer | Store product snapshots for dashboards |
| Google Sheets | Apify integration | Share price/availability tables |
| S3/cloud storage | Scheduled export or integration | Archive daily catalog snapshots |

### Pricing and cost examples

Billing is pay per event. You are not charged Apify platform usage on top of these events.

| Event | When charged | Price |
|---|---|---|
| `product` | Each product row written | $1.50 per 1,000 |
| `product-details` | Each product with details fetched (when enabled) | $1.50 per 1,000 |
| `product-reviews` | Each individual review attached (when enabled) | $1.50 per 1,000 |

| Records | Estimated base cost |
|---:|---:|
| 1,000 products | $1.50 |
| 10,000 products | $15.00 |

Estimates assume listings only. Details and reviews add events at the same rate, and Apify plan discounts may reduce the per-event price.

### Limitations and responsible data use

- The Actor reads publicly accessible Walmart.com listing data.
- Availability and source changes can produce empty or partial fields.
- No guarantee of historical snapshots unless you store results yourself.
- You are responsible for compliance with applicable terms, privacy, and legal requirements when using the data.

### Dataset questions

#### What does one dataset item represent?

One Walmart product listing. Reviews and product details are nested on the same row rather than written as separate items.

#### Which field should I use as a unique identifier?

`usItemId` is the most stable Walmart item identifier; use `url` as a fallback.

#### Are fields nullable or conditional?

Many listing fields (`brand`, `averageRating`, `sellerName`) are null when Walmart does not return them. Enrichment fields (`description`, `categoryPath`, `reviews`) are present only when the matching option is enabled.

#### Can I retrieve the records as CSV or JSON?

Yes. Export from the Output tab as JSON, CSV, Excel, or HTML, or read the dataset through the Apify API.

#### How do I paginate large datasets?

Use `maxPages` to limit listing pages and `maxItems` to cap the number of product records. For API retrieval, paginate the default dataset items endpoint.

#### Does the Actor return historical data?

No. Each run captures the current state of the listings at run time.

#### What counts as a billable result?

Each product row is a `product` event. When enabled, each detail fetch is a `product-details` event and each attached review is a `product-reviews` event.

### Related datasets from Data Scrapers

- **[Target.com Product Scraper](https://apify.com/datascrapers/target-scraper)** — US retail product data for cross-retailer price comparisons.
- **[Best Buy Product Scraper](https://apify.com/datascrapers/best-buy-scraper)** — Electronics and appliance listings that can be joined with Walmart catalog data.
- **[HomeDepot Scraper](https://apify.com/datascrapers/homedepot-scraper)** — Home improvement product data with delivery-ZIP context.
- **[Costco Product Scraper](https://apify.com/datascrapers/costco-scraper)** — Warehouse retailer product data for assortment analysis.
- **[Amazon Search Scraper](https://apify.com/datascrapers/amazon-scraper)** — Amazon product and seller data for competitive benchmarking.

### Data Scrapers support

Need an additional field, record type, or export workflow? Contact Data Scrapers at stardustspotlight@gmail.com. Include a sample source URL, required fields, expected record volume, and preferred delivery format.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search on Walmart.com, e.g. tomatoes or wireless mouse. Use this or start URLs (or both).

## `startUrls` (type: `array`):

Walmart search, category (/browse or /cp), or product (/ip) URLs. e.g. https://www.walmart.com/search?q=tomatoes

## `zipCode` (type: `string`):

US ZIP used to set store pickup/delivery context, e.g. 72076. Leave empty for default shipping results.

## `fulfillmentMethod` (type: `string`):

Optional fulfillment filter applied to listings after a ZIP is set.

## `scrapeProductDetails` (type: `boolean`):

When enabled, fetch full product details for each item (charged as product-extra).

## `scrapeProductReviews` (type: `boolean`):

When enabled, attach a reviews list on each product row. Each review is charged as product-reviews. Reviews are never stored as separate dataset rows.

## `maxReviews` (type: `integer`):

Maximum reviews to attach per product. 0 = all reviews. Default is 20. Each attached review is billed as a product-reviews event.

## `maxItems` (type: `integer`):

Maximum number of product records to scrape (0 = unlimited)

## `maxPages` (type: `integer`):

Maximum search/category pages per query or URL (0 = unlimited)

## `maxConcurrency` (type: `integer`):

Parallel workers for product details and reviews. Each worker rotates proxies.

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

Proxy settings for anti-bot protection. Residential proxies are recommended.

## Actor input object example

```json
{
  "searchQueries": [
    "tomatoes"
  ],
  "zipCode": "72076",
  "scrapeProductDetails": false,
  "scrapeProductReviews": false,
  "maxReviews": 20,
  "maxItems": 20,
  "maxPages": 0,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing scraped Walmart products

## `runStats` (type: `string`):

Key-value store record with scrape counts and timestamps

# 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 = {
    "searchQueries": [
        "tomatoes"
    ],
    "zipCode": "72076",
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/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 = {
    "searchQueries": ["tomatoes"],
    "zipCode": "72076",
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/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 '{
  "searchQueries": [
    "tomatoes"
  ],
  "zipCode": "72076",
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datascrapers/walmart-scraper --silent --output-dataset

```

## MCP server setup

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