# Amazon Product Scraper (`neuro-scraper/amazon-per-result-scraper`)

🛒 **Amazon Product Scraper** — ⚡ Instantly fetch product data from Amazon by keyword! Get 📦 titles, 💲 prices, ⭐ reviews, 🖼️ images & more — all in seconds. Perfect for 📊 market research, 🧠 trend tracking, and 💼 pricing analysis. **Fast, secure & ready to run!**

- **URL**: https://apify.com/neuro-scraper/amazon-per-result-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Automation, E-commerce, Other
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 results

This Actor is paid per result. You are not charged for the Apify platform usage, but only a fixed price for dataset items the Actor outputs.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-result

# README

## Amazon Product Scraper

**One-line hero:** Run a production-ready actor that searches Amazon by keywords and delivers clean product records — instant insights, secure by design.

***

📖 **Short summary**

A plug-and-play Actor that performs keyword searches on Amazon, enriches the results with product page details, and exports a clean dataset ready for analysis. Designed for fast, repeatable runs in the Apify Console — no developer setup required.

***

💡 **Use cases / When to use**

- Market research: compare prices, reviews, and availability across search results.
- Competitor monitoring: track product listings and price changes for a set of queries.
- Lead collection for product feeds: gather thumbnails, product URLs, and metadata.
- Quick audits: get a snapshot of top search results for given keywords.

***

⚡ **Quick Start (Console — one-click)**

1. Open the Actor in Apify Console.
2. Paste a JSON input containing `queries` (single string or array). See `input.example.json` for a minimal example.
3. Click **Run** — the Actor runs and saves results to the default dataset and an output file.

***

⚙️ **Quick Start (CLI + API)**

**CLI**

```bash
apify run --actor <OWNER>/<ACTOR_NAME> --input input.example.json
```

**API (Python — apify-client)**

```python
from apify_client import ApifyClient

client = ApifyClient('<APIFY_TOKEN>')
run = client.actor_runs().start('<OWNER>/<ACTOR_NAME>', input={
    'queries': ['wireless earbuds', 'bluetooth speaker'],
    'concurrency': 8,
})
print('Started run:', run['id'])
```

> Replace `<APIFY_TOKEN>` and `<OWNER>/<ACTOR_NAME>` with your values.

***

📝 **Inputs (fields & schema)**

```json
{
  "queries": ["string"] ,
  "concurrency": 8
}
```

- `queries` — **required**. A single search string or an array of search keywords (e.g. `"wireless earbuds"` or `["wireless earbuds","bluetooth speaker"]`).
- `concurrency` — **optional**. Number of concurrent product page fetches. Defaults to `8`.

***

⚙️ **Configuration**

| 🔑 Name     | 📝 Type        | ❓ Required  | ⚙️ Default                  | 📌 Example                    | 🧠 Notes                                      |
| ----------- | -------------- | ----------- | --------------------------- | ----------------------------- | --------------------------------------------- |
| queries     | array / string | ✅ Yes       | None                        | `["wireless earbuds"]`        | One or more search keywords                   |
| concurrency | integer        | ⚙️ Optional | `8`                         | `4`                           | Controls concurrent product fetches           |
| outputFile  | string         | ⚙️ Optional | `amazon.search.result.json` | `"amazon.search.result.json"` | Local file written in run (pushed to dataset) |

Example Console setup: Paste `["wireless earbuds"]` into the **Input** field and click **Run Actor**.

***

📄 **Outputs (Dataset / KV examples)**

The Actor pushes a JSON array of product objects to the default dataset and also writes a local file named `amazon.search.result.json`. Each item includes fields such as:

- `asin`, `title`, `url`, `thumbnail`, `images`, `price`, `currency`, `stars`, `review_count`, `brand_name`, `availability`, `description`, `categories`, `search_keyword`

**Example output (single record)**

```json
{
  "asin": "B07XXXXX",
  "title": "Wireless Earbuds — Example Model",
  "url": "https://www.amazon.com/...","
  "thumbnail": "https://...jpg",
  "images": ["https://...jpg"],
  "price": "$59.99",
  "currency": "$",
  "stars": 4.5,
  "review_count": 1234,
  "brand_name": "ExampleBrand",
  "availability": "In Stock",
  "description": "Key bullets...",
  "categories": "Electronics > Headphones",
  "search_keyword": "wireless earbuds"
}
```

***

🔑 **Environment variables**

- `<APIFY_TOKEN>` — required when starting runs via API/CLI. **Do not** hardcode tokens; store them as secrets in your environment/Console.

> The Actor itself does not require custom environment variables to run in Console. The file `amazon.search.result.json` is produced inside the run and its contents are pushed to the default dataset.

***

▶️ **How to Run**

**Console**

- Paste input, click **Run**. Results available under **Dataset** after completion.

**CLI**

```bash
apify run --actor <OWNER>/<ACTOR_NAME> --input input.example.json
```

**API**

- Use the snippet above (Python). Use `<APIFY_TOKEN>` stored securely.

***

⏰ **Scheduling & Webhooks**

- Schedule periodic runs directly in the Console (cron-style schedules available).
- To automate post-run workflows, subscribe a webhook on **run:finished** to receive dataset IDs or download links.

***

🕾️ **Logs & Troubleshooting**

- If the run returns zero results, try broader keywords or confirm the search term is supported in the target marketplace.
- If product pages fail intermittently, reduce `concurrency` or add delays between requests.
- Check run logs in Console for page-timeout or selector changes — adjust keyword strategy accordingly.

Common fixes:

- Increase `concurrency` for faster runs (careful: may trigger rate limits).
- Lower `concurrency` or add retries/backoff if you see frequent fetch failures.

***

🔒 **Permissions & Storage Notes**

- Results are pushed to the Actor default dataset and written to a run-local JSON file named `amazon.search.result.json`.
- Keep API tokens and proxy credentials in Console secrets — never in actor input plain text.

***

🔟 **Changelog / Versioning**

- `v1.0.0` — Initial release: keyword search + product enrichment; dataset push and local JSON output.

***

🖌 **Notes / TODOs**

- TODO: Consider making `headless` and `request_delay` configurable via inputs (keeps Console simple). — Reason: expose throttling/stealth knobs for advanced users.
- TODO: Consider proxy rotation for large-scale scraping.

***

🌍 **Proxy Configuration**

This Actor performs network requests. If you need to route traffic through proxies, use either the built-in Apify Proxy via the Console or supply custom proxy credentials.

**Enable Apify Proxy (Console)**

- In the Actor configuration panel → toggle **Use Apify Proxy**.

**Custom proxy (example)**

- Supply proxy credentials as environment-level secrets and configure the run to export them to the Actor. Use the following placeholders in your run environment when needed:

```
HTTP_PROXY=<PROXY_USER:PASS@HOST:PORT>
HTTPS_PROXY=<PROXY_USER:PASS@HOST:PORT>
```

**Notes**

- Store `<PROXY_USER:PASS@HOST:PORT>` as a secret in Console — never place credentials inside `input` JSON.
- TODO: Consider proxy rotation for large-scale scraping.

***

📚 **References**

- Apify Actors README guidelines — <https://docs.apify.com/actors/README>
- Apify Input/Output model — <https://docs.apify.com/actors/input-output>
- Apify CLI & API usage — <https://docs.apify.com/tools/cli>

***

🤔 **What I inferred from main.py**

- The Actor accepts `queries` (single or array) and an optional `concurrency` value.
- For each keyword it renders the search results page (headless browser) to gather initial hits, then fetches individual product pages (HTTP client) to enrich details.
- Outputs are pushed to the default dataset and a run-local JSON file named `amazon.search.result.json`.
- Built-in delays, retries, and concurrency controls are used to reduce failures. Some tuning may be necessary for large-scale runs.

***

## input.example.json

```json
{
  "queries": [
    "wireless earbuds",
    "bluetooth speaker"
  ],
  "concurrency": 8
}
```

## CONFIG.md

**Optional configuration notes**

- `concurrency` — lower values reduce request load and retry pressure.
- `queries` — can be a single string or an array; use arrays for batch runs.
- `APIFY_TOKEN` — always set as a secret in your environment when using CLI/API.

**Placeholders**

- Replace secrets with `<APIFY_TOKEN>` and `<PROXY_USER:PASS@HOST:PORT>`.
- Fields marked `TODO:` indicate inferred options that were not explicitly exposed as inputs in the source.

# Actor input Schema

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

Amazon search keywords or direct product URLs.

## `maxSearch` (type: `integer`):

Maximum number of search result pages to scan (0 or empty = no limit).

## `maxResults` (type: `integer`):

Maximum number of products to return (0 = no limit).

## `concurrency` (type: `integer`):

Number of parallel HTTP requests for products/reviews.

## `proxy` (type: `object`):

Apify or custom proxy configuration. The actor automatically rotates proxies for each request.

## Actor input object example

```json
{
  "queries": [
    "laptop",
    "headphones",
    "https://www.amazon.com/dp/B08N5WRWNW"
  ],
  "maxSearch": 0,
  "maxResults": 0,
  "concurrency": 8
}
```

# 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": [
        "laptop",
        "headphones",
        "https://www.amazon.com/dp/B08N5WRWNW"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/amazon-per-result-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 = { "queries": [
        "laptop",
        "headphones",
        "https://www.amazon.com/dp/B08N5WRWNW",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/amazon-per-result-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 '{
  "queries": [
    "laptop",
    "headphones",
    "https://www.amazon.com/dp/B08N5WRWNW"
  ]
}' |
apify call neuro-scraper/amazon-per-result-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Amazon Product Scraper",
        "description": "🛒 **Amazon Product Scraper** — ⚡ Instantly fetch product data from Amazon by keyword! Get 📦 titles, 💲 prices, ⭐ reviews, 🖼️ images & more — all in seconds. Perfect for 📊 market research, 🧠 trend tracking, and 💼 pricing analysis. **Fast, secure & ready to run!**",
        "version": "0.0",
        "x-build-id": "gbbcyBrdXz1nqoon3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/neuro-scraper~amazon-per-result-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-neuro-scraper-amazon-per-result-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/neuro-scraper~amazon-per-result-scraper/runs": {
            "post": {
                "operationId": "runs-sync-neuro-scraper-amazon-per-result-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/neuro-scraper~amazon-per-result-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-neuro-scraper-amazon-per-result-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": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "Queries",
                        "type": "array",
                        "description": "Amazon search keywords or direct product URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxSearch": {
                        "title": "Max Search Pages",
                        "type": "integer",
                        "description": "Maximum number of search result pages to scan (0 or empty = no limit).",
                        "default": 0
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "type": "integer",
                        "description": "Maximum number of products to return (0 = no limit).",
                        "default": 0
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "type": "integer",
                        "description": "Number of parallel HTTP requests for products/reviews.",
                        "default": 8
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify or custom proxy configuration. The actor automatically rotates proxies for each request."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
