# Amazon Product Advertising API (`experthasan/amazon-product-advertising-api`) Actor

Interact with Amazon Product Advertising API to search products, get item details, and retrieve variations

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

## Pricing

from $4.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

## Amazon Product Advertising API

This Apify Actor provides a seamless interface to the **Amazon Product Advertising API**. It enables you to search for products, retrieve detailed item information, and get product variations using official Amazon data.

### Features

- **Search Products**: Find items by keywords with advanced filtering (Category, Price, Prime, etc.).
- **Product Details**: Get comprehensive data for specific products (ASINs).
- **Variations**: Retrieve all available variations (size, color, style) for a parent product.
- **Smart & Simple**: No need to manage signatures or credentials manually.

### Usage

#### 1. Operations

##### 🔍 SearchItems

Search for products on Amazon.

- **UseCase**: "Find all 'Sony Headphones' under $200 sorted by price."
- **Required**: `keywords`
- **Options**: `searchIndex` (Category), `sortBy`, `minPrice/maxPrice`, `prime`, and more.

##### 📦 GetItems

Retrieve specific details for a list of products.

- **UseCase**: "I have a list of ASINs and need their current price and prime status."
- **Required**: `itemIds` (List of ASINs)
- **Options**: `condition`, `offerCount`.

##### 🎨 GetVariations

Get all variations for a specific parent product.

- **UseCase**: "Get all colors and sizes for this T-Shirt ASIN."
- **Required**: `asin`
- **Options**: `variationCount`, `variationPage`.

#### 2. Inputs

| Field | Type | Description |
|---|---|---|
| `operation` | Enum | **Required**. Choose `SearchItems`, `GetItems`, or `GetVariations`. |
| `keywords` | String | Search terms (e.g., "iphone 13"). Required for **SearchItems**. |
| `marketplace` | String (Select) | **Required**. Amazon marketplace domain (e.g. `www.amazon.com`). Default: `www.amazon.com`. |
| `itemIds` | List | List of ASINs (e.g., `["B08N9Q24M9"]`). Required for **GetItems**. |
| `asin` | String | Parent ASIN. Required for **GetVariations**. |
| `searchIndex` | String | Category to search in (e.g., `Electronics`, `Books`, `All`). Default: `All`. |
| `sortBy` | String | Sort results (e.g., `Price:LowToHigh`, `Relevance`, `NewestArrivals`). |
| `itemPage` | Number | Page number for search results (1-10). |
| `prime` | Boolean | If `true`, returns only Prime-eligible items. |
| `minPrice` / `maxPrice` | Number | Filter by price range (in cents, e.g., 1000 = $10.00). |
| `condition` | Enum | Filter by condition (`New`, `Used`, `Refurbished`, `Collectible`). |
| `brand` | String | Filter by brand name. |
| `resources` | List | Specific data to retrieve (e.g., `["ItemInfo.Title", "Offers.Listings.Price"]`). |

> \[!TIP]
> **Pro Tip**: Use `resources` to limit the response size if you only need specific fields like Title and Price.

#### 3. Advanced Parameters (JSON)

If you need to pass a parameter not listed in the input form, use the `apiParameters` JSON field.

```json
{
  "MinReviewsRating": 4,
  "DeliveryFlags": ["FreeShipping"]
}
```

### Parameter Reference

#### supported `searchIndex` (Categories)

When using the `SearchItems` operation, you can specify one of the following categories in the `searchIndex` field (Default is `All`):

<details>
<summary>Click to see all categories</summary>

- `All` (All Departments)
- `AmazonVideo` (Prime Video)
- `Apparel` (Clothing & Accessories)
- `Appliances`
- `ArtsAndCrafts` (Arts, Crafts & Sewing)
- `Automotive` (Automotive Parts & Accessories)
- `Baby`
- `Beauty` (Beauty & Personal Care)
- `Books`
- `Classical`
- `Collectibles` (Collectibles & Fine Art)
- `Computers`
- `DigitalMusic`
- `DigitalEducationalResources`
- `Electronics`
- `EverythingElse`
- `Fashion` (Clothing, Shoes & Jewelry)
- `FashionBaby`
- `FashionBoys`
- `FashionGirls`
- `FashionMen`
- `FashionWomen`
- `GardenAndOutdoor`
- `GiftCards`
- `GroceryAndGourmetFood`
- `Handmade`
- `HealthPersonalCare`
- `HomeAndKitchen`
- `Industrial` (Industrial & Scientific)
- `Jewelry`
- `KindleStore`
- `LocalServices` (Home & Business Services)
- `Luggage` (Luggage & Travel Gear)
- `LuxuryBeauty`
- `Magazines`
- `MobileAndAccessories` (Cell Phones & Accessories)
- `MobileApps`
- `MoviesAndTV`
- `Music` (CDs & Vinyl)
- `MusicalInstruments`
- `OfficeProducts`
- `PetSupplies`
- `Photo` (Camera & Photo)
- `Shoes`
- `Software`
- `SportsAndOutdoors`
- `ToolsAndHomeImprovement`
- `ToysAndGames`
- `VHS`
- `VideoGames`
- `Watches`

</details>

#### Supported `sortBy` Values

Sort the results by a specific ranking.

- `Relevance` (Default)
- `Price:LowToHigh` (Price: Low to High)
- `Price:HighToLow` (Price: High to Low)
- `AvgCustomerReviews` (Avg. Customer Review)
- `NewestArrivals` (Newest Arrivals)
- `Featured`

### Output

The actor stores the full JSON response from Amazon in the default Apify Dataset. You can download it in JSON, CSV, or Excel formats.

### License

This project is licensed under the Apache License 2.0.

# Actor input Schema

## `operation` (type: `string`):

Select the PA-API operation.

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

Required for GetVariations.

## `itemIds` (type: `array`):

Required for GetItems. List of ASINs.

## `keywords` (type: `string`):

Required for SearchItems.

## `marketplace` (type: `string`):

The Amazon marketplace to query.

## `resources` (type: `array`):

List of resources to retrieve. If empty, retrieves all available resources.

## `searchIndex` (type: `string`):

Target category for SearchItems (e.g., 'Electronics', 'All').

## `itemCount` (type: `integer`):

Number of items to return (1-10).

## `itemPage` (type: `integer`):

Page number of results to return (1-10).

## `variationCount` (type: `integer`):

Number of variations to return (1-10). For GetVariations.

## `variationPage` (type: `integer`):

Page number of variations (1-10). For GetVariations.

## `sortBy` (type: `string`):

Sort order.

## `prime` (type: `boolean`):

Filter for Prime eligible items.

## `deliveryFlags` (type: `array`):

Filter by delivery flags (e.g., 'Prime', 'FreeShipping').

## `condition` (type: `string`):

Filter by item condition.

## `minPrice` (type: `integer`):

Minimum price in smallest currency unit (e.g. 100 = $1.00).

## `maxPrice` (type: `integer`):

Maximum price in smallest currency unit.

## `brand` (type: `string`):

Filter by brand.

## `minReviewsRating` (type: `integer`):

Minimum review rating (0-5).

## `minSavingPercent` (type: `integer`):

Minimum saving percentage.

## `offerCount` (type: `integer`):

Number of offers to retrieve per item.

## `currencyOfPreference` (type: `string`):

Currency for price information (e.g., 'USD').

## `languagesOfPreference` (type: `array`):

List of languages for localized info (e.g., \['en_US']).

## `availability` (type: `string`):

Item availability filter.

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

Filter by title.

## `apiParameters` (type: `object`):

Additional parameters for the Amazon API not covered above.

## Actor input object example

```json
{
  "operation": "GetVariations",
  "marketplace": "www.amazon.com",
  "sortBy": "Relevance",
  "condition": "Any",
  "apiParameters": {}
}
```

# 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/amazon-product-advertising-api").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/amazon-product-advertising-api").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/amazon-product-advertising-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,experthasan/amazon-product-advertising-api"
        }
    }
}
```

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/isBc3gZ8ggjdT938p/builds/u5s4P5tkheUbgpE7A/openapi.json
