# Amazon Product Extractor (`mighty_monk/amazon-product-extractor`) Actor

Extract product details from Amazon product URLs (ASIN pages): title, price, currency, rating, review count, availability, brand, images, feature bullets, description, category breadcrumbs, ASIN, and URL. Cheerio-based with proxy support, retries, and graceful captcha handling.

- **URL**: https://apify.com/mighty\_monk/amazon-product-extractor.md
- **Developed by:** [Harsh](https://apify.com/mighty_monk) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 product extracteds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Amazon Product Extractor

**Extract structured product data from Amazon ASIN pages — title, price, rating, images, bullets, and more.**

Amazon Product Extractor is an Apify Actor built with **TypeScript** and **Crawlee CheerioCrawler**. Point it at Amazon product URLs (or bare ASINs), and get clean JSON records plus a CSV export and Markdown summary. Designed for proxy use, polite rate limiting, retries, and graceful handling of captcha / blocked pages.

> **Note:** Amazon aggressively blocks datacenter IPs. For production, enable **Apify Proxy** (preferably residential). Local runs without a proxy often receive captcha pages — the Actor records an `error` field instead of crashing. Unit tests cover HTML parsing with fixtures so the pipeline stays reliable even when live Amazon is blocked.

### Features

- **ASIN parsing** — supports `/dp/ASIN`, `/gp/product/ASIN`, query params, and bare ASINs
- **Rich product fields** — title, brand, price, list price, currency, rating, review count, availability, images, feature bullets, description, category breadcrumbs
- **Multi-marketplace** — US, UK, DE, FR, IT, ES, CA, JP, IN, AU, and more via `country` or URL host
- **Deduplication** — unique products by ASIN per run
- **Captcha resilience** — blocked pages produce dataset rows with `error`, not hard failures
- **Retries & rate limiting** — configurable concurrency, retries, and per-request delay + jitter
- **Proxy-ready** — Apify Proxy configuration (recommended for all real Amazon traffic)
- **Exports** — default dataset (JSON), `PRODUCTS.csv`, and `SUMMARY.md` in the key-value store
- **Cheerio-first** — fast HTTP HTML parsing; Playwright is not required (and may still hit captchas without good proxies)

### Input

| Field                | Type       | Required | Default        | Description                         |
| -------------------- | ---------- | -------- | -------------- | ----------------------------------- |
| `productUrls`        | `string[]` | Yes      | —              | Amazon product URLs or bare ASINs   |
| `country`            | `string`   | No       | `US`           | Default marketplace for bare ASINs  |
| `maxConcurrency`     | `integer`  | No       | `2`            | Parallel page fetches (keep low)    |
| `maxRequestRetries`  | `integer`  | No       | `3`            | HTTP retry count                    |
| `requestDelayMs`     | `integer`  | No       | `1000`         | Base delay before each request (ms) |
| `proxyConfiguration` | `object`   | No       | Apify Proxy on | Proxy settings                      |

#### Example input

```json
{
    "productUrls": ["https://www.amazon.com/dp/B0BSHF7WHW", "https://www.amazon.com/dp/B09V3KXJPB", "B09B8V1LZ3"],
    "maxConcurrency": 2,
    "maxRequestRetries": 3,
    "requestDelayMs": 1000,
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "country": "US"
}
````

See also: [`examples/input.json`](examples/input.json)

### Output

Each dataset item is one product:

| Field            | Type       | Description                            |
| ---------------- | ---------- | -------------------------------------- |
| `asin`           | `string`   | Amazon Standard Identification Number  |
| `title`          | `string`   | Product title                          |
| `brand`          | `string`   | Brand / store                          |
| `price`          | `number`   | Current price                          |
| `listPrice`      | `number`   | List / strikethrough price             |
| `currency`       | `string`   | ISO currency (USD, EUR, …)             |
| `rating`         | `number`   | Average stars (0–5)                    |
| `reviewCount`    | `number`   | Number of reviews                      |
| `availability`   | `string`   | Stock message                          |
| `images`         | `string[]` | Image URLs                             |
| `featureBullets` | `string[]` | About-this-item bullets                |
| `description`    | `string`   | Product description                    |
| `categories`     | `string[]` | Breadcrumb categories                  |
| `url`            | `string`   | Scraped product URL                    |
| `country`        | `string`   | Marketplace code                       |
| `scrapedAt`      | `string`   | ISO timestamp                          |
| `error`          | `string`   | Present when blocked or extract failed |

#### Example output

```json
{
    "asin": "B09B8V1LZ3",
    "title": "Echo Dot (5th Gen, 2022 release) | Smart speaker with Alexa | Charcoal",
    "brand": "Amazon",
    "price": 49.99,
    "listPrice": 59.99,
    "currency": "USD",
    "rating": 4.7,
    "reviewCount": 285432,
    "availability": "In Stock",
    "images": ["https://m.media-amazon.com/images/I/714Rq4k05UL.jpg"],
    "featureBullets": ["Our best sounding Echo Dot yet — Enjoy an improved audio experience."],
    "description": "Echo Dot is our most popular smart speaker with Alexa.",
    "categories": ["Electronics", "Smart Home", "Amazon Devices"],
    "url": "https://www.amazon.com/dp/B09B8V1LZ3",
    "country": "US",
    "scrapedAt": "2026-07-13T12:00:00.000Z"
}
```

#### Key-value store artifacts

| Key            | Description                         |
| -------------- | ----------------------------------- |
| `PRODUCTS.csv` | CSV export of all products          |
| `SUMMARY.md`   | Markdown run summary table          |
| `OUTPUT`       | JSON summary with totals + products |

### How it works

1. **Normalize inputs** — Parse ASINs from URLs, map marketplaces, dedupe by ASIN, build clean `/dp/{ASIN}` URLs.
2. **Fetch pages** — CheerioCrawler requests each product page with browser-like headers, optional proxy, retries, and rate limiting.
3. **Extract** — Multiple CSS / JSON-LD / meta fallbacks pull title, price, brand, ratings, images, bullets, categories, and availability.
4. **Handle blocks** — Captcha and robot-check pages set `error` and still push a dataset row so your pipeline can continue.
5. **Export** — Results go to the default dataset; CSV and Markdown summary are saved to the key-value store.

### Anti-block tips

- Always enable **Apify Proxy** in production (`useApifyProxy: true`).
- Prefer **residential** proxy groups when available.
- Keep `maxConcurrency` at **1–3** and `requestDelayMs` ≥ **1000**.
- If many rows show captcha errors, increase delay and switch proxy groups.
- Cheerio is preferred for speed; switching to Playwright alone rarely bypasses Amazon without strong proxies.

### Pricing

Pay-per-event pricing: **$0.005 per product** (`apify-default-dataset-item`), plus a small actor-start fee.

### Run locally

```bash
cd factory/amazon-product-extractor
npm install
npm test
npm run build
apify run --purge
```

Without a proxy, live Amazon pages may return captchas. Parser correctness is covered by fixture tests under `test/`.

### Deploy to Apify

```bash
apify login
apify push
```

Then publish to the Store and set monetization to **Pay per event** with primary event `apify-default-dataset-item` at **$0.005**.

### Resources

- [Apify SDK for JavaScript](https://docs.apify.com/sdk/js)
- [Crawlee CheerioCrawler](https://crawlee.dev/docs/guides/cheerio-crawler-guide)
- [Pay per event monetization](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event)
- [Apify Proxy](https://docs.apify.com/platform/proxy)

# Actor input Schema

## `productUrls` (type: `array`):

Amazon product page URLs or bare ASINs (e.g. https://www.amazon.com/dp/B0XXXXXX or B0XXXXXX). ASINs are parsed from /dp/ASIN and /gp/product/ASIN paths. Duplicates are removed by ASIN.

## `country` (type: `string`):

Default marketplace when a URL has no Amazon host (or when using bare ASINs). Common values: US, UK, DE, FR, IT, ES, CA, JP, IN, AU, MX, BR.

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

Maximum number of product pages fetched in parallel. Keep low (1–3) to reduce Amazon blocks.

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

How many times to retry a failed HTTP request before recording an error.

## `requestDelayMs` (type: `integer`):

Base delay before each request (with small random jitter). Helps avoid rate limits and captchas.

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

Apify Proxy settings. Strongly recommended — Amazon blocks most datacenter IPs. Prefer RESIDENTIAL groups for production.

## Actor input object example

```json
{
  "productUrls": [
    "https://www.amazon.com/dp/B0BSHF7WHW",
    "https://www.amazon.com/dp/B09V3KXJPB"
  ],
  "country": "US",
  "maxConcurrency": 2,
  "maxRequestRetries": 3,
  "requestDelayMs": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `csv` (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 = {
    "productUrls": [
        "https://www.amazon.com/dp/B0BSHF7WHW",
        "https://www.amazon.com/dp/B09V3KXJPB"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mighty_monk/amazon-product-extractor").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 = { "productUrls": [
        "https://www.amazon.com/dp/B0BSHF7WHW",
        "https://www.amazon.com/dp/B09V3KXJPB",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mighty_monk/amazon-product-extractor").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 '{
  "productUrls": [
    "https://www.amazon.com/dp/B0BSHF7WHW",
    "https://www.amazon.com/dp/B09V3KXJPB"
  ]
}' |
apify call mighty_monk/amazon-product-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Amazon Product Extractor",
        "description": "Extract product details from Amazon product URLs (ASIN pages): title, price, currency, rating, review count, availability, brand, images, feature bullets, description, category breadcrumbs, ASIN, and URL. Cheerio-based with proxy support, retries, and graceful captcha handling.",
        "version": "1.0",
        "x-build-id": "sejD3b2Pijc9WR4li"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mighty_monk~amazon-product-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mighty_monk-amazon-product-extractor",
                "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/mighty_monk~amazon-product-extractor/runs": {
            "post": {
                "operationId": "runs-sync-mighty_monk-amazon-product-extractor",
                "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/mighty_monk~amazon-product-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-mighty_monk-amazon-product-extractor",
                "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": [
                    "productUrls"
                ],
                "properties": {
                    "productUrls": {
                        "title": "Amazon product URLs",
                        "type": "array",
                        "description": "Amazon product page URLs or bare ASINs (e.g. https://www.amazon.com/dp/B0XXXXXX or B0XXXXXX). ASINs are parsed from /dp/ASIN and /gp/product/ASIN paths. Duplicates are removed by ASIN.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "country": {
                        "title": "Amazon marketplace country",
                        "enum": [
                            "US",
                            "UK",
                            "DE",
                            "FR",
                            "IT",
                            "ES",
                            "CA",
                            "JP",
                            "IN",
                            "AU",
                            "MX",
                            "BR",
                            "NL",
                            "SE",
                            "PL",
                            "SG",
                            "AE",
                            "SA",
                            "TR",
                            "EG"
                        ],
                        "type": "string",
                        "description": "Default marketplace when a URL has no Amazon host (or when using bare ASINs). Common values: US, UK, DE, FR, IT, ES, CA, JP, IN, AU, MX, BR.",
                        "default": "US"
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of product pages fetched in parallel. Keep low (1–3) to reduce Amazon blocks.",
                        "default": 2
                    },
                    "maxRequestRetries": {
                        "title": "Max request retries",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many times to retry a failed HTTP request before recording an error.",
                        "default": 3
                    },
                    "requestDelayMs": {
                        "title": "Request delay (ms)",
                        "minimum": 0,
                        "maximum": 60000,
                        "type": "integer",
                        "description": "Base delay before each request (with small random jitter). Helps avoid rate limits and captchas.",
                        "default": 1000
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Strongly recommended — Amazon blocks most datacenter IPs. Prefer RESIDENTIAL groups for production.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
