# Walmart Keyword Suggestions Scraper (`searchapi/walmart-keyword-suggest`) Actor

Retrieve public Walmart typeahead suggestions for one or more seed keywords with API interception and a visible-list fallback.

- **URL**: https://apify.com/searchapi/walmart-keyword-suggest.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 does Walmart Keyword Suggestions Scraper do?

This Actor expands seed terms with **public suggestions shown by Walmart's search typeahead**. It types each query into the Walmart homepage search box, reads a validated first-party typeahead response when available, and falls back to the visible suggestion list. It does not search product listings or promise a fixed number of suggestions. [Walmart](https://www.walmart.com/)

### Observed Chrome example

The supplied Chrome observation showed the Walmart homepage with typeahead open for `phone`. It reported 26 suggestions: 16 clickable category links in the `Phone Selections` group and 10 query links. This is an observation summary, **not an Actor dataset row or a claim that this Actor was run**.

```json
{
  "query": "phone",
  "visibleSuggestionCount": 26,
  "categoryGroup": "Phone Selections",
  "categoryLinkCount": 16,
  "categoryExamples": [
    "Shop Wireless Deals",
    "Straight Talk Phones",
    "iPhone",
    "Unlocked Cell Phones"
  ],
  "querySuggestions": [
    "phones",
    "phone holder for car",
    "phone charger",
    "phone resold",
    "phone holder",
    "phone case",
    "phone stand",
    "phone deals",
    "phone mount for car",
    "phone mount"
  ]
}
```

The default per-query limit is 50 so this observed 26-row list fits under that cap. Actual suggestions and counts can change by query, time, location, and Walmart's page response.

### How to scrape Walmart suggestions

1. Open the Actor's **Input** tab.
2. Enter one `query`, or a `queries` list to run several seeds.
3. Adjust the output and browser limits if needed, then run the Actor.
4. Open **Storage → Dataset** to inspect or download the suggestion records.

### What data can the Actor extract?

| Field | Meaning |
| --- | --- |
| `query`, `queryPosition`, `rank` | Seed text, its one-based position, and suggestion position for that seed. |
| `queryLength`, `queryWordCount`, `suggestionLength`, `suggestionWordCount` | Text lengths in Unicode code points and whitespace-delimited word counts. |
| `startsWithQuery`, `completionText` | Case-insensitive prefix match and the suffix after the query when that match exists. `completionText` is omitted for non-prefix suggestions. |
| `suggestion`, `suggestionType` | Visible suggestion text and its type when exposed by the response or identifiable from its Walmart destination. API types are preserved; DOM links are labeled `QUERY` for search destinations and `NAVIGATION` for other Walmart destinations. |
| `suggestionGroup` | Group label when an accessible group name or heading is present in the DOM. |
| `subType`, `departmentName`, `departmentId`, `description` | Optional values only when provided by the typeahead response. |
| `imageUrl` | Optional image URL from the typeahead response or visible row. |
| `searchUrl` | A destination found in the source response or visible link; omitted when none is exposed. |
| `hasDestination`, `destinationHost`, `destinationPath`, `hasImage` | Availability flags and parsed host/path for destination and image metadata. Optional host/path are omitted when no valid destination was supplied. |
| `recordType`, `source`, `sourceEndpoint`, `extractionMethod`, `pageType`, `scrapedAt` | Record discriminator, Walmart provenance, extraction path, source page type when returned, and collection time. `pageType` is omitted when unavailable. |

### Input

Example input for one query:

```json
{
  "query": "phone",
  "maxSuggestionsPerQuery": 50,
  "maxItems": 100,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

`queries`, when it is a non-empty list, replaces `query`. Duplicate seeds are removed after trimming and whitespace normalization. At most 50 seeds of 120 characters each are accepted.

| Input | Default | Allowed values / behavior |
| --- | --- | --- |
| `query` | `phone` | One seed, 1–120 characters after trimming. |
| `queries` | — | Optional list, up to 50 strings of 1–120 characters; takes precedence over `query`. |
| `maxSuggestionsPerQuery` | `50` | Integer from 1 to 50. |
| `maxItems` | `100` | Integer from 1 to 2500; global output cap across seeds. |
| `maxConcurrency` | `2` | Integer from 1 to 10 concurrent browser pages. |
| `maxRequestRetries` | `2` | Integer from 0 to 5. |
| `navigationTimeoutSecs` | `30` | Integer from 10 to 120 seconds. |
| `requestHandlerTimeoutSecs` | `75` | Integer from 20 to 180 seconds per seed. |
| `suggestionWaitMs` | `2500` | Integer from 500 to 10000 milliseconds after typing. |
| `proxyConfiguration` | Direct access | Optional Apify Proxy configuration; the default is `{ "useApifyProxy": false }`. Network choice can affect availability and results. |

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

The dataset schema declares 28 fields. It contains one record per retained suggestion. API-only details, DOM group labels, destination details, and completion text are optional when their source value is absent. The Chrome observation above is the concrete example available for this update; no Actor run was made, so no dataset record is presented as a live Actor result.

### Tips, cost, and limitations

The Actor uses Apify compute for browser pages. More seeds, higher concurrency, longer waits, retries, and timeouts can increase run duration and compute use; the exact cost depends on the selected Apify plan and actual run. There is no fixed per-suggestion price stated here. `maxSuggestionsPerQuery` limits each seed, while `maxItems` caps the complete dataset.

The supplied observation confirms what was visible in headed Chrome only. It does not establish that an automated Actor session can access the same page, nor does it expose the category links' full text or destination URLs. The Actor has not been run for this change. Walmart can change its markup or restrict automated sessions; an empty result is not proof that the visible browser page had no suggestions. The DOM fallback records group labels only when they are exposed as accessible group names or headings. It does not invent missing URLs, group labels, or page-type metadata, and it does not solve challenges or bypass access controls.

### FAQ, support, and responsible use

If a run returns no records or fails, review the run log and Walmart page availability; do not treat the observed Chrome snapshot as proof of an Actor run. Use the Actor's Issues tab for bugs or feature requests and include a run ID and concise summary. The Actor is not affiliated with Walmart. Follow Walmart's terms, applicable access limits, and relevant law. Use public information responsibly and avoid collecting personal information without a lawful basis.

# Actor input Schema

## `query` (type: `string`):

One Walmart keyword to expand when queries is empty.

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

Optional list of up to 50 keywords. When supplied, this replaces query.

## `maxSuggestionsPerQuery` (type: `integer`):

Maximum normalized records retained for each seed. The default cap of 50 accommodates the 26 rows observed for the phone query.

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

Global output limit across all seeds.

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

Maximum browser pages processed at once.

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

Retries for temporary navigation, proxy, browser, and rate-limit failures.

## `navigationTimeoutSecs` (type: `integer`):

Maximum seconds allowed for each Walmart page navigation.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum seconds allowed for each complete seed task.

## `suggestionWaitMs` (type: `integer`):

Time to wait for Walmart's typeahead response after typing.

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

Use no proxy, Apify Proxy groups/country selection, or custom proxy URLs. Direct access is the verified default.

## Actor input object example

```json
{
  "query": "phone",
  "maxSuggestionsPerQuery": 50,
  "maxItems": 100,
  "maxConcurrency": 2,
  "maxRequestRetries": 2,
  "navigationTimeoutSecs": 30,
  "requestHandlerTimeoutSecs": 75,
  "suggestionWaitMs": 2500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/walmart-keyword-suggest").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/walmart-keyword-suggest").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 '{}' |
apify call searchapi/walmart-keyword-suggest --silent --output-dataset

```

## MCP server setup

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

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/fIIabpbcBlmkXDAfK/builds/eynjDlIbFBIdsMDsf/openapi.json
