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

Scrapes product details from Amazon, including title, price, reviews, ratings, and more. It supports scraping from search/group URLs or specific product detail pages.

- **URL**: https://apify.com/shareze001/amazon-product-scraper.md
- **Developed by:** [shareze](https://apify.com/shareze001) (community)
- **Categories:** E-commerce, Developer tools, Integrations
- **Features:** Full permissions
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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 Product Scraper

This Apify Actor is designed to scrape product details from Amazon. It retrieves detailed information about products, including metadata such as title, price, reviews, and more.

### How to Use

#### 1. Input Configuration

The Actor requires an input JSON object to define the scraping parameters. The structure of the input is as follows:

```json
{
  "size": 10,
  "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1",
  "detail_urls": [
    {
      "url": "https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1"
    }
  ]
}
```

- **`size`**: (Required) The number of products to retrieve. Default is 10.
- **`group_url`**: (Optional) The URL of a search or category page to scrape product links from.
- **`detail_urls`**: (Optional) A list of product detail page URLs to scrape directly.

#### 2. Output Data

The Actor returns an array of objects containing information about the products. The structure of each object is as follows:

```json
{
  "productId": "B07H459T1C",
  "title": "Example Product Title",
  "price": "29.99",
  "currencyCode": "USD",
  "reviews": "1500",
  "rate": "4.5",
  "description": "This is an example product description.",
  "productImageUrl": "https://example.com/image.jpg",
  "availableVariations": {},
  "variationOptions": [],
  "colorImages": {},
  "otherAttributes": []
}
```

- **`productId`**: The unique ID of the product.
- **`title`**: The title of the product.
- **`price`**: The price of the product.
- **`currencyCode`**: The currency of the price.
- **`reviews`**: The number of reviews for the product.
- **`rate`**: The average rating of the product.
- **`description`**: The product description.
- **`productImageUrl`**: The URL of the product image.
- **`availableVariations`**: Information about available variations of the product.
- **`variationOptions`**: Options for product variations.
- **`colorImages`**: Images for different color variations.
- **`otherAttributes`**: Additional attributes of the product.

#### 3. Running the Actor

1. Deploy the Actor on the Apify platform.
2. Provide the input JSON in the Actor's input configuration.
3. Run the Actor to scrape data.
4. Retrieve the output dataset containing the product details.

#### 4. Example Use Case

To scrape 5 products from a specific Amazon category:

1. Set the input as:
   ```json
   {
     "size": 5,
     "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1"
   }
   ```
2. Run the Actor.
3. Retrieve the output dataset containing the product details.

### Notes

- This Actor uses Amazon's public interface and may be subject to rate limits or restrictions.
- Ensure that the input URLs are valid and accessible.
- The Actor is optimized for performance but may require adjustments based on Amazon's response behavior.

# Actor input Schema

## `size` (type: `integer`):

item size

## `group_url` (type: `string`):

URLs to scrape from, e.g. brand: nike or search result pages, for example: \[nike category] https://www.amazon.com/s?i=office-products\&srs=119088564011\&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike\&dc\&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc\&qid=1761723263\&rnid=1064954\&ref=sr_nr_n_1, \[nike homepage] https://www.amazon.com/s?srs=119088564011\&rh=p_89%3ANike, \[search by candle] https://www.amazon.com/s?k=candle\&crid=3GVO8PZ2DW08L\&sprefix=can%2Caps%2C456\&ref=nb_sb_noss_2

## `detail_urls` (type: `array`):

List of product detail page URLs to scrape from, e.g. https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1

## Actor input object example

```json
{
  "size": 10,
  "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1",
  "detail_urls": [
    {
      "url": "https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1"
    }
  ]
}
```

# 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 = {
    "size": 10,
    "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1",
    "detail_urls": [
        {
            "url": "https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("shareze001/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 = {
    "size": 10,
    "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1",
    "detail_urls": [{ "url": "https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1" }],
}

# Run the Actor and wait for it to finish
run = client.actor("shareze001/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 '{
  "size": 10,
  "group_url": "https://www.amazon.com/s?i=office-products&srs=119088564011&rh=n%3A1064954%2Cn%3A1069242%2Cp_89%3ANike&dc&ds=v1%3AdXluoZMazVWwMp9ZBvVcvEkhdlF0Wp%2BCA8BPqnapEPc&qid=1761723263&rnid=1064954&ref=sr_nr_n_1",
  "detail_urls": [
    {
      "url": "https://www.amazon.com/Nostalgia-Popcorn-Vintage-Theater-Machine/dp/B07H459T1C/ref=sr_1_29?th=1"
    }
  ]
}' |
apify call shareze001/amazon-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shareze001/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/Ey8dW8FvHZHnT244v/builds/h0gxB2mbe5l2YRtNd/openapi.json
