# Amazon Product Scraper (`codingfrontend/amazon-product-scraper`) Actor

Scrape product listings from Amazon.in based on search term, ASINs, product URLs, or category URLs with detailed product information.

- **URL**: https://apify.com/codingfrontend/amazon-product-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Categories:** Automation, E-commerce
- **Stats:** 163 total users, 17 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 India Product Scraper

Scrape public Amazon.in product data by search query, product URL, ASIN, search URL, or category URL. The actor uses bounded HTTP requests and source-specific HTML/JSON-LD parsing. It does not use a browser, stealth fingerprinting, CAPTCHA solving, sign-in, or checkout access. Optional Apify/custom proxy input is honored, with at most two retries and a 10 MB response limit.

### Extracted fields

Product records can include:

- Title, ASIN, canonical/product URL, brand, breadcrumbs, and source/input provenance
- Current/list price with currency, stock and availability text, delivery-related public text when present
- Stars, review count, rating breakdown when exposed, public review link, and optional review cards
- Features, description, technical attributes/product overview, gallery/high-resolution images, and video/media metadata
- Direct HTTP status/content type, access/fetch status, stable record ID, field coverage, and data-quality metadata

The dataset contains product rows only. A requested ASIN is stored only when the response title and ASIN match that exact target. Blocks, mismatches, invalid input, and extraction failures are written to the bounded `OUTPUT` summary; a run with zero verified products fails closed with an empty dataset.

### Input

| Field | Type | Default | Description |
|---|---|---:|---|
| `mode` | string | `search` | `search`, `productUrl`, `searchUrl`, `categoryUrl`, or `asin` |
| `searchQuery` | string | `laptop` | Search phrase for `search` mode |
| `asins` | array | — | Ten-character ASINs for `asin` mode |
| `productUrls` | array | — | Public Amazon.in product URLs for `productUrl` mode |
| `searchUrl` | string | — | Public Amazon.in search URL |
| `categoryUrl` | string | — | Public Amazon.in category/bestseller URL |
| `maxItems` | integer | 10 | Maximum product records, from 1 through 100 |
| `deepProductScraping` | boolean | true | Legacy flag retained; direct mode always verifies product pages |
| `productReviews` | boolean | false | Parse up to 10 public review cards when present |
| `requestDelayMs` | integer | 600 | Delay between serialized requests |
| `requestTimeoutMs` | integer | 60000 | Direct HTTP timeout per request |
| `maxRetries` | integer | 1 | Bounded retries per request, from 0 through 2 |
| `proxyConfiguration` | object | — | Optional Apify/custom proxy configuration used for every request |

The legacy `headless` field remains accepted but is ignored because no browser is launched. When `proxyConfiguration` is omitted, requests are direct; when supplied, the configured proxy is used and reported in the run/output metadata.

Billing follows the Actor's current pay-per-event configuration: one `apify-default-dataset-item` event per verified product row. Failed or blocked runs keep the dataset empty and therefore create no result-item charge.

#### Example search input

```json
{
  "mode": "search",
  "searchQuery": "laptop",
  "maxItems": 3,
  "productReviews": false,
  "requestDelayMs": 0
}
```

#### Example ASIN input

```json
{
  "mode": "asin",
  "asins": ["B0EXAMPLE1"],
  "maxItems": 1,
  "productReviews": true
}
```

### Output and limitations

Normal records expose stable fields such as `title`, `url`, `asin`, `price`, `listPrice`, `inStock`, `inStockText`, `brand`, `stars`, `reviewsCount`, `features`, `attributes`, `thumbnailImage`, `galleryThumbnails`, `sourceUrl`, `httpStatus`, `fieldCoverage`, and `scrapedAt`, plus optional public reviews and additional product metadata.

Amazon markup, availability, prices, and review sections change frequently. Missing source sections are omitted from output rather than represented by null or empty values. A blocked run is never presented as a successful product result.

### Local testing

Create or update `storage/key_value_stores/default/INPUT.json`, then run:

```
apify run
```

Useful checks:

```
apify validate-schema
npm run lint
node validate-datasets.js
```

Inspect `storage/datasets/default/` and `storage/key_value_stores/default/OUTPUT.json`. Local storage is not uploaded automatically.

# Actor input Schema

## `mode` (type: `string`):

search, productUrl, searchUrl, categoryUrl, or asin.

## `asins` (type: `array`):

Amazon product ASINs used when mode is asin.

## `searchQuery` (type: `string`):

Search phrase used when mode is search.

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

Public Amazon.in product URLs used when mode is productUrl.

## `searchUrl` (type: `string`):

Full public Amazon.in search URL used when mode is searchUrl.

## `categoryUrl` (type: `string`):

Public Amazon.in category or bestseller URL used when mode is categoryUrl.

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

Maximum source-backed product records, from 1 through 100.

## `deepProductScraping` (type: `boolean`):

Compatibility flag retained for older inputs; direct mode always fetches public product pages to verify rich fields.

## `productReviews` (type: `boolean`):

Extract up to 10 public review cards when present in the fetched HTML.

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

Delay between serialized listing/detail requests.

## `requestTimeoutMs` (type: `integer`):

Timeout for each direct public HTTP request.

## `maxRetries` (type: `integer`):

Bounded retries for denied, challenged, failed, or timed-out HTTP requests.

## `headless` (type: `boolean`):

Compatibility field retained for older inputs; the HTTP runner does not launch a browser.

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

Optional Apify or custom proxy configuration. When supplied, every HTTP request uses it.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "laptop",
  "maxItems": 10,
  "deepProductScraping": true,
  "productReviews": false,
  "requestDelayMs": 600,
  "requestTimeoutMs": 60000,
  "maxRetries": 1,
  "headless": true
}
```

# Actor output Schema

## `products` (type: `string`):

No description

## `runSummary` (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 = {
    "searchQuery": "laptop",
    "maxItems": 10,
    "deepProductScraping": true,
    "productReviews": false,
    "requestDelayMs": 600,
    "requestTimeoutMs": 60000,
    "maxRetries": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/amazon-product-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 = {
    "searchQuery": "laptop",
    "maxItems": 10,
    "deepProductScraping": True,
    "productReviews": False,
    "requestDelayMs": 600,
    "requestTimeoutMs": 60000,
    "maxRetries": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/amazon-product-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 '{
  "searchQuery": "laptop",
  "maxItems": 10,
  "deepProductScraping": true,
  "productReviews": false,
  "requestDelayMs": 600,
  "requestTimeoutMs": 60000,
  "maxRetries": 1
}' |
apify call codingfrontend/amazon-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/amazon-product-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/6JH8mrTaDa76WbSDa/builds/YuK5ZuOyhxf4aQkIO/openapi.json
