# AliExpress Products Search & Price Monitor (`datahamster/aliexpress-products-search`) Actor

Search AliExpress by keyword and track product card prices over time. Returns product ID, title, current displayed price, currency and item URL.

- **URL**: https://apify.com/datahamster/aliexpress-products-search.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 result items

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?

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

## AliExpress Products Search & Price Monitor

Search AliExpress by keyword and collect a bounded set of product cards with their current displayed prices. Run as a scheduled task in monitor mode to receive new products and changes to the displayed card price or currency.

### What you get

A compact, deduplicated set of products with the current card price where AliExpress publishes one.

### Output

Each row contains `productId`, `title`, `price`, `currency`, `url` and the originating `query`. Prices are the minimum sale price shown on the search card when available. Search results can vary by market, time, promotions and visitor context.

### Input

| Field | Meaning | Default |
|---|---|---|
| `queries` | Search phrases; one first results page per phrase | required |
| `maxItems` | Maximum returned rows | 100 |
| `mode` | `scrape` for results, `monitor` for new or changed products | `scrape` |
| `monitorStateId` | State identity when running monitor mode outside a saved task | task ID |

The actor deduplicates repeated product IDs across all supplied phrases. Search-page pagination is not exposed because only the first results page is verified by the captured fixture.

### Monitor mode

Monitor identity uses the shared runtime's `monitorStateId` and product ID as the row key. Changes are detected from the displayed price and currency. Schedule the actor as a saved task to track the same searches over time.

### Pricing

- Result: $0.001 per product.
- Monitor check: $0.005 per run.
- Change: $0.001 per new or changed product.

### Limits

AliExpress may return a challenge, access wall, empty results, or a different page structure. The actor reports a blocked run when every query is refused; it does not claim product-detail completeness. Search cards do not establish stock availability, variant pricing, shipping cost, seller identity, or final checkout price. The returned amount is a displayed card price and can reflect a selected/starting variant or promotion. Currency can be absent on some cards.

### Changelog

- 0.1: keyword search and card-price monitoring for the verified first results page.

# Actor input Schema

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

Stop after this many results (you are charged only for pushed items)

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

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## `queries` (type: `array`):

One keyword phrase per entry; each phrase searches one AliExpress results page.

## Actor input object example

```json
{
  "maxItems": 100,
  "mode": "scrape",
  "queries": [
    "wireless earbuds"
  ]
}
```

# Actor output Schema

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

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# 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 = {
    "queries": [
        "wireless earbuds"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/aliexpress-products-search").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 = { "queries": ["wireless earbuds"] }

# Run the Actor and wait for it to finish
run = client.actor("datahamster/aliexpress-products-search").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 '{
  "queries": [
    "wireless earbuds"
  ]
}' |
apify call datahamster/aliexpress-products-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datahamster/aliexpress-products-search"
        }
    }
}
```

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/2HpQ5ItodkxiS4v0X/builds/hVlncChG7FfSlfhr9/openapi.json
