# AliExpress Scraper — Search & Product Pages in One Run (`thenetaji/aliexpress-scraper`) Actor

Paste keywords, AliExpress search links and product links in one list. Searches return every result with price, rating and sales; products return every variant's price and stock, shipping to your country and the store. Enrichment adds product pages to search rows.

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

## Pricing

from $2.13 / 1,000 rows

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

The AliExpress Scraper accepts one list of keywords, AliExpress search links and product links, and returns structured rows for each. Keywords and search links return their results page by page, with price, discount, star rating and sales count; product links return the full product page with every variant's price and stock, shipping to the chosen country, the store and the specification table. Each row carries a `record_type` of `search_result` or `product`.

### Accepted input

`startUrls` takes one entry per line:

- a product link such as `https://www.aliexpress.com/item/1005010225936968.html`, from any AliExpress country site, or the product number on its own;
- a search link such as `https://www.aliexpress.com/w/wholesale-phone-case.html` or one carrying `SearchText=`, read as its search words;
- any other text, searched as a keyword.

`sort` orders search results by `best_match`, `orders`, `price_asc` or `price_desc`. `country` and `currency` set the ship-to country and currency for product pages. `maxItems` bounds the rows saved across all entries; `0` disables the bound.

```json
{
  "startUrls": ["phone case", "https://www.aliexpress.com/item/1005010225936968.html"],
  "sort": "orders",
  "maxItems": 100,
  "country": "US",
  "currency": "USD"
}
```

### Response fields

Search rows carry `search_input`, `product_id`, `title`, `url`, `image_url`, `price`, `original_price`, `percent_discount`, `currency`, `rating`, `sold`, `sold_count` and `sponsored`. Product rows carry `price_min`, `price_max`, `review_count`, `in_stock`, `images`, the store as `store_name`, `store_id`, `store_url`, `store_country` and `store_positive_feedback_percent`, and `properties`, `options`, `variants`, `shipping` and `ship_to`.

### Product details enrichment

With `enrichProductDetails` set, each search row also receives its product page fields. The search card's own price, rating and image are kept. The add-on costs one extra request per product and is charged only when the product page is returned.

### Behaviour on partial results

A search continues page by page until `maxItems` is reached, AliExpress reports no further results, or page 60 is reached. A product listed twice in one search is saved once. A product that no longer exists, or that AliExpress does not sell to the chosen `country`, is recorded in the log and skipped without a charge. Rows from product links incur a product page charge in addition to the row charge, reflecting the larger record.

### Related Actors

The [AliExpress Search Scraper](https://apify.com/thenetaji/aliexpress-search-scraper) and [AliExpress Product Scraper](https://apify.com/thenetaji/aliexpress-product-scraper) each serve one of these inputs with a narrower form.

# Actor input Schema

## `startUrls` (type: `array`):

One entry per line, in any mix: a keyword such as phone case, an AliExpress search link, or a product link such as https://www.aliexpress.com/item/1005010225936968.html. Keywords and searches return their results page by page; products return the full product page.

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

Order the results the way AliExpress's own sort menu does.

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

Maximum number of products to save. AliExpress shows 60 per page and up to 60 pages, so 3,600 is the most one search can return. Set 0 for no limit.

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

Two-letter country code to price shipping for, such as US, GB or DE. It also decides availability: a product AliExpress does not sell to that country is skipped and not charged.

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

Three-letter currency code for every price, such as USD, EUR or GBP.

## `enrichProductDetails` (type: `boolean`):

Open every product's own page and add what a search card cannot show: every variant with its own price and stock, the full option list, shipping cost and delivery time, the store, the review count, the specification table and every gallery image. One extra request per product — slower, and billed per enriched product.

## Actor input object example

```json
{
  "startUrls": [
    "phone case",
    "https://www.aliexpress.com/item/1005010225936968.html"
  ],
  "sort": "best_match",
  "maxItems": 60,
  "country": "US",
  "currency": "USD",
  "enrichProductDetails": false
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "startUrls": [
        "phone case",
        "https://www.aliexpress.com/item/1005010225936968.html"
    ],
    "sort": "best_match",
    "maxItems": 60,
    "country": "US",
    "currency": "USD"
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/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 = {
    "startUrls": [
        "phone case",
        "https://www.aliexpress.com/item/1005010225936968.html",
    ],
    "sort": "best_match",
    "maxItems": 60,
    "country": "US",
    "currency": "USD",
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/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 '{
  "startUrls": [
    "phone case",
    "https://www.aliexpress.com/item/1005010225936968.html"
  ],
  "sort": "best_match",
  "maxItems": 60,
  "country": "US",
  "currency": "USD"
}' |
apify call thenetaji/aliexpress-scraper --silent --output-dataset

```

## MCP server setup

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