# Alibaba Product Scraper (`happitap/alibaba-product-scraper`) Actor

Extract comprehensive product data from Alibaba.com including prices, suppliers, specifications, MOQ, certifications, and more. Perfect for B2B sourcing, market research, and supplier discovery.

- **URL**: https://apify.com/happitap/alibaba-product-scraper.md
- **Developed by:** [HappiTap](https://apify.com/happitap) (community)
- **Categories:** E-commerce, Developer tools, Automation
- **Stats:** 318 total users, 63 monthly users, 99.9% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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/platform/actors/running/actors-in-store#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 Product Scraper

Extract comprehensive product data from Alibaba.com including prices, suppliers, specifications, MOQ, certifications, and more. Perfect for B2B sourcing, market research, and supplier discovery.

### 🚀 What does this actor do?

This powerful scraper automates the extraction of product information from Alibaba.com, delivering structured data including:

- **Product Details**: Title, description, specifications, certifications
- **Pricing Information**: Price ranges, currency, MOQ (Minimum Order Quantity)
- **Supplier Data**: Company name, verification status, Trade Assurance, Gold Supplier
- **Product Images**: Multiple product images
- **Ratings & Reviews**: Product ratings and review counts
- **Shipping Info**: Delivery times, shipping methods
- **Technical Specs**: Materials, dimensions, features, customization options

### 💡 Use Cases

- **Supplier Discovery**: Find and evaluate potential suppliers
- **Market Research**: Analyze product trends and pricing
- **Price Monitoring**: Track competitor pricing
- **Product Sourcing**: Compare products from multiple suppliers
- **Due Diligence**: Verify supplier credentials
- **Competitive Analysis**: Understand market positioning

### 📋 Input Configuration

#### Required Fields

- **Search Queries** OR **Start URLs**: At least one must be provided
  - Search Queries: Keywords to search (e.g., "wireless earphones")
  - Start URLs: Direct product or search page URLs

#### Optional Fields

- **Max Products Per Query**: Limit products per search (default: 50)
- **Max Concurrency**: Concurrent page processing (default: 5)
- **Proxy Configuration**: Recommended to use Apify proxy
- **Price Filters**: Min/max price in USD
- **MOQ Filters**: Min/max order quantity
- **Trade Assurance**: Only suppliers with Trade Assurance
- **Verified Suppliers**: Only verified suppliers
- **Extend Output Function**: Custom data transformation
- **Debug Logging**: Enable detailed logs

### 📊 Output Format

Each product includes:

```json
{
  "title": "Product name",
  "price": { "min": 5.99, "max": 12.99, "currency": "USD" },
  "minOrderQuantity": 100,
  "supplier": {
    "name": "Company Name",
    "isVerified": true,
    "hasTradeAssurance": true,
    "yearsInBusiness": "8 years"
  },
  "specifications": { "Material": "Aluminum", "Color": "Black" },
  "images": ["url1", "url2"],
  "rating": 4.8,
  "reviewCount": 156,
  "certifications": ["CE", "FCC", "RoHS"]
}
```

### 🎯 How to Use

1. **Search by Keywords**:
   - Enter search queries: "laptop stand", "phone case"
   - Set max products per query
   - Apply filters (price, MOQ, verified suppliers)

2. **Scrape Specific Products**:
   - Add product URLs to Start URLs
   - Can mix product and search page URLs

3. **Advanced Filtering**:
   - Filter by price range
   - Filter by minimum order quantity
   - Only verified suppliers
   - Only Trade Assurance suppliers

### ⚙️ Configuration Tips

- **Use Proxies**: Alibaba has anti-bot protection - use Apify proxy
- **Concurrency**: Start with 5, increase if stable
- **Filters**: Apply filters to reduce unnecessary scraping
- **MOQ**: Set min/max order quantity based on your needs

### 🔧 Extend Output Function

Customize the output data:

```javascript
async (data, { page, request }) => {
  // Add custom calculations
  data.pricePerUnit = data.price.min / data.minOrderQuantity;
  
  // Add custom fields
  data.isAffordable = data.price.min < 10;
  
  return data;
}
```

### 📈 Performance

- Speed: ~5-10 products per minute
- Memory: 1-4 GB recommended
- Best with Apify residential proxies

### 🚨 Important Notes

- **Proxies Required**: Alibaba blocks datacenter IPs - use residential proxies
- **Rate Limiting**: Don't set concurrency too high
- **Data Accuracy**: Alibaba's structure may change - report issues
- **Terms of Service**: Use responsibly and respect Alibaba's ToS

### 💰 Cost Optimization

- Use filters to scrape only relevant products
- Set `maxProductsPerQuery` to limit results
- Use search queries instead of browsing all pages
- Monitor proxy usage

### 🐛 Troubleshooting

**No products found**

- Verify search query or URL is correct
- Check proxy configuration
- Enable debug logging

**Blocked requests**

- Use residential proxies
- Reduce concurrency
- Check Apify proxy status

**Missing data**

- Some fields may not be available for all products
- Alibaba's HTML structure varies by product type
- Enable debug logging to see extraction details

### 📞 Support

For issues or questions:

- Check the logs for error messages
- Enable debug logging for detailed information
- Contact Apify support for platform issues

***

**Note**: This scraper is for educational and research purposes. Always comply with Alibaba's Terms of Service and applicable laws.

# Actor input Schema

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

List of Alibaba product or search page URLs to scrape. Can be product detail pages or search result pages. Leave empty to use Search Queries instead.

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

Product search queries to scrape from Alibaba. The scraper will search for these terms and extract products from results. Example: wireless earphones, laptop stand, phone case

## `maxProductsPerQuery` (type: `integer`):

Maximum number of products to scrape per search query. Set to 0 for unlimited.

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

Maximum number of pages to process concurrently. Higher values = faster but more resource intensive.

## `proxyConfig` (type: `object`):

Proxy settings for the scraper. Recommended to use Apify proxy for best results.

## `minPrice` (type: `integer`):

Filter products by minimum price in USD. Leave empty for no minimum.

## `maxPrice` (type: `integer`):

Filter products by maximum price in USD. Leave empty for no maximum.

## `minOrderQuantity` (type: `integer`):

Filter products by minimum order quantity. Leave empty for no filter.

## `maxOrderQuantity` (type: `integer`):

Filter products by maximum order quantity. Leave empty for no filter.

## `tradeAssurance` (type: `boolean`):

Only scrape products from suppliers with Trade Assurance protection.

## `verifiedSuppliers` (type: `boolean`):

Only scrape products from verified suppliers.

## `extendOutputFunction` (type: `string`):

Function to extend or modify the output data. Receives (data, { page, request }) and should return modified data.

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

Maximum time in seconds the scraper will run before gracefully stopping and saving whatever it has collected. Default is 270s (4.5 min). Capped at 270s to stay within 5-min limit.

## `debugLog` (type: `boolean`):

Enable detailed debug logging for troubleshooting.

## Actor input object example

```json
{
  "startUrls": [],
  "searchQueries": [
    "wireless mouse"
  ],
  "maxProductsPerQuery": 50,
  "maxConcurrency": 5,
  "proxyConfig": {
    "useApifyProxy": true
  },
  "tradeAssurance": false,
  "verifiedSuppliers": false,
  "extendOutputFunction": "async (data, { page, request }) => {\n  // Modify data here\n  return data;\n}",
  "timeoutSecs": 270,
  "debugLog": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Quick overview of all products with key metrics including pricing, MOQ, supplier info, and ratings

## `suppliers` (type: `string`):

Detailed supplier information including verification status, years in business, and trade assurance

## `pricing` (type: `string`):

Price comparison view focusing on pricing ranges, currency, and minimum order quantities

## `allProducts` (type: `string`):

Complete dataset with all scraped fields including specifications, certifications, and detailed descriptions

# 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": [
        "wireless mouse"
    ],
    "extendOutputFunction": async (data, { page, request }) => {
      // Modify data here
      return data;
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("happitap/alibaba-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 = {
    "searchQueries": ["wireless mouse"],
    "extendOutputFunction": """async (data, { page, request }) => {
  // Modify data here
  return data;
}""",
}

# Run the Actor and wait for it to finish
run = client.actor("happitap/alibaba-product-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "wireless mouse"
  ],
  "extendOutputFunction": "async (data, { page, request }) => {\\n  // Modify data here\\n  return data;\\n}"
}' |
apify call happitap/alibaba-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=happitap/alibaba-product-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/agR1JccKsk4YGJM9A/builds/84DR1T91l4ZqG9cDo/openapi.json
