# AliExpress Scraper - Product Search by Keyword (`pnda/aliexpress-scraper`) Actor

AliExpress product search scraper: search by keyword and get product ID, title, price, discount, rating, orders sold, images, Choice and free shipping badges. Sort by orders or price, set the ship-to country. $1.80 per 1,000 products.

- **URL**: https://apify.com/pnda/aliexpress-scraper.md
- **Developed by:** [PNDA](https://apify.com/pnda) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$1.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.

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 Search by Keyword

Search **AliExpress by keyword** and get every product card: product ID, title, price, original price, discount, rating, **units sold**, images, Choice and free-shipping badges, sponsored flag. Sort by best sellers or price, filter by price, choose the ship-to country. No login, no API key.

### What you get

One row per product:

```json
{
  "keyword": "yoga mat",
  "position": 1,
  "productId": "3256806808957451",
  "url": "https://www.aliexpress.com/item/3256806808957451.html",
  "title": "Yoga Mat Pilates Fitness Mat 3/4/6mm Thickness Non Slip...",
  "price": 5.79,
  "currency": "USD",
  "originalPrice": 15.65,
  "discountPercent": 63,
  "rating": 4.9,
  "sold": 10000,
  "soldText": "10,000+ sold",
  "choice": true,
  "freeShipping": true,
  "sponsored": false,
  "image": "https://ae-pic-a1.aliexpress-media.com/kf/S2519edadb8104a8a914b2c6c1ff4151bZ.jpg",
  "images": ["..."],
  "listedSince": "2024-05-12",
  "totalResults": 7999
}
```

### How to use it

1. Add one or more **Keywords** (`yoga mat`, `led strip`…).
2. Set **Max products per keyword** (about 60 per results page).
3. Optional: **Sort by** orders or price, **Min / Max price**, **Country** (US, FR, DE, GB…), **Skip sponsored products**.
4. Run, then export as JSON, CSV or Excel.

```json
{ "keywords": ["yoga mat", "resistance bands"], "maxProductsPerKeyword": 120, "sort": "orders", "country": "US" }
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| Product | $0.0018 ($1.80 / 1,000 products) |

Keywords that cannot be read are free rows. The run never spends more than your **max charge per run**.

### Use cases

- **Dropshipping product research**: find best sellers in a niche, sorted by orders.
- **Price monitoring**: track prices and discounts for your keywords and countries.
- **Market sizing**: number of results and sales level per keyword.
- **Catalog building**: titles, images and prices in bulk.

### FAQ

**Which country are the prices for?** The ship-to country you choose (US by default): prices, currency and availability follow it.

**Product pages and reviews?** This actor reads search results. Use the product URL it returns for details.

**Is it legal?** Only public search pages are read. You are responsible for how you use the data.

# Actor input Schema

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

One search per keyword, like on aliexpress.com.

## `maxProductsPerKeyword` (type: `integer`):

About 60 products per results page.

## `sort` (type: `string`):

Order of the results.

## `minPrice` (type: `number`):

Optional, in the currency of the country.

## `maxPrice` (type: `number`):

Optional, in the currency of the country.

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

Ship-to country of the prices and availability (ISO code, e.g. US, FR, DE, GB).

## `skipSponsored` (type: `boolean`):

Leave out the ad cards.

## Actor input object example

```json
{
  "keywords": [
    "yoga mat"
  ],
  "maxProductsPerKeyword": 20,
  "sort": "relevance",
  "country": "US",
  "skipSponsored": false
}
```

# Actor output Schema

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

All rows (JSON, CSV, Excel).

# 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": [
        "yoga mat"
    ],
    "maxProductsPerKeyword": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("pnda/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 = {
    "keywords": ["yoga mat"],
    "maxProductsPerKeyword": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("pnda/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 '{
  "keywords": [
    "yoga mat"
  ],
  "maxProductsPerKeyword": 20
}' |
apify call pnda/aliexpress-scraper --silent --output-dataset

```

## MCP server setup

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