# Realtime Amazon Scraper (`experthasan/realtime-amazon-scraper`) Actor

Fast and robust Amazon scraper with support for Search, Product Details, Bestsellers, New Releases, and Offer Listings. Output data in JSON.

- **URL**: https://apify.com/experthasan/realtime-amazon-scraper.md
- **Developed by:** [Mahmudul Hasan](https://apify.com/experthasan) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 20 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Realtime Amazon Scraper

A powerful, fast, and robust Amazon scraper built with Python and FastAPI. This actor allows you to scrape Amazon search results, product details, bestsellers, new releases, and offer listings in real-time without needing your own proxies.

### Features

- **Search**: Scrape search results by keyword, country, and category.
- **Product Details**: Extract detailed product information (price, images, description, features) using ASIN or URL.
- **Best Sellers & New Releases**: Scrape Amazon's "Best Sellers" and "New Releases" lists.
- **Offer Listings**: Get other sellers, prices, and conditions for a product.
- **No Proxies Needed**: Uses an internal robust scraping mechanism.
- **Affiliate Ready**: Automatically cleans URLs.

### Usage

#### Inputs

| Field | Type | Description |
| :--- | :--- | :--- |
| `action` | String | **Required**. One of: `search`, `product`, `bestsellers`, `new-releases`, `offer-listing`, `url`. |
| `query` | String | Search keyword (Required for `search`). |
| `country` | String | Amazon domain (e.g., `us`, `uk`, `de`). Default: `us`. |
| `asin` | String | Product ASIN (Required for `product`). |
| `url` | String | Direct Amazon URL (Required for `url`, `bestsellers`, etc.). |

#### Examples

**1. Search for "iPhone" in US:**

```json
{
  "action": "search",
  "query": "iphone",
  "country": "us"
}
```

**2. Scrape Product Details by ASIN:**

```json
{
  "action": "product",
  "asin": "B08L5TNJHG"
}
```

**3. Scrape New Releases from URL:**

```json
{
  "action": "new-releases",
  "url": "https://www.amazon.com/gp/new-releases/electronics"
}
```

### Output

The actor stores results in the Apify Dataset. Each item usually contains:

- `title`
- `price`
- `rating`
- `reviews_count`
- `image`
- `url`
- `asin`
- `is_prime`

### Support

For issues or feature requests, please check the "Issues" tab.

# Actor input Schema

## `action` (type: `string`):

Select the scraping mode.

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

Keyword to search for (Required for 'search' action).

## `asin` (type: `string`):

Product ASIN (Required for 'product' action).

## `url` (type: `string`):

Full Amazon URL (Required for 'url', 'bestsellers', 'new-releases', 'offer-listing' actions).

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

Amazon domain country code (e.g., 'us', 'uk').

## Actor input object example

```json
{
  "action": "search",
  "country": "us"
}
```

# Actor output Schema

## `title` (type: `string`):

Name of the product

## `price` (type: `string`):

Current price of the product

## `currency` (type: `string`):

Currency symbol or code

## `asin` (type: `string`):

Amazon Standard Identification Number

## `url` (type: `string`):

Affiliate link to the product

## `image` (type: `string`):

Main product image

## `rating` (type: `string`):

Average user rating (e.g. '4.5 out of 5 stars')

## `reviews_count` (type: `string`):

Total number of reviews

## `is_prime` (type: `string`):

Whether the item is Prime eligible

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("experthasan/realtime-amazon-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 = {}

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

```

## MCP server setup

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