# Amazon Search Autocomplete Scraper (`pintostudio/amazon-search-autocomplete-scraper`) Actor

The Amazon Search Autocomplete Actor is a web scraping tool deployed on the Apify platform that retrieves search suggestions from Amazon's autocomplete

- **URL**: https://apify.com/pintostudio/amazon-search-autocomplete-scraper.md
- **Developed by:** [Pinto Studio](https://apify.com/pintostudio) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Security:** Limited permissions
- **Stats:** 64 total users, 5 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$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/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

## Amazon Search Autocomplete Actor

The Amazon Search Autocomplete Actor is a web scraping tool deployed on the Apify platform that retrieves search suggestions from Amazon's autocomplete. This actor mimics the autocomplete functionality you see when typing in Amazon's search box, providing valuable keyword insights for SEO, market research, and product discovery.

### Overview

This actor extracts search suggestions that Amazon provides when users start typing in the search box. It's particularly useful for:

- Keyword research and SEO optimization
- Understanding popular search terms in specific markets
- Product research and market analysis
- Content strategy development
- Competitive analysis

### Input Parameters

#### Required Parameters

- **query** (string, required): The search term or keywords you want to get suggestions for
  - Example: "shoes", "laptop", "coffee maker"
  - This is the base query that Amazon will use to generate autocomplete suggestions

#### Optional Parameters

- **countryIso** (string, optional): Two-letter ISO country code to target specific Amazon regional sites
  - Default: "us" (United States)
  - Supported countries:
    - `au` - Australia
    - `be` - Belgium
    - `br` - Brazil
    - `ca` - Canada
    - `cn` - China
    - `eg` - Egypt
    - `fr` - France
    - `de` - Germany
    - `in` - India
    - `ie` - Ireland
    - `it` - Italy
    - `jp` - Japan
    - `mx` - Mexico
    - `nl` - Netherlands
    - `pl` - Poland
    - `sa` - Saudi Arabia
    - `sg` - Singapore
    - `za` - South Africa
    - `es` - Spain
    - `se` - Sweden
    - `tr` - Turkey
    - `ae` - United Arab Emirates
    - `gb` - United Kingdom
    - `us` - United States

### Input Example

```json
{
  "query": "shoes",
  "countryIso": "us"
}
```

### Output Format

The actor returns an array of suggestion objects. Each suggestion contains the following fields:

#### Output Fields

- **suggType**: Type of suggestion (typically "KeywordSuggestion")
- **type**: Category of the suggestion (typically "KEYWORD")
- **value**: The actual suggested search term
- **refTag**: Amazon's internal reference tag for the suggestion
- **candidateSources**: Source of the suggestion (e.g., "local")
- **strategyId**: Amazon's internal strategy identifier (e.g., "organic")
- **prior**: Priority score (typically 0)
- **ghost**: Boolean indicating if it's a ghost suggestion
- **help**: Boolean indicating if it's a help suggestion
- **queryUnderstandingFeatures**: Array of query understanding features with source and annotations

### Output Example

```json
[
  {
    "suggType": "KeywordSuggestion",
    "type": "KEYWORD",
    "value": "shoes",
    "refTag": "nb_sb_ss_i_1_5",
    "candidateSources": "local",
    "strategyId": "organic",
    "prior": 0,
    "ghost": false,
    "help": false,
    "queryUnderstandingFeatures": [
      {
        "source": "QU_TOOL",
        "annotations": []
      }
    ]
  },
  {
    "suggType": "KeywordSuggestion",
    "type": "KEYWORD",
    "value": "hoka shoes for woman",
    "refTag": "nb_sb_ss_i_2_5",
    "candidateSources": "local",
    "strategyId": "organic",
    "prior": 0,
    "ghost": false,
    "help": false,
    "queryUnderstandingFeatures": [
      {
        "source": "QU_TOOL",
        "annotations": []
      }
    ]
  }
]
```

### Use Cases

#### 1. Keyword Research

Use this actor to discover popular search terms related to your products or niche. The suggestions represent real user search patterns on Amazon.

#### 2. SEO Optimization

Identify long-tail keywords that people are actually searching for on Amazon to optimize your product listings and content.

#### 3. Market Research

Understand what variations and related terms people use when searching for products in your category.

#### 4. International Market Analysis

Use different country codes to see how search behavior varies across different Amazon marketplaces.

#### 5. Content Strategy

Generate ideas for blog posts, product descriptions, and marketing content based on actual search behavior.

### Technical Details

#### Dependencies

- **Apify SDK**: Core framework for building Apify actors
- **Axios**: HTTP client for making API requests
- **Custom Helper Functions**: Internal functions for processing Amazon's autocomplete API

#### Performance

- The actor processes one query at a time
- Response time depends on Amazon's API response time
- Typically returns 10+ suggestions per query

#### Data Storage

- Results are automatically stored in Apify's dataset
- Output is also saved as a named value called 'output'
- Data can be exported in various formats (JSON, CSV, Excel, etc.)

### Error Handling

The actor includes comprehensive error handling:

- Network timeouts and connection errors
- Invalid country codes
- Empty or malformed responses
- Rate limiting from Amazon

If an error occurs, the actor will log the error message and terminate gracefully.

### Best Practices

1. **Reasonable Query Frequency**: Don't overwhelm Amazon's servers with too many requests
2. **Relevant Queries**: Use meaningful search terms that relate to actual products
3. **Country-Specific Research**: Use appropriate country codes for your target markets
4. **Data Analysis**: Combine results with other tools for comprehensive keyword research

### Support and Troubleshooting

If you encounter issues:

1. Check that your input parameters are correctly formatted
2. Verify that the country code is supported
3. Ensure your query string is not empty
4. Check Apify platform status for any service disruptions

***

### Support

If you have any questions or encounter any issues, please consult the Apify documentation or reach out to us through one of the following channels:

- **Telegram**: [@pintoflow](https://t.me/pintoflow)
- **Email**: <pintoflowpt@gmail.com>
- **Apify Platform**: You can also contact us directly through this platform.

***

# Actor input Schema

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

Keywords to search for products

## `countryIso` (type: `string`):

Two-letter country ISO code for Amazon regional site

## Actor input object example

```json
{
  "query": "shoes",
  "countryIso": "us"
}
```

# 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 = {
    "query": "shoes"
};

// Run the Actor and wait for it to finish
const run = await client.actor("pintostudio/amazon-search-autocomplete-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 = { "query": "shoes" }

# Run the Actor and wait for it to finish
run = client.actor("pintostudio/amazon-search-autocomplete-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 '{
  "query": "shoes"
}' |
apify call pintostudio/amazon-search-autocomplete-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pintostudio/amazon-search-autocomplete-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/R2dc8xvTxpNbQOtTq/builds/ozR0UkJQgtqEZSixI/openapi.json
