# Alibaba B2B Product Scraper (`w3crawler/alibaba-b2b-scraper`) Actor

Direct public SSR/JSON-LD scraper for Alibaba.com B2B product listings, including MOQ, prices, supplier ratings, and bounded product metadata.

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

## Pricing

from $2.99 / 1,000 b2b products

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Alibaba B2B Product Scraper

Browser-first extraction for public Alibaba.com product search and product-detail pages. The Actor supports rich product fields, multiple sources, bounded pagination, global filtering/sorting/deduplication, optional product-detail enrichment, Apify Proxy routing, and fail-closed diagnostics.

The dataset is marketplace-focused. Product rows intentionally omit Actor-debugging wrappers such as `recordId`, `recordType`, `status`, `success`, `ok`, `dataAvailable`, `found`, `fieldCoverage`, `dataQuality`, `extractionMethod`, `fallbackMode`, and `usedProxy`. Operational counts remain in `OUTPUT_SUMMARY`.

### Extracted fields

Depending on public availability, product rows can include:

- identity: `productId`, `title`, `name`, `productUrl`, `url`
- pricing and order terms: `price`, `priceFormatted`, `priceMin`, `priceMax`, `currency`, `moq`, `minimumOrderQuantity`, `minimumOrderUnit`
- supplier: `supplierName`, `companyName`, `supplierSlug`, `supplierId`, `companyId`, `supplierProfileUrl`, `supplierHomepage`, `supplierCountry`, `supplierLocation`, `supplierYears`, `supplierYearsText`
- ratings and engagement: `supplierRating`, `productRating`, `supplierReviewCount`, `reviewCount`, `productScore`, `shippingScore`, `starLevel`, `soldCount`, `soldText`, `reorderRatePercent`, `reorderRateText`
- delivery and merchandising: `deliveryText`, `leadTime`, `shippingInfo`, `isAd`, `isCertified`, `certified`, `canAddToCart`, `canChatNow`, `badges`, `badgeTexts`, `badgeCount`, `promotions`, `sellingPoints`
- media and details: `imageUrl`, `thumbnail`, `images`, `imageUrls`, `imageCount`, `imageAlt`, `description`, `brand`, `sku`, `manufacturer`, `category`, `attributes`, `detailImageUrls`, `availability`, `detailPrice`, `detailCurrency`, `detailRating`, `detailReviewCount`, `detailCanonicalUrl`
- provenance: `source`, `sourceUrl`, `pageNumber`, `pageNum`, `position`, `keyword`, `country`, `locale`, `keywordMatchScore`, `scrapedAt`

Missing values are omitted rather than guessed. `thumbnail`, `imageUrl`, and `imageUrls[0]` point to the same validated product image when media is available. Images are scoped to the product card/detail payload and filtered for common non-product assets.

### Input examples

#### Keyword search

```json
{
  "keyword": "wireless earbuds",
  "maxItems": 40,
  "maxPages": 3,
  "sortBy": "best_match",
  "includeMedia": true,
  "includeDetails": false
}
```

#### Filters and global sorting

```json
{
  "keyword": "led work light",
  "maxItems": 100,
  "maxPages": 5,
  "sortBy": "rating_desc",
  "excludeAds": true,
  "certifiedOnly": true,
  "supplierCountry": "CN",
  "minPrice": 10,
  "maxPrice": 40,
  "minOrderQuantity": 5,
  "minSupplierRating": 4.7,
  "minReviewCount": 100,
  "minSoldCount": 300,
  "minReorderRatePercent": 30,
  "requiredBadges": ["certified"]
}
```

#### Multiple sources and detail enrichment

```json
{
  "startUrls": [
    { "url": "https://www.alibaba.com/trade/search?SearchText=packaging&has4Tab=true&tab=all" },
    { "url": "https://www.alibaba.com/trade/search?SearchText=gift+bags&has4Tab=true&tab=all" },
    { "url": "https://www.alibaba.com/product-detail/Rechargeable-LED-Work-Light_1234567890123.html" }
  ],
  "maxItems": 100,
  "maxPages": 4,
  "includeDetails": true,
  "maxDetailItems": 20,
  "deduplicate": true,
  "includeDiagnostics": true
}
```

#### Developer options and Apify Proxy

```json
{
  "keyword": "wireless earbuds",
  "requestDelayMs": 1200,
  "maxConcurrency": 2,
  "maxRequestRetries": 3,
  "requestTimeoutSecs": 60,
  "requestHandlerTimeoutSecs": 300,
  "selectorTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

`maxPages: 0` enables automatic pagination with a hard 100-page cap. `maxItems` is global across every source and page. Pages within one source are sequential; `maxConcurrency` limits independent source work. Proxy routing only changes transport; it does not solve CAPTCHA or bypass an access control.

#### Deterministic local QA

```json
{
  "keyword": "led light",
  "fixtureFile": "fixtures/sample.html",
  "maxItems": 10,
  "maxPages": 1,
  "requestDelayMs": 0,
  "includeDiagnostics": true
}
```

### Product output example

```json
{
  "productId": "1234567890123",
  "title": "Rechargeable LED Work Light",
  "name": "Rechargeable LED Work Light",
  "url": "https://www.alibaba.com/product-detail/Rechargeable-LED-Work-Light_1234567890123.html",
  "productUrl": "https://www.alibaba.com/product-detail/Rechargeable-LED-Work-Light_1234567890123.html",
  "price": "US $12.50 - US $18.75",
  "priceMin": 12.5,
  "priceMax": 18.75,
  "currency": "USD",
  "minimumOrderQuantity": 10,
  "minimumOrderUnit": "pieces",
  "supplierName": "Example Lighting Co., Ltd.",
  "supplierProfileUrl": "https://examplelighting.en.alibaba.com/company_profile.html",
  "supplierCountry": "CN",
  "supplierYears": 8,
  "supplierRating": 4.8,
  "productRating": 4.7,
  "reviewCount": 125,
  "soldCount": 320,
  "reorderRatePercent": 32,
  "isCertified": true,
  "badges": ["Certified", "CE"],
  "images": [
    "https://s.alicdn.com/@sc04/kf/rechargeable-led-work-light.jpg",
    "https://s.alicdn.com/@sc04/kf/rechargeable-led-work-light-side.jpg"
  ],
  "imageUrl": "https://s.alicdn.com/@sc04/kf/rechargeable-led-work-light.jpg",
  "thumbnail": "https://s.alicdn.com/@sc04/kf/rechargeable-led-work-light.jpg",
  "imageCount": 2,
  "source": "Alibaba.com",
  "sourceUrl": "https://www.alibaba.com/trade/search?SearchText=led+light&has4Tab=true&tab=all",
  "pageNumber": 1,
  "position": 1,
  "scrapedAt": "2026-09-05T00:00:00.000Z"
}
```

Blocked or unavailable public pages produce a minimal diagnostic row:

```json
{
  "url": "https://www.alibaba.com/trade/search?SearchText=wireless+earbuds",
  "error": "Alibaba presented an access-control or challenge response.",
  "errorCode": "ACCESS_BARRIER_BLOCKED"
}
```

### Local validation

```bash
npm ci --omit=dev
npm test
apify validate-schema
apify run --purge --input-file test-inputs/default.json
npm run validate
```

The validator checks canonical product URLs, product-scoped image URLs, `thumbnail === images[0]`, and the absence of debugging wrappers. The Actor never fabricates product data when Alibaba returns a challenge, login wall, rate limit, or empty public response.

# Actor input Schema

## `keyword` (type: `string`):

Product phrase used for the default Alibaba search URL. Canonical field; keyword/query aliases are accepted for compatibility.

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

Optional public Alibaba.com search or product-detail URLs. Multiple sources are crawled with one global maxItems cap.

## `sourceUrls` (type: `array`):

Compatibility alias for startUrls. If both are supplied, startUrls are processed first.

## `sourceUrl` (type: `string`):

Compatibility alias for one public Alibaba.com URL. It is appended after startUrls/sourceUrls.

## `searchUrl` (type: `string`):

Compatibility alias for one public Alibaba.com search URL.

## `keywords` (type: `string`):

Compatibility alias for keyword; canonical keyword takes precedence.

## `searchQuery` (type: `string`):

Compatibility alias for keyword.

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

Compatibility alias for keyword.

## `queries` (type: `array`):

Compatibility alias; the first non-empty query is used.

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

Configured market. The current actor supports the public global Alibaba.com catalog.

## `locale` (type: `string`):

Locale used for browser and HTTP Accept-Language headers. Alibaba may still choose the displayed currency/catalog.

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

Global maximum number of product rows across all sources and pages. Diagnostics do not consume this product cap.

## `maxPages` (type: `integer`):

Per-source page bound. Use 0 to follow observed next-page links up to the actor hard cap of 100 pages.

## `max_products` (type: `integer`):

Compatibility alias for maxItems.

## `maxProducts` (type: `integer`):

Compatibility alias for maxItems.

## `max_pages` (type: `integer`):

Compatibility alias for maxPages.

## `sortBy` (type: `string`):

Global sort applied after all requested sources/pages are collected. Missing values sort after populated values.

## `excludeAds` (type: `boolean`):

Discard cards that Alibaba labels as ads.

## `certifiedOnly` (type: `boolean`):

Keep only cards displaying Alibaba certification text/badges.

## `supplierCountry` (type: `string`):

Optional displayed supplier country/region code such as CN or IN. Use any for all countries.

## `supplierLocation` (type: `string`):

Optional case-insensitive match against publicly exposed supplier location/country text.

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

Keep products whose displayed price range reaches this value. No currency conversion is performed.

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

Keep products whose displayed price range overlaps this value. No currency conversion is performed.

## `minOrderQuantity` (type: `number`):

Keep products with a displayed minimum order quantity at or above this value.

## `minSupplierRating` (type: `number`):

Keep products with a displayed supplier rating at or above this five-point value.

## `minReviewCount` (type: `integer`):

Keep products with at least this displayed supplier review count.

## `minSoldCount` (type: `integer`):

Keep products with at least this publicly displayed sold count.

## `minReorderRatePercent` (type: `number`):

Keep products with a displayed reorder rate at or above this percentage.

## `requiredBadges` (type: `array`):

Keep products whose normalized badge text includes every listed value, for example certified.

## `includeMedia` (type: `boolean`):

Include validated public Alibaba CDN imageUrl, thumbnail, images, imageUrls, imageCount, and imageAlt fields.

## `includeDetails` (type: `boolean`):

After selecting products, visit up to maxDetailItems public product-detail pages for description, brand, SKU, attributes, detail images, availability, price, rating, and canonical metadata.

## `maxDetailItems` (type: `integer`):

Bound the number of optional product-detail visits. Detail failures remain attached to the base product row.

## `include_details` (type: `boolean`):

Compatibility alias for includeDetails.

## `deduplicate` (type: `boolean`):

Suppress repeated product IDs across pages and sources.

## `includeDiagnostics` (type: `boolean`):

Write explicit run\_diagnostic rows for blocked, failed, or no-data pages.

## `requestDelayMs` (type: `integer`):

Delay before each browser/HTTP page request. Use a bounded value that respects the source.

## `pageDelayMs` (type: `integer`):

Compatibility alias for requestDelayMs.

## `maxConcurrency` (type: `integer`):

Maximum concurrent browser requests for search/detail crawling.

## `maxRequestRetries` (type: `integer`):

Retries for transient browser/HTTP failures. Access barriers are not bypassed or retried as a workaround.

## `requestTimeoutSecs` (type: `integer`):

Per-navigation and HTTP request timeout.

## `navigationTimeoutSecs` (type: `integer`):

Compatibility alias for requestTimeoutSecs.

## `timeoutMs` (type: `integer`):

Compatibility alias for requestTimeoutSecs.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum allowed time for one Crawlee request handler, including page extraction.

## `selectorTimeoutSecs` (type: `integer`):

Reserved compatibility option for selector readiness checks.

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

Optional standard Apify Proxy routing for public requests. Proxying changes the route only; it does not solve CAPTCHA or bypass access controls.

## `verified_supplier` (type: `boolean`):

Compatibility alias for certifiedOnly.

## `alibaba_guaranteed` (type: `boolean`):

Compatibility alias for certifiedOnly.

## `price_min` (type: `number`):

Compatibility alias for minPrice.

## `price_max` (type: `number`):

Compatibility alias for maxPrice.

## `moq_min` (type: `number`):

Compatibility alias for minOrderQuantity.

## `fixtureFile` (type: `string`):

Optional Actor-relative HTML fixture for deterministic validation. When present, the HTTP parser is used and no live request is made.

## Actor input object example

```json
{
  "keyword": "wireless earbuds",
  "country": "global",
  "locale": "en-US",
  "maxItems": 40,
  "maxPages": 3,
  "sortBy": "best_match",
  "excludeAds": false,
  "certifiedOnly": false,
  "supplierCountry": "any",
  "includeMedia": true,
  "includeDetails": false,
  "maxDetailItems": 40,
  "deduplicate": true,
  "includeDiagnostics": true,
  "requestDelayMs": 1000,
  "maxConcurrency": 2,
  "maxRequestRetries": 3,
  "requestTimeoutSecs": 60,
  "requestHandlerTimeoutSecs": 300,
  "selectorTimeoutSecs": 30
}
```

# Actor output Schema

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

Dataset containing product records and, when enabled, blocked or unavailable run diagnostics.

## `runSummary` (type: `string`):

OUTPUT\_SUMMARY JSON record in the default key-value store.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/alibaba-b2b-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/alibaba-b2b-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 '{}' |
apify call w3crawler/alibaba-b2b-scraper --silent --output-dataset

```

## MCP server setup

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