# Amazon Product Price Analysis & ASIN Comparison (`practical_ai_lab_jp/pal-amazon-product-price-research`) Actor

Compare offers, price ranges and missing fields in product datasets your business already holds. For Amazon marketplace analysts and ecommerce product teams. Check the live Pricing tab and input limits.

- **URL**: https://apify.com/practical_ai_lab_jp/pal-amazon-product-price-research.md
- **Developed by:** [Practical AI Lab](https://apify.com/practical_ai_lab_jp) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 amazon offer comparison reports

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 Price Analysis & ASIN Comparison

Compares competing Amazon offers in product datasets you **already have**. It does **not** access Amazon and makes **no external requests** (not even for exchange rates). Built by PAL (Practical AI Lab).

### What it does

- **Groups offers by ASIN** and currency: offer count, sellers, marketplaces, min/max/median price, price spread, and the cheapest offer.
- **Discounts**: list price versus price, maximum and average discount, and a flag when the price is above the list price.
- **Price outliers**: offers far from the ASIN's median price (needs 3+ priced offers, configurable ratio).
- **Variations**: groups by `parentAsin` and reports variant count, attribute values (color, size, style...), price range, cheapest variant, variants without attributes, and variant ASINs that are referenced but absent from your data.
- **Missing attributes** per ASIN: title, brand, price, list price, image, rating, availability, category.
- **Robust currency handling**: parses `$1,299.99`, `1.299,99 €`, `¥1,980`, `CA$5`, `12.50 GBP`, `{value, currency}` objects, and plain numbers. Zero-decimal currencies (JPY, KRW) are handled. A currency can also come from a `currency` field or an Amazon domain (`amazon.de` means EUR). A bare `$` with no hint is assumed to be USD and flagged `currency_inferred`.
- **No silent mixing**: different currencies are compared in separate rows unless you set `targetCurrency` and provide `exchangeRates` yourself.

### Input

| Field | Description |
|---|---|
| `records` / `recordsJson` | Product or offer records (JSON array). Each needs a valid 10-character `asin`. |
| `sourceDatasetId` | Optional dataset ID in your own Apify account (used only when no records are supplied). |
| `defaultCurrency` | ISO code assumed when nothing else identifies the currency. |
| `targetCurrency`, `exchangeRates` | Optional conversion using your rates, for example `{"EUR": 1.08}` means 1 EUR = 1.08 target units. |
| `outlierRatio` | Default 2. |

Recognized fields include `asin`, `parentAsin`, `title`, `brand`, `price`, `listPrice`/`originalPrice`, `currency`, `seller`, `url`, `image`, `rating`, `availability`, `category`, `variantAsins`, and variation attributes either as `variantAttributes` or as top-level `color`/`size`/`style`.

### Output

Dataset rows by `recordType`: `summary`, `asin_comparison`, `variation_group`, `skipped_record` (up to 200), and `error` (never charged). Flags: `mixed_currencies_for_asin`, `currency_inferred`, `unknown_currency`, `price_above_list_price`, `price_outlier_offers`, `unparseable_price`.

### Pricing event

Pricing uses pay-per-event. The billing event name is `amazon-offer-comparison-report`, charged once per successful report. Failed runs are not charged.

### Local tests

```
python3 -m unittest discover -s tests
```

# Actor input Schema

## `records` (type: `array`):

Existing Amazon product/offer records you already hold. Each needs an `asin`. Useful fields: title, brand, price, listPrice, currency, seller, url, parentAsin, color/size/style, availability, rating.

## `recordsJson` (type: `string`):

Alternative to `records`: a JSON array (or object with an `items` array) pasted as text.

## `sourceDatasetId` (type: `string`):

Optional ID of a dataset in your own Apify account. Used only when no records are supplied.

## `defaultCurrency` (type: `string`):

Currency to assume when a record has no currency, symbol, or Amazon domain (for example USD, EUR, JPY). Records using it are flagged as inferred.

## `targetCurrency` (type: `string`):

Convert prices to this currency using `exchangeRates`. Leave empty to compare each currency separately; currencies are never mixed.

## `exchangeRates` (type: `object`):

Map of currency code to the value of 1 unit in the comparison currency, for example {"EUR": 1.08, "GBP": 1.27}. No rates are fetched online.

## `outlierRatio` (type: `number`):

An offer is flagged when its price is more than this many times above, or below 1/this of, the ASIN's median price (needs 3+ priced offers).

## Actor input object example

```json
{
  "outlierRatio": 2
}
```

# Actor output Schema

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

Structured records from this Actor run; downloadable as JSON or CSV.

# 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("practical_ai_lab_jp/pal-amazon-product-price-research").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("practical_ai_lab_jp/pal-amazon-product-price-research").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 practical_ai_lab_jp/pal-amazon-product-price-research --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,practical_ai_lab_jp/pal-amazon-product-price-research"
        }
    }
}
```

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/wYDTMb2i5RYCkTUGY/builds/9IXr1OJw9RNodB8bo/openapi.json
