# Alibaba Scraper (`datascrapers/alibaba-scraper`) Actor

Search Alibaba.com products, with optional product details and per-review extraction.

- **URL**: https://apify.com/datascrapers/alibaba-scraper.md
- **Developed by:** [Farhan Ali](https://apify.com/datascrapers) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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

**Alibaba Scraper** creates a structured dataset of supplier product records collected from [Alibaba.com](https://www.alibaba.com). Each dataset item represents one product listing and can include the title, product ID, price, MOQ, sold count, supplier name, country, review score, and — when enabled — nested product specifications and buyer reviews. Query the source using search keywords or direct product URLs, choose between the main `products` catalog and `worldwide` supplier results, control the result limit with `maxItems`, and retrieve records through the Apify Dataset API or export them as JSON, CSV, or Excel.

### Dataset at a glance

| Property | Value |
|---|---|
| Source | alibaba.com |
| Record unit | One product listing |
| Input methods | Search keywords, direct product URLs |
| Main identifiers | `productId`, `url` |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel |
| Update model | Fresh records per Actor run |
| Pricing | Pay per event, from $1.50 per 1,000 products |

### Coverage and available records

The Actor collects products from two source types:

- **Search results** — products returned for `searchQueries`, in either the main `products` catalog or `worldwide` supplier results (`searchScope`).
- **Product pages** — a single product given a `productUrls` entry.

Supported behavior:

- Optional **product details** (`includeProductDetails`) adds a nested `details` object with specifications, price tiers, images, category, and supplier profile.
- Optional **product reviews** (`includeProductReviews`) adds a nested `reviews` array, billed once per review.
- `maxItems` caps the number of products; `maxReviews` caps the total reviews across the run.

Fields such as `details`, `reviews`, `soldOrder`, and `supplierYears` are conditional on the source page or the corresponding enrichment option.

### Data dictionary

| Field | Type | Nullable | Description | Example |
|---|---:|---|---|---|
| `recordType` | string | No | Record type (`product`) | `product` |
| `sourceQuery` | string | Yes | Search term or URL that produced the record | `spider hoodie` |
| `title` | string | No | Product title | `Custom logo spider hoodie` |
| `url` | string | No | Product page URL | `https://www.alibaba.com/product-detail/...` |
| `productId` | string | No | Alibaba product identifier | `1601234567890` |
| `price` | string | Yes | Price or price range | `$5.00 - $8.00` |
| `moq` | string | Yes | Minimum order quantity | `10 pieces` |
| `soldOrder` | string | Yes | Sold count text | `500+ sold` |
| `companyName` | string | Yes | Supplier company name | `Example Apparel Co., Ltd.` |
| `countryCode` | string | Yes | Supplier country code | `CN` |
| `supplierYears` | string | Yes | Years on Alibaba | `5 yrs` |
| `reviewScore` | string | Yes | Supplier review score | `4.8` |
| `reviewCount` | string | Yes | Review count text | `120 Reviews` |
| `imageUrl` | string | Yes | Primary product image | `https://s.alicdn.com/...` |
| `searchQuery` | string | Yes | Original query | `spider hoodie` |
| `page` | number | Yes | Result page number | `1` |
| `details` | object | Yes | Nested product details (details enabled) | `{...}` |
| `reviews` | array | Yes | Nested review list (reviews enabled) | `[{...}]` |

Use `productId` (fallback `url`) as the stable field for deduplication.

### Example dataset record

```json
{
  "recordType": "product",
  "sourceQuery": "spider hoodie",
  "title": "Custom logo spider hoodie men oversized streetwear",
  "url": "https://www.alibaba.com/product-detail/1601234567890.html",
  "productId": "1601234567890",
  "price": "$5.00 - $8.00",
  "moq": "10 pieces",
  "soldOrder": "500+ sold",
  "companyName": "Example Apparel Co., Ltd.",
  "countryCode": "CN",
  "supplierYears": "5 yrs",
  "reviewScore": "4.8",
  "reviewCount": "120 Reviews",
  "imageUrl": "https://s.alicdn.com/example.jpg"
}
```

This record was produced by a `spider hoodie` search with `searchScope` set to `products` and enrichment disabled.

### Query and input reference

| Input | Type | Required | Default | Accepted values | Description |
|---|---:|---|---|---|---|
| `searchQueries` | array | No¹ | `["spider hoodie"]` | Any strings | Product keywords to search. |
| `productUrls` | array | No¹ | `[]` | Alibaba product URLs | Direct product pages. |
| `searchScope` | string | No | `products` | `products`, `worldwide` | Main catalog or worldwide supplier results. |
| `includeProductDetails` | boolean | No | `false` | `true` / `false` | Add specifications and price tiers (billed as `product-details`). |
| `includeProductReviews` | boolean | No | `false` | `true` / `false` | Collect reviews (billed as `product-review`). |
| `maxItems` | integer | No | `0` | `0` = unlimited | Maximum products to extract. |
| `maxReviews` | integer | No | `0` | `0` = all | Total reviews across the run when enabled. |
| `proxyConfiguration` | object | No | Apify residential | Proxy editor | Proxy settings. |

¹ At least one of `searchQueries` or `productUrls` must contain a value.

Minimal request:

```json
{ "searchQueries": ["spider hoodie"], "maxItems": 20 }
```

Advanced request (details and reviews enabled):

```json
{
  "searchQueries": ["spider hoodie"],
  "searchScope": "products",
  "includeProductDetails": true,
  "includeProductReviews": true,
  "maxItems": 20,
  "maxReviews": 50,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Retrieve the data through the API

1. Start the Actor with a JSON input.
2. Wait for the run to finish, or use the synchronous endpoint for small jobs.
3. Retrieve items from the run's default dataset.
4. Paginate or export the dataset.

Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("datascrapers/alibaba-scraper").call(
    run_input={"searchQueries": ["spider hoodie"], "maxItems": 50}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], item.get("price"))
```

For other languages, use the generated API tab on the Actor page.

### Data quality and record handling

- **Completeness** — listing fields (`title`, `price`, `moq`, `companyName`) are returned when Alibaba exposes them; `details` and `reviews` are conditional on the corresponding option.
- **Source changes** — Alibaba page structure changes can cause individual fields to come back empty; rows are still written with the fields that were found.
- **Deduplication** — the Actor writes one row per product per run and does not persist dedup state across runs. Deduplicate on `productId` (fallback `url`) when merging runs.
- **Retry/error behavior** — enrichment fails soft so a failed detail or review fetch does not discard the listing row.
- **Normalization** — `price` and `moq` are kept as Alibaba's display strings because ranges and units vary; `reviewScore` and `reviewCount` are display text.

### Export and pipeline examples

| Destination | Recommended method | Typical use |
|---|---|---|
| PostgreSQL/Supabase | Dataset API or webhook consumer | Supplier and product research tables |
| Google Sheets | Apify integration | Sourcing shortlists |
| S3/cloud storage | Scheduled export or integration | Archive category snapshots |

### Pricing and cost examples

Billing is pay per event. You are not charged Apify platform usage on top of these events.

| Event | When charged | Price |
|---|---|---|
| `product` | Each product row written | $1.50 per 1,000 |
| `product-details` | Each product with details fetched (when enabled) | $1.50 per 1,000 |
| `product-review` | Each review collected (when enabled) | $1.50 per 1,000 |

| Records | Estimated base cost |
|---:|---:|
| 1,000 products | $1.50 |
| 10,000 products | $15.00 |

Estimates assume listings only. Details and reviews add events at the same rate, and Apify plan discounts may reduce the per-event price.

### Limitations and responsible data use

- The Actor reads publicly accessible Alibaba.com listing data.
- Availability and source changes can produce empty or partial fields.
- No guarantee of historical snapshots unless you store results yourself.
- You are responsible for compliance with applicable terms, privacy, and legal requirements when using the data.

### Dataset questions

#### What does one dataset item represent?

One Alibaba product listing. Product details and reviews are nested on the same row rather than written as separate items.

#### Which field should I use as a unique identifier?

`productId` is the most stable Alibaba identifier; use `url` as a fallback.

#### Are fields nullable or conditional?

Many listing fields (`soldOrder`, `supplierYears`, `reviewScore`) are absent when Alibaba does not show them. `details` and `reviews` are present only when the matching option is enabled.

#### Can I retrieve the records as CSV or JSON?

Yes. Export from the Output tab as JSON, CSV, or Excel, or read the dataset through the Apify API.

#### How do I paginate large datasets?

Use `maxItems` to cap the number of products and `maxReviews` to cap total reviews. For API retrieval, paginate the default dataset items endpoint.

#### Does the Actor return historical data?

No. Each run captures the current state of the listings at run time.

#### What counts as a billable result?

Each product row is a `product` event. When enabled, each detail fetch is a `product-details` event and each review is a `product-review` event.

### Related datasets from Data Scrapers

- **[Amazon Search Scraper](https://apify.com/datascrapers/amazon-scraper)** — Amazon product and seller data for cross-marketplace sourcing.
- **[eBay Product Scraper](https://apify.com/datascrapers/ebay-scraper)** — eBay product and seller data for reseller research.
- **[Etsy Scraper](https://apify.com/datascrapers/etsy-scraper)** — Marketplace product data for niche and handmade sourcing.

### Data Scrapers support

Need an additional field, record type, or export workflow? Contact Data Scrapers at stardustspotlight@gmail.com. Include a sample source URL, required fields, expected record volume, and preferred delivery format.

# Actor input Schema

## `searchQueries` (type: `array`):

Product keywords to search on Alibaba.com, for example "spider hoodie".

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

Direct Alibaba product page URLs. Use these with search queries, or on their own.

## `searchScope` (type: `string`):

Products uses the main catalog. Worldwide uses the global-supplier product results.

## `includeProductDetails` (type: `boolean`):

Open each product page and add specifications, price tiers, and supplier profile. Charged once per product as product-extra. Off by default.

## `includeProductReviews` (type: `boolean`):

Collect reviews shown on each product page. Charged once per review as product-review. Off by default.

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

Maximum number of products to extract. 0 means no limit.

## `maxReviews` (type: `integer`):

Maximum number of reviews across the whole run when reviews are enabled. 0 means every review that loads.

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

Proxy settings. Residential proxies are used by default.

## Actor input object example

```json
{
  "searchQueries": [
    "spider hoodie"
  ],
  "productUrls": [],
  "searchScope": "products",
  "includeProductDetails": false,
  "includeProductReviews": false,
  "maxItems": 20,
  "maxReviews": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of product listings and, when enabled, review records.

## `runStats` (type: `string`):

Counts and timestamps for 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 = {
    "searchQueries": [
        "spider hoodie"
    ],
    "productUrls": [],
    "includeProductDetails": false,
    "includeProductReviews": false,
    "maxItems": 20,
    "maxReviews": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/alibaba-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 = {
    "searchQueries": ["spider hoodie"],
    "productUrls": [],
    "includeProductDetails": False,
    "includeProductReviews": False,
    "maxItems": 20,
    "maxReviews": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/alibaba-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 '{
  "searchQueries": [
    "spider hoodie"
  ],
  "productUrls": [],
  "includeProductDetails": false,
  "includeProductReviews": false,
  "maxItems": 20,
  "maxReviews": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datascrapers/alibaba-scraper --silent --output-dataset

```

## MCP server setup

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