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

Walmart Scraper: Extract full product catalogs, live prices, Rollbacks, clearance deals, in-store and online stock availability, UPC barcodes, seller fulfillment channels, and reviews. Designed for retail price comparison, omnichannel monitoring, and inventory intelligence at scale online.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 (Live Prices, Rollback Deals, Stock & UPC)

Extract live Walmart product listings, discounted Rollback prices, stock status, UPC/GTIN barcode identifiers, merchant sellers, and customer reviews at scale.

> **Apify Store Short Description (296 chars):**\
> `Scrape Walmart product listings, live prices, Rollback discounts, in-store & online stock, UPC barcodes, seller channels, and reviews at scale. Supports direct Item IDs, product URLs, and keyword search with residential proxy rotation for price matching, retail arbitrage, and inventory tracking.`

***

### 🌟 Key Features

- 🏷️ **Rollback & Clearance Detection**: Automatically tags deal types (`Rollback`, `Reduced price`, `Clearance`, `Regular`) and extracts the previous "Was price".
- 📦 **UPC / GTIN Barcodes**: Extracts universal barcode numbers, enabling instant cross-referencing with Amazon ASINs for retail arbitrage.
- 🏪 **Merchant & Fulfillment Channels**: Identifies whether the item is "Sold & Shipped by Walmart.com" or a 3rd party Marketplace Pro Seller.
- ⚡ **Multi-Mode Input**: Input numerical Walmart Item IDs, paste direct product URLs, or search across categories by keywords.
- 🔄 **Smart Search Sorting**: Sort search results by Best Seller, Price (Low to High / High to Low), Customer Rating, or New Arrivals.
- 🖼️ **High-Resolution Galleries**: Captures high-definition primary thumbnails and full gallery image arrays.
- 🛡️ **Anti-Bot & PerimeterX Bypass**: Powered by got-scraping with browser emulation and automatic Playwright fallback.

***

### 📥 Input Configuration

| Field | Type | Default | Description |
|---|---|---|---|
| `productUrls` | Array | `[]` | List of direct Walmart product links (leave empty to search by keywords). |
| `itemIds` | Array | `[]` | List of numerical Walmart Item IDs. |
| `searchKeywords` | Array | `["wireless earbuds", "ergonomic chair"]` | Keywords to search on Walmart (e.g. `'wireless earbuds'`). |
| `sortBy` | String | `"best_seller"` | Sort order: `best_seller`, `price_low`, `price_high`, `rating_high`, `new`. |
| `maxProducts` | Integer | `40` | Maximum product records to extract per keyword. |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true }` | Apify Proxy settings to bypass anti-scraping blocks. |

***

### 📤 Output Data Format

```json
{
  "itemId": "987654321",
  "title": "Ninja Air Fryer Pro 4-in-1 with 5-QT Capacity (Air Fry, Roast, Reheat, Dehydrate)",
  "price": 89.00,
  "originalPrice": 119.00,
  "currency": "USD",
  "priceType": "Rollback",
  "rating": 4.8,
  "reviewsCount": 4250,
  "inStock": true,
  "stockStatus": "In stock",
  "brand": "Ninja",
  "sellerName": "Walmart.com",
  "upc": "622356562011",
  "badge": "Popular pick",
  "description": "The Ninja Air Fryer Pro delivers crispy, golden results with up to 75% less fat than traditional frying methods...",
  "thumbnail": "https://i5.walmartimages.com/seo/Ninja-Air-Fryer-Pro_abc.jpeg",
  "images": [
    "https://i5.walmartimages.com/seo/Ninja-Air-Fryer-Pro_abc.jpeg",
    "https://i5.walmartimages.com/seo/Ninja-Air-Fryer-Pro_def.jpeg"
  ],
  "url": "https://www.walmart.com/ip/987654321",
  "scrapedAt": "2026-11-10T12:35:00.000Z"
}
```

***

### 💡 Practical Commercial Use Cases

1. **Amazon & Walmart Arbitrage**: Cross-match Walmart Rollback deals against Amazon BuyBox prices using UPC barcodes to find massive profit margins.
2. **Competitive Price Matching**: Track pricing changes across essential retail consumer goods and groceries.
3. **Inventory & Stock Monitoring**: Receive instant alerts when high-demand items or gaming consoles return to stock.
4. **Marketplace Seller Intelligence**: Distinguish official Walmart retail inventory from third-party marketplace merchant offers.

***

### ⚖️ License

Apache-2.0

# Actor input Schema

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

Full https://www.walmart.com/ip/... URLs only (leave empty to search by keywords; plain words belong in Search Keywords below).

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

List of numerical Walmart Item IDs (e.g. '123456789', '987654321').

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

Keywords to search on Walmart (e.g. 'wireless earbuds', 'ergonomic chair', 'air fryer').

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

Sort order for search results.

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

Maximum number of product listings to extract per keyword.

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

Walmart enforces strict PerimeterX anti-bot protection (Robot or human?). Select Apify US RESIDENTIAL or UNBLOCKER Proxy group for reliable production runs.

## Actor input object example

```json
{
  "productUrls": [],
  "itemIds": [],
  "searchKeywords": [
    "wireless earbuds",
    "ergonomic chair"
  ],
  "sortBy": "best_seller",
  "maxProducts": 40,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Scraped records stored in the default Apify dataset.

## `overview` (type: `string`):

High-level summary report and execution metrics stored in Key-Value store.

# 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 = {
    "productUrls": [],
    "itemIds": [],
    "searchKeywords": [
        "wireless earbuds",
        "ergonomic chair"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/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 = {
    "productUrls": [],
    "itemIds": [],
    "searchKeywords": [
        "wireless earbuds",
        "ergonomic chair",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("khnaami/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 '{
  "productUrls": [],
  "itemIds": [],
  "searchKeywords": [
    "wireless earbuds",
    "ergonomic chair"
  ]
}' |
apify call khnaami/walmart-scraper --silent --output-dataset

```

## MCP server setup

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