# AliExpress Search Price Tracker (`structlabs/aliexpress-search-price-tracker`) Actor

Batch-scrape AliExpress search results by keyword or search URL with ship-to country and currency controls. One row per product with numeric price, discount, sold count, rating and store data. Pure HTTP, residential retry only on anti-bot challenges.

- **URL**: https://apify.com/structlabs/aliexpress-search-price-tracker.md
- **Developed by:** [Mohit Tripathi](https://apify.com/structlabs) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.87 / 1,000 product scrapeds

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

## AliExpress Search Price Tracker

Batch-scrape AliExpress **search results** by keyword or search URL, with ship-to country and currency controls. One request returns 59–69 product cards; one row per product with numeric price, discount, sold count, rating and store data.

- **Search pages only.** Item-detail pages are JS shells and are not used.
- **Pay per event:** `product-scraped` **$2.20 / 1,000 rows** + `apify-actor-start` $0.05 / 1,000 starts.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `keywords` | array | `["phone case"]` | One search per keyword. |
| `searchUrls` | array | `[]` | Full search URLs; each replaces a keyword search. |
| `shipToCountry` | string | `US` | ISO-2, written as `region=` in `aep_usuc_f`. |
| `currency` | string | `USD` | ISO-3, written as `c_tp=` in `aep_usuc_f`. |
| `pageStart` / `pageEnd` | integer | `1` / `2` | Pages per keyword. |
| `maxProducts` | integer | `300` | Hard stop; billing stops here. |
| `requestTimeoutSecs` | integer | `25` | Per page. |
| `delayBetweenRequestsSecs` | number | `1.5` | Pacing; raises the direct-IP success rate. |
| `useResidentialOnChallenge` | boolean | `true` | Retry a challenged page once through Apify Residential proxy. |

Prefill (`phone case`, page 1, 60 products) runs in ~6 s.

### Output

```json
{
  "product_id": "3256810253104496",
  "title": "Magnetic Original Clear Case For iPhone 17 16 15 14 Plus 13 12 Mini 11 Pro Max",
  "price": 0.33,
  "currency": "USD",
  "original_price": null,
  "discount_percent": 89,
  "orders_count": 70000,
  "orders_text": "70K+ sold",
  "rating": 4.9,
  "review_count": null,
  "store_name": null,
  "store_url": null,
  "image_url": "https://ae-pic-a1.aliexpress-media.com/kf/S28f397c19b0040ecac9bc4a3f73a9f123.jpg",
  "product_url": "https://www.aliexpress.com/item/3256810253104496.html",
  "ship_to_country": "US",
  "page": 1,
  "position": 1,
  "scraped_at": "2026-11-20T09:03:45.972680+00:00"
}
```

`orders_count` parsing: `"1,234 sold"` → 1234, `"10+ sold"` → 10, `"1.2k sold"` → 1200, `"1M+ sold"` → 1000000. Always an integer or `null`; the raw card text stays in `orders_text`.

### Cost

| Volume | `product-scraped` | Actor starts | Total |
|---|---|---|---|
| 1,000 products | $2.20 | $0.05 | **$2.25** |
| 10,000 products | $22.00 | $0.05 | **$22.05** |

No charge for challenged pages, empty pages, duplicates, or products without `product_id` + `title` + price.

### Pagination gate (run before the build)

3 keywords × pages 1–5, cookie `aep_usuc_f=site=glo&c_tp=USD&region=US&b_locale=en_US`:

| Keyword | IDs per page (1–5) | Unique across 5 pages |
|---|---|---|
| phone case | 60, 60, 60, 60, 60 | 288 |
| led strip | 60, 60, 60, 60, 60 | 282 |
| usb c cable | 60, 60, 60, 60, 60 (residential retry on 2 challenged pages) | 271 |

Page 2+ never repeats page 1 wholesale: cross-page overlap is 0–12 cards, all sponsored repeat placements, and rows are deduped by `product_id`. Direct requests start returning AliExpress's `_____tmd_____/punish` challenge after roughly 10–15 rapid hits from one datacenter IP; the Actor paces requests and retries the challenged page through Residential proxy, and never bills a challenge page.

### Source notes

- URL: `https://www.aliexpress.com/w/wholesale-{keyword-slug}.html?page={n}`.
- Data is in `window._dida_config_._init_data_` → `data.data.root.fields.mods.itemList.content[]`; each card has `productId`, `title.displayTitle`, `prices.salePrice.minPrice`, `prices.originalPrice.minPrice`, `prices.salePrice.discount`, `trade.tradeDesc`, `evaluation.starRating`, `image.imgUrl`.
- `aep_usuc_f=site=glo&c_tp={currency}&region={country}&b_locale=en_US` plus `intl_locale=en_US` controls currency and shipping country; verified prices came back in EUR/GBP/CAD/AUD on those runs.
- \~700–950 KB HTML per page (≈12 KB per listed product).

### MCP

```json
{
  "actor": "structlabs/aliexpress-search-price-tracker",
  "input": {"keywords": ["phone case", "led strip"], "shipToCountry": "US", "currency": "USD", "pageStart": 1, "pageEnd": 2, "maxProducts": 200}
}
```

### Local verification

- 20-input gate with `ACTOR_TEST_PAY_PER_EVENT=true apify run`: **20/20 clean**, 1,953 rows, 0 unhandled exceptions, 0 duplicate `product_id`, every row numeric price and correct currency.
- Median 23 s for a 2-page run (challenge retries included); 6 s for the 1-page prefill.

### Pricing source

Canonical store-discount ladder (FREE/BRONZE/SILVER/GOLD/PLATINUM/DIAMOND) lives in `pricing.json`. Apify `actor.json` cannot carry pricing and `apify push` does not change account pricing; after any manual API change, the newest `pricingInfos` record must match `pricing.json`.

### n8n Workflow & MCP Quickstart

Run this Actor from an AI agent over MCP, or import the ready-made n8n workflow:

- n8n workflow, MCP config and quickstarts: https://github.com/structlabs-hq/aliexpress-search-price-tracker-n8n-mcp
- MCP endpoint: https://mcp.apify.com/?actors=structlabs/aliexpress-search-price-tracker

# Actor input Schema

## `keywords` (type: `array`):

One AliExpress search per keyword. Each page returns about 60 product cards.

## `searchUrls` (type: `array`):

Full AliExpress search URLs. Each URL replaces one keyword search; the page parameter is managed by the Actor.

## `shipToCountry` (type: `string`):

ISO-2 country written to the aep_usuc_f cookie (region=). Controls the shipping options and local pricing shown by AliExpress.

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

ISO-3 currency written to the aep_usuc_f cookie (c_tp=).

## `pageStart` (type: `integer`):

First search-results page to fetch.

## `pageEnd` (type: `integer`):

Last page per keyword. Two pages keep the prefill run under 8 seconds.

## `maxProducts` (type: `integer`):

Hard stop. Each pushed product is one product-scraped billing event.

## `requestTimeoutSecs` (type: `integer`):

Per-page timeout.

## `delayBetweenRequestsSecs` (type: `number`):

Pause between page requests. 1.5s keeps the direct-IP challenge rate low; drop to 0 only for small runs.

## `useResidentialOnChallenge` (type: `boolean`):

When AliExpress returns its anti-bot challenge instead of products, retry that page once through Apify Residential proxy. Charge-safe: a challenge page is never billed.

## Actor input object example

```json
{
  "keywords": [
    "phone case"
  ],
  "shipToCountry": "US",
  "currency": "USD",
  "pageStart": 1,
  "pageEnd": 1,
  "maxProducts": 60,
  "requestTimeoutSecs": 25,
  "delayBetweenRequestsSecs": 1.5,
  "useResidentialOnChallenge": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `table` (type: `string`):

No description

## `deals` (type: `string`):

No description

# 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 = {
    "keywords": [
        "phone case"
    ],
    "shipToCountry": "US",
    "currency": "USD",
    "pageStart": 1,
    "pageEnd": 1,
    "maxProducts": 60,
    "requestTimeoutSecs": 25,
    "delayBetweenRequestsSecs": 1.5,
    "useResidentialOnChallenge": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("structlabs/aliexpress-search-price-tracker").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 = {
    "keywords": ["phone case"],
    "shipToCountry": "US",
    "currency": "USD",
    "pageStart": 1,
    "pageEnd": 1,
    "maxProducts": 60,
    "requestTimeoutSecs": 25,
    "delayBetweenRequestsSecs": 1.5,
    "useResidentialOnChallenge": True,
}

# Run the Actor and wait for it to finish
run = client.actor("structlabs/aliexpress-search-price-tracker").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 '{
  "keywords": [
    "phone case"
  ],
  "shipToCountry": "US",
  "currency": "USD",
  "pageStart": 1,
  "pageEnd": 1,
  "maxProducts": 60,
  "requestTimeoutSecs": 25,
  "delayBetweenRequestsSecs": 1.5,
  "useResidentialOnChallenge": true
}' |
apify call structlabs/aliexpress-search-price-tracker --silent --output-dataset

```

## MCP server setup

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

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/0oFJ4Ktqq9v6bbqyn/builds/oOKxbB7tmYcZkutJ9/openapi.json
