# AliExpress Scraper - Product Prices, Ratings & Sales (`sweet_stickball/aliexpress-scraper`) Actor

Scrape AliExpress search results or a product page: title, price, original price, discount, rating, units sold, store, shipping and images, with prices in USD for your ship-to country. AliExpress product scraper for e-commerce research.

- **URL**: https://apify.com/sweet_stickball/aliexpress-scraper.md
- **Developed by:** [CrawlKit](https://apify.com/sweet_stickball) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.80 / 1,000 products

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 Scraper - Product Prices, Ratings & Sales

Scrapes AliExpress product listings by keyword search or direct product URL. Returns structured product data including title, price, discount, rating, order count, seller info, shipping details, images, and product ID.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `query` | string | — | Search keyword. Either `query` or `productUrl` is required. |
| `productUrl` | string | — | Direct AliExpress product URL. If provided, only this product is scraped. |
| `maxItems` | integer | 20 | Maximum number of products to return (1–500). |
| `shipTo` | string | `"US"` | Two-letter country code for shipping destination. Affects prices and availability. |

### Output

Each product record contains:

| Field | Type | Description |
|-------|------|-------------|
| `title` | string | Product title |
| `price` | number | Current price (numeric) |
| `originalPrice` | number | Original price before discount (null when no discount is shown) |
| `currency` | string | ISO currency code of the prices (prices are requested in `USD`) |
| `discount` | string | Discount percentage (e.g., "-50%") |
| `rating` | number | Average star rating (null for products without reviews) |
| `orders` | number | Number of orders/sales |
| `seller` | string | Store/seller name (search results expose it only for some products) |
| `shipping` | string | Shipping summary, e.g. "Free shipping · Delivery: Oct 25 - 31" |
| `url` | string | Product page URL |
| `images` | array | List of image URLs |
| `productId` | string | AliExpress product ID |
| `scrapedAt` | string | ISO 8601 timestamp |

### How it works

- **Search mode**: Queries AliExpress search pages (60 products per page) and extracts product data from the page state embedded in the HTML (`window._dida_config_._init_data_`), with an HTML-card fallback. Paginates automatically until `maxItems` is reached. Language and currency are pinned to English / USD; `shipTo` sets the delivery region.
- **Product URL mode**: Product pages are rendered in the browser, so the actor reads the same product detail endpoint the page uses (price, rating, sales, store, shipping, images). If that endpoint is unavailable it falls back to the page HTML (title and images only).

### Blocked requests

The actor uses browser-like requests and Apify Proxy (datacenter first, residential if needed). If AliExpress blocks a request or shows a verification page, it retries with a new proxy session. It never solves captchas.

### Pricing

Pay-per-event, **no start fee**: **$6.30 per 1,000 products** on the Apify Free plan, with lower prices on paid plans. Each product pushed to the dataset is one event.

| Event | Free | Starter | Scale | Business | Enterprise |
|-------|------|---------|-------|----------|------------|
| Product (`PRODUCT`) | $6.30 | $5.40 | $4.70 | $3.80 | $3.80 |

Prices in USD per 1,000 events.

#### Cost examples (Free plan)

| Scenario | Products | Cost |
|----------|----------|------|
| Quick look | 20 | $0.126 |
| One search (2 pages) | 120 | $0.756 |
| Catalog research | 5,000 | $31.50 |

### Limitations

- AliExpress frequently changes its page structure. The parser handles multiple known formats but may miss data if AliExpress deploys a new layout.
- Heavily blocked IP ranges may result in zero results despite retries.
- Price and availability depend on the `shipTo` country and may differ from what a logged-in user sees.
- Search results only contain what the search card shows: the store name is present for a subset of products, and shipping only when the card displays a shipping or delivery tag. Use `productUrl` for complete store and shipping data of one product.
- Prices are those shown to a signed-out visitor and may include new-user promotions (e.g. "{FREE} with any purchase" cards).
- In product URL mode, if the detail endpoint keeps answering with a verification page, only the title and images are returned.
- The actor does not solve captchas. It retries with fresh proxy sessions instead.

### Related Actors

- [Walmart Scraper - Product Prices, Ratings & Sellers](https://apify.com/sweet_stickball/walmart-scraper) — Scrape Walmart search results or product pages: title, price, original price, rating, review count, seller, availability, image and URL.
- [Amazon Reviews Scraper - Product Reviews & Ratings](https://apify.com/sweet_stickball/amazon-reviews-scraper) — Scrape Amazon product reviews from the product page: rating, title, text, date, verified purchase and helpful votes, plus product rating and review count.
- [Google Shopping Scraper - Product Prices & Sellers](https://apify.com/sweet_stickball/google-shopping-scraper) — Scrape Google Shopping results: product titles, prices, old prices, sellers, ratings, review counts and images in 12 countries.

# Actor input Schema

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

Keyword to search for on AliExpress. Either query or productUrl must be provided.

## `productUrl` (type: `string`):

Direct AliExpress product URL. If provided, only this product is scraped. Example: 'https://www.aliexpress.com/item/1005006123456789.html'

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

Maximum number of products to return.

## `shipTo` (type: `string`):

Two-letter country code for shipping destination. Affects prices and availability.

## Actor input object example

```json
{
  "query": "wireless earbuds",
  "maxItems": 10,
  "shipTo": "US"
}
```

# Actor output Schema

## `products` (type: `string`):

Dataset items shown with the 'products' view.

# 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 = {
    "query": "wireless earbuds",
    "maxItems": 10,
    "shipTo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sweet_stickball/aliexpress-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 = {
    "query": "wireless earbuds",
    "maxItems": 10,
    "shipTo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("sweet_stickball/aliexpress-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 '{
  "query": "wireless earbuds",
  "maxItems": 10,
  "shipTo": "US"
}' |
apify call sweet_stickball/aliexpress-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sweet_stickball/aliexpress-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/aaFFrrgFvhxiC1G9K/builds/p10pHakrd63Pf3YPJ/openapi.json
