# Walmart Products Scraper (`crw/walmart-products-scraper`) Actor

Scrape product search results from Walmart US (walmart.com) and Canada (walmart.ca) by keyword or category. Extract product name, price, discount, rating, images, availability, delivery date, and seller details. Supports sorting and category/department filters for targeted data collection.

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

## Pricing

from $3.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/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 Product Scraper

An Apify actor that scrapes product search results from Walmart US (walmart.com) or Canada (walmart.ca). Extracts comprehensive product information including title, price, discount, rating, images, delivery date, and seller details.

---

### Why Use This Actor?

- **Pay only for what you collect** — Charged per result item, not by compute time. You pay $0.003 per product, nothing more.
- **Both US and CA in one actor** — Search walmart.com (USD) and walmart.ca (CAD) with a single tool. No need to maintain separate scrapers for each market.

---

### How to Use

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `market` | string | No | `"US"` | Target market. `"US"` (walmart.com) or `"CA"` (walmart.ca) |
| `keyword` | string | Yes | — | Search keyword (e.g. `"galaxy watch"`) |
| `cat_id` | string | No | `""` | Category ID to filter results. See guide below |
| `sort` | string | No | `"best_match"` | Sort order. See options below |
| `max_items` | number | No | `40` | Maximum number of products to collect (1–400) |

#### Category / Department ID Guide

`cat_id` is optional. Leave it empty to search across all categories.

> **Terminology differs by market**
> - **CA (walmart.ca)**: The filter on the search results page is labeled **"Category"**
> - **US (walmart.com)**: The filter on the search results page is labeled **"Departments"**
>
> In both cases, apply the filter on the Walmart website and copy the `catId` value from the URL into `cat_id`.

##### CA (walmart.ca)

Select a Category filter on the search results page — `catId` will appear in the URL:

````

https://www.walmart.ca/en/search?q=galaxy+watch\&catId=10007
^^^^^
Copy this value into cat\_id

```

Drilling deeper into subcategories joins IDs with `_`:

```

https://www.walmart.ca/en/search?q=galaxy+watch\&catId=10007\_20127\_6000199028437\_6000199028444
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy the entire string into cat\_id

```

| Example cat_id | Meaning |
|---|---|
| `""` (empty) | Search across all categories |
| `"10007"` | Electronics |
| `"10007_20127"` | Electronics > Smart Home & Security |
| `"10007_20127_6000199028437_6000199028444"` | Deeper subcategory |

##### US (walmart.com)

Select a Departments filter on the search results page — `catId` will appear in the URL:

```

https://www.walmart.com/search?q=galaxy+watch\&catId=3944
^^^^
Copy this value into cat\_id

````

| Example cat_id | Meaning |
|---|---|
| `""` (empty) | All Departments |
| `"3944"` | Electronics |
| `"3891"` | Jewelry |

#### Sort Options

| Value | Description |
|---|---|
| `best_match` | Best match (default) |
| `price_low` | Price low to high |
| `price_high` | Price high to low |

#### Example Input — US Keyword Search

```json
{
  "market": "US",
  "keyword": "galaxy watch",
  "sort": "best_match",
  "max_items": 100
}
````

#### Example Input — Canada Keyword Search

```json
{
  "market": "CA",
  "keyword": "galaxy watch",
  "sort": "best_match",
  "max_items": 100
}
```

#### Example Input — Keyword + Category Filter

```json
{
  "market": "US",
  "keyword": "galaxy watch",
  "cat_id": "3944",
  "sort": "price_low",
  "max_items": 100
}
```

#### Example Input — Deep Category Filter (Canada)

```json
{
  "market": "CA",
  "keyword": "galaxy watch",
  "cat_id": "10007_20127_6000199028437_6000199028444",
  "sort": "best_match",
  "max_items": 40
}
```

***

### Output

Results are pushed to the Apify dataset. Each record represents one product.

#### Output Fields

> **US / CA field availability**
>
> - `US, CA` — available in both markets
> - `CA only` — provided by CA, returns `null` in US
> - see Description for US-specific behavior

| Field | Type | Market | Description |
|---|---|---|---|
| `id` | string | US, CA | Walmart internal product ID |
| `us_item_id` | string | US, CA | Product page URL identifier |
| `offer_id` | string | US, CA | Offer ID |
| `seller_id` | string | US, CA | Seller unique ID |
| `name` | string | US, CA | Full product name |
| `brand` | string | **CA only** | Brand name. US search API does not return brand. |
| `class_type` | string | US, CA | `VARIANT` / `REGULAR` etc. |
| `short_description` | string | US, CA | Product description (may contain HTML tags) |
| `canonical_url` | string | US, CA | Full product page URL |
| `thumbnail_url` | string | US, CA | Thumbnail image URL |
| `all_images` | array | US, CA | All product image URLs. **CA**: full list. **US**: thumbnail only (API limitation). |
| `current_price` | number | US, CA | Current selling price |
| `current_price_str` | string | US, CA | Current price formatted (e.g. `"$29.98"`) |
| `was_price` | number | **CA** | Original price before discount. May be `null` in US. |
| `was_price_str` | string | **CA** | Original price formatted. May be `null` in US. |
| `savings_amount` | number | **CA** | Discount amount. May be `null` in US. |
| `savings_percent` | number | **CA** | Discount percentage. May be `null` in US. |
| `savings_str` | string | **CA** | Discount text (e.g. `"Save $45.99"`). May be `null` in US. |
| `currency` | string | US, CA | Currency code. `"USD"` for US, `"CAD"` for CA. |
| `average_rating` | number | US, CA | Rating score (0–5) |
| `number_of_reviews` | number | US, CA | Total review count |
| `availability` | string | US, CA | Stock status (e.g. `"IN_STOCK"`) |
| `fulfillment_type` | string | US, CA | Fulfillment type (e.g. `"FC"`, `"MARKETPLACE"`) |
| `delivery_date` | string | US, CA | Estimated delivery date (ISO 8601) |
| `order_limit` | number | **CA** | Maximum order quantity. May be `null` in US. |
| `seller_name` | string | US, CA | Seller name |
| `seller_type` | string | **CA** | `"EXTERNAL"` or `"WALMART"`. May be `null` in US. |
| `wfs_enabled` | boolean | **CA** | Walmart Fulfillment Services. May be `null` in US. |
| `returnable` | boolean | **CA** | Whether the item is returnable. May be `null` in US. |
| `free_returns` | boolean | **CA** | Whether returns are free. May be `null` in US. |
| `badge_keys` | array | US, CA | Badge list (e.g. `["BESTSELLER", "FF_SHIPPING"]`) |
| `variant_count` | number | **CA** | Number of variants. May be `null` in US. |
| `category_path` | string | US, CA | **CA**: human-readable path (e.g. `"Electronics > Smart Watches"`). **US**: raw ID path (e.g. `"0:3944:1229723"`). |
| `is_sponsored` | boolean | US, CA | Whether the product is a sponsored ad |
| `market` | string | US, CA | Source market (`"US"` or `"CA"`) |

#### Example Output

```json
{
  "id": "4KBY87WGMT36",
  "us_item_id": "2OSGTAGB7F13",
  "offer_id": "57B969C16AAE3153BD180210E90BC9A1",
  "seller_id": "4F0B00CD8928401D9109F16263E5FD2B",
  "name": "Samsung Galaxy Watch8 Classic 46mm BT",
  "brand": "Samsung",
  "class_type": "VARIANT",
  "short_description": "The new Galaxy Watch8 Classic is more than a watch...",
  "canonical_url": "https://www.walmart.ca/en/ip/Samsung-Galaxy-Watch8-Classic-46mm-BT/2OSGTAGB7F13",
  "thumbnail_url": "https://i5.walmartimages.com/asr/7b7c8007-...",
  "all_images": ["https://i5.walmartimages.com/asr/..."],
  "current_price": 370.49,
  "current_price_str": "$370.49",
  "was_price": 416.48,
  "was_price_str": "$416.48",
  "savings_amount": 45.99,
  "savings_percent": null,
  "savings_str": "Save $45.99",
  "currency": "USD",
  "average_rating": 4.5926,
  "number_of_reviews": 189,
  "availability": "IN_STOCK",
  "fulfillment_type": "FC",
  "delivery_date": "2026-06-02T19:00:00.000Z",
  "order_limit": 9,
  "seller_name": "Gadget Source",
  "seller_type": "EXTERNAL",
  "wfs_enabled": true,
  "returnable": true,
  "free_returns": false,
  "badge_keys": ["REDUCED_PRICE"],
  "variant_count": 3,
  "category_path": "Electronics > Wearable Technology > Smart Watches",
  "is_sponsored": true
}
```

***

### Notes

- **Markets**: `US` = walmart.com (USD), `CA` = walmart.ca (CAD). Default is `US`.
- **No authentication required.** Session cookies are automatically issued on first request.
- **Page size**: 40 per request (web default). Each page may include sponsored products.
- **Max collectible**: `max_items` is capped at 400.
- **Sponsored products** are included in results and flagged via `is_sponsored: true`. Filter them out if needed.

# Actor input Schema

## `market` (type: `string`):

Target Walmart market. US = walmart.com (USD), CA = walmart.ca (CAD).

## `keyword` (type: `string`):

The keyword to search for on Walmart Canada (e.g. "galaxy watch").

## `cat_id` (type: `string`):

Filter results by category (CA) or department (US). CA: copy the catId value from the walmart.ca URL (e.g. '10007' or '10007\_20127'). US: copy the catId value from the walmart.com URL (e.g. '3944'). Leave empty to search across all categories.

## `sort` (type: `string`):

Sort order for search results.

## `max_items` (type: `integer`):

Maximum number of products to collect. Cannot exceed 400.

## Actor input object example

```json
{
  "market": "US",
  "keyword": "galaxy watch",
  "sort": "best_match",
  "max_items": 40
}
```

# Actor output Schema

## `api` (type: `string`):

REST API endpoint to download the dataset programmatically.

# 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 = {
    "market": "US",
    "keyword": "galaxy watch",
    "cat_id": "",
    "sort": "best_match",
    "max_items": 40
};

// Run the Actor and wait for it to finish
const run = await client.actor("crw/walmart-products-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 = {
    "market": "US",
    "keyword": "galaxy watch",
    "cat_id": "",
    "sort": "best_match",
    "max_items": 40,
}

# Run the Actor and wait for it to finish
run = client.actor("crw/walmart-products-scraper").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 '{
  "market": "US",
  "keyword": "galaxy watch",
  "cat_id": "",
  "sort": "best_match",
  "max_items": 40
}' |
apify call crw/walmart-products-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Walmart Products Scraper",
        "description": "Scrape product search results from Walmart US (walmart.com) and Canada (walmart.ca) by keyword or category. Extract product name, price, discount, rating, images, availability, delivery date, and seller details. Supports sorting and category/department filters for targeted data collection.",
        "version": "0.0",
        "x-build-id": "hqsyeC2H8XnYfti3V"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crw~walmart-products-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crw-walmart-products-scraper",
                "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/crw~walmart-products-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crw-walmart-products-scraper",
                "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/crw~walmart-products-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crw-walmart-products-scraper",
                "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": [
                    "keyword"
                ],
                "properties": {
                    "market": {
                        "title": "Market",
                        "enum": [
                            "US",
                            "CA"
                        ],
                        "type": "string",
                        "description": "Target Walmart market. US = walmart.com (USD), CA = walmart.ca (CAD).",
                        "default": "US"
                    },
                    "keyword": {
                        "title": "Search keyword",
                        "type": "string",
                        "description": "The keyword to search for on Walmart Canada (e.g. \"galaxy watch\")."
                    },
                    "cat_id": {
                        "title": "Category / Department ID (optional)",
                        "type": "string",
                        "description": "Filter results by category (CA) or department (US). CA: copy the catId value from the walmart.ca URL (e.g. '10007' or '10007_20127'). US: copy the catId value from the walmart.com URL (e.g. '3944'). Leave empty to search across all categories."
                    },
                    "sort": {
                        "title": "Sort order",
                        "enum": [
                            "best_match",
                            "price_low",
                            "price_high"
                        ],
                        "type": "string",
                        "description": "Sort order for search results.",
                        "default": "best_match"
                    },
                    "max_items": {
                        "title": "Maximum number of items",
                        "minimum": 1,
                        "maximum": 400,
                        "type": "integer",
                        "description": "Maximum number of products to collect. Cannot exceed 400.",
                        "default": 40
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
