# Walmart Data Scraper — Search & Product Pages (`thenetaji/walmart-data-scraper`) Actor

Both halves of Walmart in one Actor. Search by keyword to export the products a term returns, or paste product links to read those pages in full. Pick the mode, fill in that section, and every row comes back as the same structured record.

- **URL**: https://apify.com/thenetaji/walmart-data-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** E-commerce, Business, Automation
- **Features:** Limited permissions
- **Stats:** 37 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.15 / 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.
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

## Walmart Data Scraper

Both halves of Walmart in one Actor. Search by keyword to export the products a term returns, or paste product links to read those pages in full. `scraperType` picks the mode; fill in that mode's section and leave the other empty.

```json
{
  "scraperType": "productsSearch",
  "keyword": "coffee maker",
  "maxItems": 100,
  "enrichProductDetails": false
}
```

```json
{
  "scraperType": "productDetail",
  "product_urls": [
    "https://www.walmart.com/ip/Mainstays-Black-12-Cup-Drip-Coffee-Maker/5162907971"
  ]
}
```

### Choosing a mode

`productsSearch` runs a keyword search and saves the products it returns. `productDetail` reads product pages you already have links for. Both write the same record shape, so a run of either drops into the same spreadsheet or database column-for-column — the difference is which fields are populated, described below.

### Accepted input

`scraperType` is required and is the first thing to set.

For `productsSearch`: `keyword` is the term to search for. `enrichProductDetails` adds the full product page to every search row, which is where `brand`, `model`, `upc`, `currency`, `return_policy` and `variants` come from; it makes one extra request per product and defaults to `false`.

For `productDetail`: `product_urls` takes one or more product page links in their full `/ip/<name>/<id>` form. A bare item ID is not accepted — Walmart's anti-bot gate rejects a link assembled from one, so an input that looked like it should work would fail upstream for a reason you could not see.

`maxItems` applies to both modes and bounds how many products are saved. It defaults to `100`; `0` disables the bound.

Each mode raises a clear error if its own identifier is missing, so a run started in the wrong mode tells you which field it wanted rather than returning nothing.

### Result fields

`item_id` is Walmart's item identifier and `url` is the product page link. `name`, `price`, `rating` and `review_count` describe the product; `price_info` holds every price Walmart publishes for it, including any was-price, savings, unit price and subscription pricing, with fields that do not apply returned as empty strings rather than omitted.

`seller_id` and `seller_name` identify who is selling it. Walmart's own listings carry a seller ID like any marketplace seller's and report `Walmart.com` as the name, so first-party and third-party offers are distinguishable. `availability` is the stock state as Walmart displays it, `fulfillment_title` is its shipping summary, `image_url` and `image_info` cover the imagery, and `category` is the Walmart category path.

`sponsored` records whether a search row is a paid placement. Walmart mixes sponsored listings into organic results, and they are kept rather than dropped so a run can count or filter them; a search that silently discarded them would misrepresent what the results page contains.

#### What each mode fills in

Search rows carry the fields above. `brand` is present but frequently `null` on a search row even where the product page records one, and `product` carries the complete listing record for anything not broken out into its own field.

Product pages additionally carry `brand` filled in, plus `model`, `upc`, `currency`, `return_policy`, `variants`, and `product_detail` — the complete product page record. Enabling `enrichProductDetails` on a search run adds exactly these to every row.

### Upgrading from 3.x

Version 4 is a rewrite. Earlier versions drove a browser inside the Actor; the work now runs on dedicated infrastructure, which is why this release is faster and no longer needs the memory a browser did.

The input changed shape: 3.x took one mode's fields flat, and 4.0 asks for `scraperType` first. A saved task carrying a 3.x input will not name a mode, so set `scraperType` on it once. Nothing else about the input moved — `keyword`, `product_urls`, `maxItems` and `enrichProductDetails` all mean what they meant.

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

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

Keyword to search Walmart products for.

## `enrichProductDetails` (type: `boolean`):

Add the full product page to every search row — model, UPC, every variant, the seller's storefront, and the return policy. This makes one extra request per product.

## `product_urls` (type: `array`):

One or more Walmart product page links, in their full /ip/<name>/<id> form. A bare item ID is not accepted — Walmart rejects links built from one.

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

Maximum number of products to save. Set 0 for no limit.

## Actor input object example

```json
{
  "scraperType": "productsSearch",
  "keyword": "coffee maker",
  "enrichProductDetails": false,
  "product_urls": [
    "https://www.walmart.com/ip/Great-Value-Coffee/12345678"
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "scraperType": "productsSearch",
    "keyword": "coffee maker",
    "product_urls": [
        "https://www.walmart.com/ip/Mainstays-Black-12-Cup-Drip-Coffee-Maker/5162907971"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/walmart-data-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 = {
    "scraperType": "productsSearch",
    "keyword": "coffee maker",
    "product_urls": ["https://www.walmart.com/ip/Mainstays-Black-12-Cup-Drip-Coffee-Maker/5162907971"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/walmart-data-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 '{
  "scraperType": "productsSearch",
  "keyword": "coffee maker",
  "product_urls": [
    "https://www.walmart.com/ip/Mainstays-Black-12-Cup-Drip-Coffee-Maker/5162907971"
  ],
  "maxItems": 20
}' |
apify call thenetaji/walmart-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/walmart-data-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/ia9ELp4coVQqW0RrS/builds/09o8uBzLwxX5SYpOi/openapi.json
