# Walmart Search API — Local Prices & Listings (`gauravlabs/walmart-search-api`) Actor

Search Walmart US by keyword and store or ZIP. Get product IDs, prices, ratings, sellers, fulfillment and sponsored flags. One request includes all returned listings.

- **URL**: https://apify.com/gauravlabs/walmart-search-api.md
- **Developed by:** [Gaurav Kumar Choudhary](https://apify.com/gauravlabs) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 3 total users, 2 monthly users, 89.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 successful keyword requests

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/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 Search API — Local Prices & Listings

### At a glance

- Collect: One store-scoped listing page for each keyword.
- Input: use the runnable example below or the prefilled Input form.
- Output: the default dataset supports JSON/CSV/Excel export; see output modes below.
- Billing: $2 per 1,000 successful keyword requests, including all exported rows for each request. No startup fee. Platform usage may be additional.
- Limits: No supported page-number input. hasMorePages does not mean this Actor can retrieve every page.

Search Walmart US by keyword and store or ZIP. Get product IDs, prices, ratings, sellers, fulfillment and sponsored flags. One request includes all returned listings.

### Quick start

```json
{
  "queries": [
    "milk"
  ],
  "storeId": "1735",
  "maxRequests": 1
}
```

Provide exactly one of storeId or zipcode. Keep ZIP codes as strings. Inputs are validated before any request. Duplicate inputs are skipped, and maxRequests caps unique requests per run.

### Output and exports

Results are stored in the default dataset, exportable as JSON, CSV or Excel. Store context and UTC fetch timestamps accompany records. SUMMARY in the key-value store reports successful requests, results, safe failures and budget stops. Partial batches retain completed results.

### Billing

Launch price: **$2 per 1,000 successful keyword requests, including valid empty searches. All delivered listings from that request are included; this is not per-result billing**. No startup fee or monthly rental. Failed or invalid responses are not billed. Consult the live Pricing tab for current pricing and platform terms. Set a maximum total charge per run to control spending.

### Limitations

The current service returns one results page per keyword. Pagination indicators are preserved, but this Actor does not promise to retrieve additional pages. Sponsored filtering and a per-query row cap are supported; these do not reduce the number of billed requests. No product-detail enrichment or review text is included.

Prices and availability are point-in-time signals for the returned store context, not guaranteed checkout prices or verified stock quantities. Availability depends on Walmart and supported store coverage. No Walmart login or customer API key is required.

### Support

Open an issue with your run ID, input example and expected behavior—never include credentials. For custom integrations or other data needs, contact the developer through the profile contact details.

Independent tool, not affiliated with or endorsed by Walmart.

### Minimal API example

Store your own Apify token in `APIFY_TOKEN`; never paste it into public input or code. This example uses the same small input as the prefilled form.

```python
import os
import requests

response = requests.post(
    "https://api.apify.com/v2/acts/gauravlabs~walmart-search-api/run-sync-get-dataset-items",
    headers={"Authorization": "Bearer " + os.environ["APIFY_TOKEN"]},
    json={"queries":["milk"],"storeId":"1735"},
    timeout=300,
)
response.raise_for_status()
print(response.json())
```

For large batches, start an asynchronous run with `/runs`, wait for its final status, and retrieve its default dataset. HTTP success when starting a run does not prove the extraction succeeded.

#### Minimal output shape (illustrative)

The following shows one documented field, not a fresh result or a promised yield. Inspect the output reference above for the complete schema.

```json
{
  "stockStatus": "unknown"
}
```

### Practical workflow and accuracy notes

The endpoint documents no page-number parameter. `page`, `totalPages` and `hasMorePages` are descriptive metadata, not a guarantee of pageable coverage. `maxResultsPerQuery` caps saved rows, not retrieval size. Take an item_id into our [Walmart Product API](https://apify.com/gauravlabs/walmart-product-api) for detail enrichment using the same store. `requestRetries` defaults to one bounded retry; a successful keyword is charged once, not once per attempt.

# Actor input Schema

## `queries` (type: `array`):

One keyword per request. Duplicate keywords are skipped.

## `storeId` (type: `string`):

Provide this OR zipcode, not both. Example 1735. Clear this field before searching by ZIP code.

## `zipcode` (type: `string`):

Provide this OR storeId, not both. Clear storeId when using ZIP. Keep leading zeros.

## `maxRequests` (type: `integer`):

Hard cap on unique billable input requests, not dataset rows.

## `requestTimeoutSecs` (type: `integer`):

Timeout per attempt. A retry can approximately double a single input request duration.

## `maxResultsPerQuery` (type: `integer`):

Cap returned rows for each keyword. The current endpoint returns a single page; no pagination is promised.

## `excludeSponsored` (type: `boolean`):

Drop listings explicitly marked as sponsored. A successful search request remains one billable event.

## `requestRetries` (type: `integer`):

Retry at most once for unavailable or unusable responses. Each successful input is charged once. Set 0 to disable Actor retries.

## Actor input object example

```json
{
  "queries": [
    "milk"
  ],
  "storeId": "1735",
  "maxRequests": 10,
  "requestTimeoutSecs": 90,
  "maxResultsPerQuery": 100,
  "excludeSponsored": false,
  "requestRetries": 1
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "queries": [
        "milk"
    ],
    "storeId": "1735"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gauravlabs/walmart-search-api").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 = {
    "queries": ["milk"],
    "storeId": "1735",
}

# Run the Actor and wait for it to finish
run = client.actor("gauravlabs/walmart-search-api").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 '{
  "queries": [
    "milk"
  ],
  "storeId": "1735"
}' |
apify call gauravlabs/walmart-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gauravlabs/walmart-search-api"
        }
    }
}
```

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/2qAeezgebdehDNbvq/builds/2d9GTHa2v1WKpSbaB/openapi.json
