# Walmart Product Scraper (`houzeir/walmart-product-scraper`) Actor

- **URL**: https://apify.com/houzeir/walmart-product-scraper.md
- **Developed by:** [Dmytro Kolomiiets](https://apify.com/houzeir) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 products

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

### What is Walmart Product Scraper?

Walmart Product Scraper gets product data from [Walmart.com](https://www.walmart.com) for a list of product URLs
or IDs. For each product you get the price, discount, stock status, rating, number of reviews, seller, brand,
category, images, variants and specifications.

Results can be downloaded as JSON, CSV, Excel or HTML, or fetched through the API. Proxies are included, so there
is nothing to set up.

### What data does it return?

| Product | Price and stock | Reviews and seller | Content |
|---|---|---|---|
| Product ID | Current price | Average rating | Main image |
| Name | Was price (before discount) | Reviews count | All images |
| Brand | Currency | Seller name | Short description |
| UPC | Availability status | Seller ID | Variants with their own price, stock and images |
| Model | In stock (true / false) | | Specifications |
| Category path | | | Raw product JSON (optional) |

Common uses are tracking prices and discounts over time, checking who sells a product and whether it's in stock,
and filling a catalog with UPCs, specs and images.

### How to use it

1. Click **Try for free** and sign in to Apify (or create a free account).
2. Paste Walmart product URLs or IDs into **Products**, one per line.
3. Click **Start**.
4. When the run finishes, open the **Output** tab to preview or export the data.

To check prices every day, add a **Schedule** in Apify Console.

### How much does it cost?

You pay per product returned. The current rate is on the **Pricing** tab, and proxy costs are already included.
Products that couldn't be scraped and lines that aren't a valid product URL or ID still get a row in the output,
with an `error` message, but they aren't charged.

Apify's free plan comes with monthly credits, which is enough to try it on your own products.
To cap the cost of a run, set **Max items**.

### Input

| Field | Description |
|---|---|
| **Products** | Walmart product URLs or IDs. Duplicates are removed. Lines that aren't a Walmart product URL or ID are skipped and listed in the output with an `error`. |
| **Include raw product JSON** | Adds the full product data from the page as `rawData`. Makes each item much larger. |
| **Max items** | Stop after this many products. Leave empty for no limit. |
| **Max concurrency** | How many products are scraped at the same time. Default: 10. |
| **Max retries per product** | How many times to retry a product before giving up. Default: 10. |

Any of these formats works:

```text
https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216
https://www.walmart.com/ip/10535216
10535216
```

Example input:

```json
{
  "products": [
    "https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216",
    "10535216"
  ],
  "includeRawData": false,
  "maxItems": 100
}
```

### Output

One dataset item per product:

```json
{
  "productId": "10535216",
  "url": "https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216",
  "input": "https://www.walmart.com/ip/10535216",
  "productExists": true,
  "error": null,
  "name": "Coca-Cola Classic Soda Pop, 12 fl oz Cans, 24 Pack",
  "brand": "Coca-Cola",
  "price": 13.48,
  "wasPrice": 14.98,
  "currency": "USD",
  "availability": "IN_STOCK",
  "inStock": true,
  "rating": 4.7,
  "reviewsCount": 5123,
  "sellerName": "Walmart.com",
  "sellerId": "…",
  "upc": "…",
  "model": "…",
  "category": ["Food", "Beverages"],
  "shortDescription": "…",
  "imageUrl": "https://i5.walmartimages.com/...",
  "images": ["https://i5.walmartimages.com/..."],
  "variantGroups": [
    {
      "id": "count_per_pack",
      "name": "Count Per Pack",
      "type": "DROPDOWN",
      "values": [
        { "id": "count_per_pack-12", "name": "12", "available": true, "selected": false, "productIds": ["12166733"] },
        { "id": "count_per_pack-24", "name": "24", "available": true, "selected": true, "productIds": ["10535216"] }
      ]
    }
  ],
  "variants": [
    {
      "productId": "12166733",
      "variantId": "3Q6I9QW7WKR7",
      "url": "https://www.walmart.com/ip/Coca-Cola-Classic-Coke-12-ct-144-fl-oz/12166733",
      "selected": false,
      "options": { "Count Per Pack": "12" },
      "availability": "IN_STOCK",
      "inStock": true,
      "price": 7.68,
      "wasPrice": 8.57,
      "currency": "USD",
      "unitPrice": "5.3 ¢/fl oz",
      "condition": "New",
      "imageUrl": "https://i5.walmartimages.com/seo/...",
      "images": ["https://i5.walmartimages.com/seo/..."]
    }
  ],
  "specifications": [{ "name": "Size", "value": "12 oz" }],
  "rawData": null
}
```

`input` is the line you entered for this product, so you can match results to your list.

`variantGroups` lists the options a shopper picks from (size, color, pack count…). `variants` has one entry per
buyable variant with its own ID, price, stock and images; `selected: true` marks the product you asked for.

If a product no longer exists on Walmart, you still get an item for it, with `productExists: false` and the other
fields empty.

If a product couldn't be scraped, its row has `productExists: null` and an `error` explaining why:

```json
{
  "productId": "10535216",
  "input": "https://www.walmart.com/ip/10535216",
  "productExists": null,
  "error": "Couldn't load the product page after all retries. Try again later or raise Max retries per product."
}
```

### API

Run the Actor and get the results in one request:

```bash
curl -X POST "https://api.apify.com/v2/acts/houzeir~walmart-product-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"products": ["10535216"]}'
```

Python ([apify-client](https://docs.apify.com/api/client/python)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("houzeir/walmart-product-scraper").call(run_input={"products": ["10535216"]})

for product in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(product["name"], product["price"])
```

JavaScript ([apify-client](https://docs.apify.com/api/client/js)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('houzeir/walmart-product-scraper').call({ products: ['10535216'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

You can also connect it to Google Sheets, Slack, Zapier, Make and other tools from the **Integrations** tab,
or call a webhook when a run finishes.

### FAQ

#### Is it legal to scrape Walmart?

The Actor only collects public product data. It doesn't log in or collect personal data. Scraping public data is
generally legal, but you're responsible for how you use it. See
[Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/), and ask a lawyer if you're unsure.

#### What if some products fail?

Every product you enter gets a row in the output. Products that couldn't be scraped have an `error` instead of data,
and the run's status message says how many failed. To retry them, filter the output by `error`, then run the Actor
again with their `input` values, or raise **Max retries per product**.

Products that are out of stock are still returned, with `inStock: false`.

#### Can I scrape search results or categories?

No, only product URLs and IDs for now. If you need search or category pages, open an issue.

#### Which store's prices do I get?

The prices and availability a US visitor sees on walmart.com for the default store. Other stores or ZIP codes can
have different prices.

### Feedback

Found a bug or need another field? Open an issue on the **Issues** tab.

# Changelog

This Actor's version history is a separate document: https://apify.com/houzeir/walmart-product-scraper/changelog.md

# Actor input Schema

## `products` (type: `array`):

Walmart product URLs (https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216) or product ids (10535216).

## `includeRawData` (type: `boolean`):

Add the full product JSON from the page (product, specifications, reviews...) as `rawData`. Makes items much larger.

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

Stop after this many products (empty = no limit).

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

How many products are fetched in parallel.

## `maxRequestRetries` (type: `integer`):

Attempts per product (each with a new IP and fingerprint) before it is reported as failed.

## Actor input object example

```json
{
  "products": [
    "https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216"
  ],
  "includeRawData": false,
  "maxConcurrency": 30,
  "maxRequestRetries": 10
}
```

# Actor output Schema

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

Table of products: image, ID, name, brand, price, availability, rating, seller and errors.

## `allData` (type: `string`):

Every field of every product, including variants, specifications and images.

# 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 = {
    "products": [
        "https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("houzeir/walmart-product-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 = { "products": ["https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216"] }

# Run the Actor and wait for it to finish
run = client.actor("houzeir/walmart-product-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 '{
  "products": [
    "https://www.walmart.com/ip/Coca-Cola-Classic-Soda-Pop-12-fl-oz-Cans-24-Pack/10535216"
  ]
}' |
apify call houzeir/walmart-product-scraper --silent --output-dataset

```

## MCP server setup

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