# AliExpress Product Scraper (`bgfc97/aliexpress-product-scraper`) Actor

Scrape AliExpress products by keyword: title, current & original price, discount, orders sold, rating, reviews, store, image and URL. Fast and cheap.

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

## Pricing

$2.00 / 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.

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 Product Scraper

Scrape **AliExpress** products two ways:

- **By keyword search** — give one or more keywords (e.g. `wireless earbuds`) and get the product cards from the results pages, paginated up to your limit.
- **By product URL or ID** — give product page URLs (e.g. `https://www.aliexpress.com/item/1005008148860952.html`) or bare numeric IDs and get full detail for each.

No headless browser: search reads the page's internal JSON (`_init_data_`) over plain HTTP through datacenter proxy (cheap), and product detail uses AliExpress's own signed MTOP API (`mtop.aliexpress.pdp.pc.query`) with an automatic residential-proxy fallback for anti-bot.

### Input

| Field | Type | Description |
|---|---|---|
| `search` | string\[] | Keywords to search. Each runs one search, paginated up to `maxItems`. |
| `productUrls` | string\[] | Product page URLs or bare numeric IDs, scraped in full detail. |
| `maxItems` | integer | Max cards per keyword (default 40, ~60 per page). |
| `country` | string | Ship-to country, ISO-2 (default `US`). |
| `currency` | string | Currency, ISO-4217 (default `USD`). |
| `language` | string | Locale `lang_COUNTRY` (default `en_US`). |
| `proxyConfiguration` | object | Apify Proxy for search requests (default datacenter). |
| `timeoutSecs` | integer | Per-request timeout, 5–120 (default 40). |

At least one of `search` or `productUrls` is required.

### Output

One item per product:

```json
{
  "source": "search",
  "keyword": "wireless earbuds",
  "id": "1005007572968437",
  "title": "Lenovo GM2 Pro TWS Bluetooth 5.4 Earbuds",
  "price": 8.99,
  "price_formatted": "US $8.99",
  "original_price": 24.45,
  "currency": "USD",
  "discount_pct": 63,
  "orders": 10000,
  "orders_text": "10,000+ sold",
  "rating": 4.9,
  "reviews_count": 1287,
  "store_name": "Lenovo Official Store",
  "image": "https://ae-pic-a1.aliexpress-media.com/kf/....jpg",
  "url": "https://www.aliexpress.com/item/1005007572968437.html",
  "shipping": "Free shipping"
}
```

Search cards always include id, title, prices, currency, discount, orders, rating, image and URL. `reviews_count`, `store_name` and `shipping` are filled from the product-detail (MTOP) path when scraping by URL/ID.

### Notes

- Datacenter proxy is normally enough for search and keeps runs cheap. The actor auto-escalates to residential proxy for any request that gets blocked and for the MTOP product API.
- Prices/titles are localised by `country`, `currency` and `language`.

# Actor input Schema

## `search` (type: `array`):

Keywords to search on AliExpress (e.g. "wireless earbuds"). Each keyword is run as a search and its product cards are scraped, paginated up to Max items. Optional if Product URLs / IDs is set - at least one of the two is required.

## `productUrls` (type: `array`):

AliExpress product page URLs (e.g. https://www.aliexpress.com/item/1005008148860952.html) or bare numeric product IDs (e.g. 1005008148860952) to scrape individually with full detail (store name, review count, shipping). Optional if Search keywords is set - at least one of the two is required.

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

Maximum number of product cards to collect for each search keyword (across paginated result pages, ~60 per page). Product URLs/IDs are always scraped in full regardless of this limit.

## `country` (type: `string`):

ISO-2 ship-to country code used to localise prices, availability and shipping (e.g. US, GB, BR, DE). Affects which regional storefront and currency AliExpress returns.

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

ISO-4217 currency code for returned prices (e.g. USD, EUR, GBP, BRL). AliExpress converts prices to this currency when supported.

## `language` (type: `string`):

Locale used for titles and text, in language\_COUNTRY form (e.g. en\_US, pt\_BR, es\_ES, de\_DE).

## `proxyConfiguration` (type: `object`):

Apify Proxy settings for the initial search requests. Datacenter proxy is recommended (free on most plans) and usually enough for AliExpress search; the actor automatically falls back to residential proxy for requests that get blocked and for the product-detail MTOP API.

## `timeoutSecs` (type: `integer`):

Timeout per HTTP request to AliExpress, in seconds (5-120).

## Actor input object example

```json
{
  "search": [
    "wireless earbuds"
  ],
  "maxItems": 40,
  "country": "US",
  "currency": "USD",
  "language": "en_US",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "BUYPROXIES94952"
    ]
  },
  "timeoutSecs": 40
}
```

# Actor output Schema

## `dataset` (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 = {
    "search": [
        "wireless earbuds"
    ],
    "country": "US",
    "currency": "USD",
    "language": "en_US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bgfc97/aliexpress-product-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 = {
    "search": ["wireless earbuds"],
    "country": "US",
    "currency": "USD",
    "language": "en_US",
}

# Run the Actor and wait for it to finish
run = client.actor("bgfc97/aliexpress-product-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 '{
  "search": [
    "wireless earbuds"
  ],
  "country": "US",
  "currency": "USD",
  "language": "en_US"
}' |
apify call bgfc97/aliexpress-product-scraper --silent --output-dataset

```

## MCP server setup

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