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

Scrape Walmart product details from product, search, and category URLs. Export prices, variants, ratings, sellers, UPCs, returns, images, and specifications.

- **URL**: https://apify.com/mlg14/walmart-scraper.md
- **Developed by:** [MLG Data](https://apify.com/mlg14) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Walmart Scraper

Scrape Walmart product details from product URLs, search results, and browse category pages. Export Walmart prices, seller offers, ratings, variants, images, UPCs, and return information to JSON, CSV, or a spreadsheet format. This actor provides a practical alternative to building a product catalog integration for publicly visible Walmart pages.

Give the actor a product URL for one item, or a search or browse URL to collect many products. A search result is used to discover product IDs; the actor then opens each product page and returns a full detail record. It does not turn a search card into a detail record. In a verified run for `laundry detergent`, 35 search products produced 35 detail records, and every record had a price, brand, seller, image, rating, review count, and UPC.

### What data can you extract from Walmart?

Each dataset item describes one product page and its selected offer. Fields that Walmart does not provide for a particular item are `null` or an empty list. Prices are in the currency Walmart displayed for that page; the verified US sample used USD.

| Field | Description | Example |
|---|---|---|
| `itemType` | Record type | `DetailProduct` |
| `productId` | Internal product identifier | `3UWETWA0X03C` |
| `usItemId` | Item number used in the URL | `13460958790` |
| `name` | Product title | `all Free Clear Liquid Laundry Detergent, 73 oz, 58 Loads` |
| `url` | Canonical product page | `https://www.walmart.com/ip/all-Liquid-FC-73oz/13460958790` |
| `brand` | Product brand | `all` |
| `description` | Long description with markup removed | `...free of perfumes and dyes...` |
| `shortDescription` | Short description with markup removed | Product summary |
| `categoryPath` | Ordered category names | `Household Essentials`, `Laundry`, `Laundry Detergents` |
| `averageRating` | Average customer rating | `4.7` |
| `numberOfReviews` | Customer review total | `23830` |
| `ratingCounts` | One through five star counts | `{"5": 19402}` |
| `sellerName` | Selected offer seller | `Walmart.com` |
| `sellerId` | Seller identifier | `F55CDC31AB754BB68FE0B39041159D63` |
| `sellerType` | Seller classification | `INTERNAL` |
| `sellerAverageRating` | Seller rating where available | `4.6` or `null` |
| `sellerReviewCount` | Seller review total where available | `1200` or `null` |
| `availability` | Stock status | `IN_STOCK` |
| `price` | Numeric current price | `12.12` |
| `wasPrice` | Numeric previous price | `19.94` or `null` |
| `unitPrice` | Displayed amount per measure | `16.6 ¢/fl oz` |
| `currency` | Price currency code | `USD` |
| `priceInfo` | Display strings for current, previous, and unit prices | `{"price":"$12.12"}` |
| `fulfillmentType` | Selected offer fulfillment code | `STORE`, `FC`, or `MARKETPLACE` |
| `additionalOfferCount` | Other offers listed for the item | `10` |
| `upc` | Product UPC, preserving leading zeroes | `072613474158` |
| `returnPolicy` | Returnability, window, and public policy text | `{"returnable":true}` |
| `shippingRestriction` | Shipping restriction indicator or detail | `false` |
| `images` | All image URLs in the product record | List of image URLs |
| `imageUrl` | First product image URL | Image URL |
| `variantList` | Linked variant IDs, attributes, price strings, and stock | List of variant objects |
| `specifications` | Product specification name and value pairs | `{"name":"Size","value":"73 oz"}` |
| `badges` | Public product flags and labels | Badge object |
| `model` | Model number when supplied | Product model string |
| `manufacturerProductId` | Manufacturer item number when supplied | Product item string |
| `offerId` | Selected offer identifier | Offer ID string |

`price` and `wasPrice` are numbers suitable for comparisons. `priceInfo` retains the displayed strings, including a unit price such as cents per fluid ounce. `ratingCounts` uses keys `1` through `5`; the values represent the number of ratings at each star level. `variantList` is inline even when separate variant collection is off. Each variant includes `productId`, `usItemId`, `variants`, `availabilityStatus`, and `priceInfo`. Turn on separate variant collection when you need the full product record for every linked size, scent, color, or pack count.

### How to scrape Walmart

1. Paste one or more public Walmart product, search, or browse category URLs into **Start URLs**. A product URL contains `/ip/` and a numeric item ID; a search URL contains `/search?q=`.
2. Set **Max products per start URL**. A direct product URL normally returns one record unless separate variant collection is enabled. Search and browse URLs can return many products.
3. Turn on **Collect variants separately** if every linked variant needs its own product detail record. The per-URL limit includes these additional records.
4. Run the actor. Open the dataset to inspect the results, then download JSON, CSV, or a spreadsheet file.

A search URL can include the filters already shown in your browser. The actor preserves those query parameters while it changes the page number. Product IDs are deduplicated across pages, sponsored placements, start URLs, and separately collected variants. The total product limit stops the run across all start URLs, including variant records.

### Input

| Parameter | Type | Default | Description |
|---|---|---:|---|
| `startUrls` | URL list | Required | Walmart product, search, or browse category pages. |
| `maxProductsPerStartUrl` | Integer | `10` | Maximum full records for each start URL; includes separate variants. |
| `enqueueProductVariants` | Boolean | `false` | Visit linked variants and return each as a separate record. |
| `maxItems` | Integer | `100` | Overall record limit across the run; `0` removes the overall limit. |
| `proxyConfiguration` | Object | Enabled | Connection configuration used by the actor. |

Example input for a product detail collection:

```json
{
  "startUrls": [
    {"url": "https://www.walmart.com/search?q=laundry%20detergent"}
  ],
  "maxProductsPerStartUrl": 35,
  "enqueueProductVariants": false,
  "maxItems": 35
}
```

The same input structure works for a single product: replace the search URL with `https://www.walmart.com/ip/13460958790`. Set `enqueueProductVariants` to `true` to add related variants, and raise `maxProductsPerStartUrl` if the product has more linked variants than the default limit. Each variant is fetched from its own product page before it is returned, so the record contains that variant's own price, UPC, seller, and availability where supplied.

### Output example

This shortened item came from the verified 35-product run. The full record also contains the descriptions, images, specifications, badges, and all linked variants.

```json
{
  "itemType": "DetailProduct",
  "productId": "3UWETWA0X03C",
  "usItemId": "13460958790",
  "name": "all Free Clear Liquid Laundry Detergent, 73 oz, 58 Loads",
  "url": "https://www.walmart.com/ip/all-Liquid-FC-73oz/13460958790",
  "brand": "all",
  "categoryPath": ["Household Essentials", "Laundry", "Laundry Detergents", "Shop All Laundry Detergent"],
  "averageRating": 4.7,
  "numberOfReviews": 23830,
  "ratingCounts": {"1": 457, "2": 226, "3": 759, "4": 2986, "5": 19402},
  "sellerName": "Walmart.com",
  "availability": "IN_STOCK",
  "price": 12.12,
  "wasPrice": null,
  "unitPrice": "16.6 ¢/fl oz",
  "currency": "USD",
  "priceInfo": {"price": "$12.12", "priceDisplay": "$12.12", "wasPrice": null, "unitPrice": "16.6 ¢/fl oz"},
  "fulfillmentType": "STORE",
  "additionalOfferCount": 10,
  "upc": "072613474158",
  "returnPolicy": {"returnable": true, "returnWindow": {"value": 90, "unitType": "Day"}},
  "variantList": [
    {"productId": "3UWETWA0X03C", "usItemId": "13460958790", "variants": ["size-73", "scent-freeclear"], "availabilityStatus": "IN_STOCK", "priceInfo": {"price": "$12.12", "priceDisplay": "$12.12", "wasPrice": null, "unitPrice": "16.6 ¢/fl oz"}}
  ]
}
```

The example's previous price is `null` because that item did not display one. In the same verified run, five of 35 products showed a `wasPrice`, 33 showed a unit price, and 31 had a nonempty inline variant list. These differences reflect the product pages. A missing promotional price is not a failed extraction.

### Use cases

- **Price monitoring:** Collect the same item URLs on a schedule and compare numeric `price` and `wasPrice` over time. Keep `usItemId` as the stable join key when titles change.
- **Assortment research:** Start from a relevant search or browse page, then compare brands, item numbers, categories, pack sizes, and availability across the products surfaced there.
- **Variant analysis:** Inspect `variantList` for options on a parent product. Fetch variants separately to compare the full details for different sizes, scents, or quantities.
- **Marketplace offer review:** Compare `sellerName`, `sellerId`, `sellerType`, `fulfillmentType`, and `additionalOfferCount` to identify the selected offer and whether other offers are listed.
- **Catalog matching:** Use UPC, model, and manufacturer product ID to match the public listing with an internal catalog. Preserve UPC as text so leading zeroes survive export.
- **Merchandising checks:** Track ratings, review counts, images, return policy, and specification coverage for products in a category. Empty values can identify listings that need closer review.

### How much does it cost to scrape Walmart?

The configured result price is **$1.00 per 1,000 product records**, or **$0.001 per record**. The charge follows emitted records, including separately collected variants. The displayed result price includes the actor's platform usage; inspect the run and pricing display for your account's current charges before a large collection.

| Records delivered | Result charge |
|---:|---:|
| 35 | $0.035 |
| 500 | $0.50 |
| 5,000 | $5.00 |

The verified 35-record run took about one minute. Runtime varies with product page size, connection conditions, page count, and whether variant collection is enabled. A search with 35 products requires a listing page plus up to 35 product detail requests; a direct product URL needs only that product page unless variants are requested. Charges are based on records delivered, while the product limit also prevents an unexpectedly broad run.

### Tips for best results

Start with a narrow search term or a specific browse category if you want a coherent product set. A broad term may return thousands of matches, but the actor stops at your chosen product limit. Search order comes from the public listing; it can change between runs, so a fixed list of product URLs is better for tracking the same items repeatedly.

Use direct `/ip/` URLs when you already know the item IDs. The actor requests the current product detail for each URL, which avoids relying on listing position. A short list of product URLs also makes it easy to compare different sellers or brands in one run. Repeated item IDs are emitted only once in a run.

Leave separate variant collection off when the inline `variantList` is enough. Turning it on fetches the full detail page for each linked variant, which takes longer and consumes the per-URL and overall result limits. For a family with five linked variants, set `maxProductsPerStartUrl` to at least five if you want all five as separate records.

For larger search collections, the actor follows normal result pages first. When those pages reach their cap before the requested number of products is collected, it tries price ranges to discover more distinct IDs. The ranges are $0–25, $25–50, $50–100, $100–200, $200–500, $500–1,000, $1,000–10,000, and $10,000 and above. These are discovery ranges, not a guarantee that every product in a large search can be reached. If your start URL already contains `min_price` or `max_price`, the actor respects those filters and does not add its own ranges.

### Limits

The public search used for verification reported a 12-page cap. A browse category reported a 25-page cap. Requests beyond those caps returned no products. Price range discovery can extend a search after the cap, but rankings, repeated placements, unavailable items, and the site's own limits can still prevent exhaustive collection. The actor stops when a page has no usable product IDs.

Product data depends on the public page and the selected offer at the time of collection. In the verified 35-product sample, every item had a price, brand, seller, image, rating, review count, and UPC. Only five showed a previous price. Seller rating and seller review count appeared on six. Four products had no linked variants. Values such as shipping restrictions and seller ratings should be treated as optional fields.

Availability and price can change by time, delivery area, or store context. The actor records what the page returned from its connection; it does not set a store location, sign in, enter a postal code, or inspect checkout. Search and category pages can be redirected or temporarily blocked. A blocked page may result in fewer records than the requested limit. Account-only information and private customer data are outside the actor's scope.

### Automation examples

- “Collect the public product details for these 20 Walmart item URLs. Return UPC, current price, previous price, seller, stock status, and the date of this run in a separate tracking table.”
- “Search Walmart for laundry detergent, collect 35 detail records, and compare unit prices across brands. Flag items with missing unit prices rather than estimating them.”

These examples describe how to use the exported dataset. The actor itself returns product records; it does not calculate historical changes, estimate missing fields, or provide a complete market census.

### FAQ

#### Can I scrape a Walmart product URL without a search?

Yes. Put a public `/ip/` URL in `startUrls`. The actor reads the numeric item ID, opens its product page, and returns one full product record. When separate variant collection is on, it also visits linked variants, up to the product limit.

#### Are search and category results full product records?

Yes. Search and browse pages supply product IDs for discovery. The actor visits each selected product page and extracts its detail data before writing a record. This is why a run over 35 products makes more requests than a listing-only extraction.

#### Does the actor return every variant?

The parent product contains the variants exposed on its public page in `variantList`. Enable `enqueueProductVariants` to get separate full records. The per-URL and overall limits still apply, and unavailable or missing variant pages may not produce a separate record.

#### Why is a field empty?

A product page may omit it. A `wasPrice` is commonly absent when no previous price is displayed. Seller ratings, restrictions, unit prices, variants, and specifications also vary by product. Check the public page, the selected offer, and whether the field appears there before treating a blank value as an extraction issue.

#### Do I need to configure a proxy?

The default connection configuration is ready for a normal run. The actor tries an ordinary connection first, can rotate its session after blocked responses, and can move to a residential connection when needed. Large or repeated runs may see different blocking behavior.

#### How fast is a run, and can I schedule it?

The verified 35-product collection completed in about one minute. Larger runs and separate variants take longer because each detail page is fetched. You can schedule repeat runs and compare exports by `usItemId`; prices and availability should be interpreted with the collection time.

#### Can I export to a spreadsheet?

Yes. Download the dataset in JSON, CSV, or spreadsheet format. For spreadsheet comparisons, keep `usItemId` and UPC as text. Numeric `price` and `wasPrice` are suitable for formulas; `priceInfo` preserves the exact display strings.

#### Is collecting this data allowed?

The actor is designed for publicly visible product information and does not access accounts or private customer records. Follow applicable law and the site's terms for your use, and avoid collecting or misusing personal information.

### Integrations

The dataset can be retrieved through the platform API, exported to a spreadsheet, or sent to other systems through webhooks and scheduled runs. Use `usItemId` or the product URL to join records across runs. If you compare prices over time, store the run timestamp alongside each exported item, because the product record represents the page as observed during that run.

### Support

Open an issue on the Issues tab; we reply within 24h and add fields on request. Include a public product or search URL, the run ID, and the field you expected. A reproducible example makes it easier to check whether the page omitted the value or the extraction needs an update.

# Actor input Schema

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

Public Walmart product, search, or browse category URLs. Search and category pages are expanded into product records (about 40 per search page).

## `maxProductsPerStartUrl` (type: `integer`):

Maximum product records from each start URL, including separately collected variants.

## `includeProductDetails` (type: `boolean`):

Also open each product page to add brand, UPC, full description, specifications, images and rating breakdown. Slower (about 10 to 30 times). Off: records come straight from search results.

## `enqueueProductVariants` (type: `boolean`):

Only with full product details: visit linked sizes, colors, or pack options and return each as its own record, within the product limit.

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

Hard limit across all start URLs. Set 0 for no overall limit.

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

Connection settings for requests made by the actor.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.walmart.com/search?q=laundry%20detergent"
    }
  ],
  "maxProductsPerStartUrl": 10,
  "includeProductDetails": false,
  "enqueueProductVariants": false,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `products` (type: `string`):

Full product records in the default dataset.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.walmart.com/search?q=laundry%20detergent"
        }
    ],
    "maxProductsPerStartUrl": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("mlg14/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 = {
    "startUrls": [{ "url": "https://www.walmart.com/search?q=laundry%20detergent" }],
    "maxProductsPerStartUrl": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("mlg14/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 '{
  "startUrls": [
    {
      "url": "https://www.walmart.com/search?q=laundry%20detergent"
    }
  ],
  "maxProductsPerStartUrl": 10
}' |
apify call mlg14/walmart-scraper --silent --output-dataset

```

## MCP server setup

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