# 🛒 Walmart Data Extractor (`scraper-engine/walmart-data-extractor`) Actor

🛒 Walmart Data Extractor pulls product details, pricing, ratings & availability from Walmart for fast market research. 📊 Automate leads, monitor competitors & track trends with reliable data. 🚀 Great for B2B insights & analytics.

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

## Pricing

from $4.99 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Data Extractor

Extract rich, structured product data from **Walmart.com** at scale. Feed it
category pages, search pages, or product (`/ip/`) URLs — or just a keyword — and
get back prices, images, brand, full specifications, ratings, seller info, and
much more. Built for reliability with automatic **proxy escalation**, anti-bot
browser impersonation, retries, and **real-time** dataset saving.

### ✨ Why Choose This Actor?

- 🔗 **Bulk URLs** — mix category, search and product URLs in a single run.
- 🛡️ **Smart proxy escalation** — starts direct, falls back to datacenter, then
  residential automatically, and sticks with residential once it has to.
- 🧰 **Anti-bot by design** — uses `impit` browser impersonation (real TLS/HTTP
  fingerprints) instead of heavy headless browsers.
- 💾 **Live results** — products stream into the output table as they're scraped,
  grouped by source section, so a mid-run stop never loses data.
- ⭐ **Reviews & specs** — opt into reviews and get full `idml` specifications.
- 🧩 **Customizable output** — reshape every record with your own Python hooks.

### 🔑 Key Features

| Feature | Description |
|--------|-------------|
| Category scraping | Auto-paginates browse/category pages |
| Search scraping | Search pages or a raw keyword |
| Product detail | Direct `/ip/` URL extraction |
| Reviews | `includeReviews` / `onlyReviews` |
| Limits | `maxItems` (global) and `endPage` |
| Location | Best-effort `zipCode` targeting |
| Proxy | direct → datacenter → residential (sticky) |

### 📥 Input

```json
{
  "startUrls": [
    { "url": "https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4670095_4582920" }
  ],
  "search": "laptop",
  "maxItems": 10,
  "endPage": null,
  "zipCode": "10001",
  "includeReviews": false,
  "onlyReviews": false,
  "proxy": { "useApifyProxy": false }
}
````

| Field | Type | Description |
|-------|------|-------------|
| `startUrls` | array | Walmart category / search / product URLs (bulk). **Required.** |
| `search` | string | Keyword → converted to a search URL. |
| `maxItems` | integer | Cap on total products. Empty = no limit. |
| `endPage` | integer | Last category/search page to read. |
| `zipCode` | string | US ZIP for localized pricing/availability. |
| `postalCode` | integer | ⚠️ Deprecated — use `zipCode`. |
| `includeReviews` | boolean | Attach reviews to each product. |
| `onlyReviews` | boolean | Keep only reviews + identifiers. |
| `extendOutputFunction` | string | Python `def extendOutputFunction(product)` → dict merged in. |
| `outputFilterFunction` | string | Python `def outputFilterFunction(product)` → reshape/drop. |
| `proxy` | object | Proxy config. Default: no proxy (auto-escalates on block). |

### 📤 Output

Each product is pushed as one dataset row with the **full** Walmart product
object plus convenience columns for the table view:

```json
{
  "name": "MAX Advanced Brakes - Brake Kit ...",
  "brand": "Max Advanced Brakes",
  "priceString": "$194.99",
  "price": 194.99,
  "availabilityStatus": "IN_STOCK",
  "usItemId": "1902495893",
  "productUrl": "https://www.walmart.com/ip/.../1902495893",
  "imageUrl": "https://i5.walmartimages.com/seo/...jpeg",
  "sourceSection": "browse_auto_tires",
  "sourceUrl": "https://www.walmart.com/browse/...",
  "priceInfo": { "currentPrice": { "price": 194.99, "priceString": "$194.99" } },
  "idml": { "specifications": { }, "longDescription": "..." },
  "reviews": null
}
```

A structured, per-section summary (mirroring `results_by_url`) is also written to
the key-value store as **`OUTPUT`**.

### 🚀 How to Use (Apify Console)

1. Log in at <https://console.apify.com> → **Actors**.
2. Open **Walmart Data Extractor**.
3. Paste your Walmart URLs (or a keyword), set `maxItems`, and configure proxy.
4. Click **Start**.
5. Watch products stream into the run log and **Output** tab in real time.
6. Export to JSON / CSV / XLSX when done.

### 🤖 Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"startUrls":[{"url":"https://www.walmart.com/search?q=laptop"}],"maxItems":10}'
```

### 🎯 Best Use Cases

- 💰 Price monitoring & repricing
- 📊 Catalog & assortment analysis
- 🔎 Competitor & market research
- 🏷️ Brand / seller tracking

### 💳 Pricing

This actor uses the **pay-per-event** model. The primary event is
`row_result`, charged once per product saved to the dataset. Platform startup is
covered by the synthetic `apify-actor-start` event. You only pay for the products
you actually receive.

### ❓ FAQ

**Which URLs are supported?** Category/browse pages, search pages, and product
(`/ip/`) pages.

**Do I need a proxy?** No. The actor runs direct by default and only escalates to
datacenter then residential proxies if Walmart blocks the request.

**Can I limit the run?** Yes — use `maxItems` for a global cap and `endPage` to
stop pagination early.

**Why are some fields null?** Walmart omits fields per product; reviews are only
attached when `includeReviews`/`onlyReviews` is enabled.

### ⚖️ Cautions / Legal

- Data is collected only from **publicly available** Walmart pages.
- You are responsible for compliance with Walmart's ToS and applicable laws
  (GDPR, CCPA, etc.). Use reasonable rate limits and scrape responsibly.

### 🛟 Support & Feedback

Open an issue on the Actor's **Issues** tab with your run ID and input, and we'll
take a look.

# Actor input Schema

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

One or more Walmart URLs. ✅ Supported: category/browse pages, search pages, and product-detail (/ip/) pages. Add as many as you like — they run in bulk.

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

Maximum number of products to scrape across the whole run. Leave empty for no limit.

## `endPage` (type: `integer`):

Stop paginating category/search results at this page number. Leave empty for no limit.

## `search` (type: `string`):

Optional. A keyword to search on Walmart (e.g. "laptop"). It's turned into a search URL automatically and added to the URLs above.

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

US ZIP code used to localize delivery/pickup pricing & availability (best-effort).

## `postalCode` (type: `integer`):

⚠️ Deprecated — please use ZIP code instead. Kept for backwards compatibility.

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

Attach the reviews block to each scraped product.

## `onlyReviews` (type: `boolean`):

Discard product data and keep only the reviews (plus identifiers).

## `extendOutputFunction` (type: `string`):

Optional Python function `def extendOutputFunction(product): ...` returning a dict that is merged into every result.

## `outputFilterFunction` (type: `string`):

Optional Python function `def outputFilterFunction(product): ...` to reshape each item. Return None to drop an item.

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

Proxy settings. By default the actor connects directly (no proxy). If Walmart blocks the request, it automatically escalates: direct → datacenter → residential. 🛡️

## Actor input object example

```json
{
  "startUrls": [
    "https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4670095_4582920"
  ],
  "maxItems": 10,
  "includeReviews": false,
  "onlyReviews": false,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# 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": [
        "https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4670095_4582920"
    ],
    "maxItems": 10,
    "search": "",
    "extendOutputFunction": "",
    "outputFilterFunction": "",
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/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 = {
    "startUrls": ["https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4670095_4582920"],
    "maxItems": 10,
    "search": "",
    "extendOutputFunction": "",
    "outputFilterFunction": "",
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-engine/walmart-data-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4670095_4582920"
  ],
  "maxItems": 10,
  "search": "",
  "extendOutputFunction": "",
  "outputFilterFunction": "",
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call scraper-engine/walmart-data-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraper-engine/walmart-data-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🛒 Walmart Data Extractor",
        "description": "🛒 Walmart Data Extractor pulls product details, pricing, ratings & availability from Walmart for fast market research. 📊 Automate leads, monitor competitors & track trends with reliable data. 🚀 Great for B2B insights & analytics.",
        "version": "0.1",
        "x-build-id": "lE2pl3rxDqc3nNmLA"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraper-engine~walmart-data-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraper-engine-walmart-data-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scraper-engine~walmart-data-extractor/runs": {
            "post": {
                "operationId": "runs-sync-scraper-engine-walmart-data-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scraper-engine~walmart-data-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-scraper-engine-walmart-data-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "🔗 Walmart URLs (bulk)",
                        "type": "array",
                        "description": "One or more Walmart URLs. ✅ Supported: category/browse pages, search pages, and product-detail (/ip/) pages. Add as many as you like — they run in bulk.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "🎯 Max items",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of products to scrape across the whole run. Leave empty for no limit."
                    },
                    "endPage": {
                        "title": "📑 Category end page",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Stop paginating category/search results at this page number. Leave empty for no limit."
                    },
                    "search": {
                        "title": "🔍 Search keyword",
                        "type": "string",
                        "description": "Optional. A keyword to search on Walmart (e.g. \"laptop\"). It's turned into a search URL automatically and added to the URLs above."
                    },
                    "zipCode": {
                        "title": "📍 ZIP code",
                        "type": "string",
                        "description": "US ZIP code used to localize delivery/pickup pricing & availability (best-effort)."
                    },
                    "postalCode": {
                        "title": "📮 Postal code (deprecated)",
                        "type": "integer",
                        "description": "⚠️ Deprecated — please use ZIP code instead. Kept for backwards compatibility."
                    },
                    "includeReviews": {
                        "title": "⭐ Include reviews",
                        "type": "boolean",
                        "description": "Attach the reviews block to each scraped product.",
                        "default": false
                    },
                    "onlyReviews": {
                        "title": "💬 Only reviews",
                        "type": "boolean",
                        "description": "Discard product data and keep only the reviews (plus identifiers).",
                        "default": false
                    },
                    "extendOutputFunction": {
                        "title": "🧩 Extend output function (Python)",
                        "type": "string",
                        "description": "Optional Python function `def extendOutputFunction(product): ...` returning a dict that is merged into every result."
                    },
                    "outputFilterFunction": {
                        "title": "🔧 Output filter function (Python)",
                        "type": "string",
                        "description": "Optional Python function `def outputFilterFunction(product): ...` to reshape each item. Return None to drop an item."
                    },
                    "proxy": {
                        "title": "🌐 Proxy configuration",
                        "type": "object",
                        "description": "Proxy settings. By default the actor connects directly (no proxy). If Walmart blocks the request, it automatically escalates: direct → datacenter → residential. 🛡️",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
