# Alibaba Product Search Api (`netdev/alibaba-product-search-api`) Actor

Search for any product from Alibaba. Supply your product name and get up to 60 matching supplier listings with prices, images, min\_order\_quantity, total sold and direct links.

- **URL**: https://apify.com/netdev/alibaba-product-search-api.md
- **Developed by:** [Net Dev](https://apify.com/netdev) (community)
- **Categories:** Automation, E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 search 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

### What does Alibaba Product Search API do?

**Alibaba Product Search API** turns one product phrase into structured results from [Alibaba](https://www.alibaba.com/).
Enter a phrase such as `earpiece for phone`; the Actor requests the relevant Alibaba search page through GeoNode, parses
the returned markdown, and saves products, prices, order requirements, suppliers, images, and available sales counts
to an Apify dataset. Run it from the Input tab, then use Apify's dataset API, schedules, integrations, monitoring, and
export tools to put the results into your workflow.

GeoNode is the only service that fetches Alibaba for this Actor. The Actor processes GeoNode's markdown locally, so
you receive clean, structured records without maintaining a scraper server yourself.

### Why use Alibaba Product Search API?

Use the Actor for supplier discovery, sourcing research, price comparison, catalog enrichment, and product-market
analysis. It preserves the values displayed on Alibaba while adding numeric values that are easier to filter. For
example, `price` can remain `$0.15-0.20`, while `price_min` and `price_max` support reporting and database queries.

### How to scrape Alibaba product data

1. Configure `GEONODE_SCRAPER_API_KEY` as a secret environment variable in the Actor's Apify Console settings.
2. Open the Actor's **Input** tab and enter one phrase in **Search text**.
3. Start the run.
4. Open the Dataset when the run completes, or retrieve it through the Apify API.

Each run processes one Alibaba results page, commonly around 60 product cards, and saves every valid product parsed
from that page. Pagination is not included in this version.

### Input

`searchText` is the only input field. It is required and contains one Alibaba product search phrase.

The API key is intentionally not an input. For local development, copy `.env.example` to `.env` and set
`GEONODE_SCRAPER_API_KEY`; `.env` is ignored by Git. The `npm start` command loads that local file when present. In
Apify Cloud, configure the same environment variable as a secret instead. Never commit or expose the key.

### Output

Each result is one product. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
    "name": "Flexible 3.5mm Wired Music Color ABS Earphones",
    "product_url": "https://www.alibaba.com/product-detail/...html",
    "price": "$0.15-0.20",
    "price_min": 0.15,
    "price_max": 0.2,
    "min_order": "1000 pieces",
    "supplier": "Shenzhen Guideray Electronic Co., Ltd.",
    "units_sold": "5,601"
}
```

### Alibaba product data fields

| Field                                               | Description                                           |
| --------------------------------------------------- | ----------------------------------------------------- |
| `name`                                              | Product title from the search card.                   |
| `product_url`                                       | Canonical Alibaba product page URL.                   |
| `image_url`                                         | Main product image when available.                    |
| `price`, `price_min`, `price_max`                   | Displayed price plus parsed numeric bounds.           |
| `min_order`, `min_order_quantity`, `min_order_unit` | Displayed and normalized minimum order.               |
| `supplier`, `units_sold`                            | Supplier name and displayed sold count, when present. |

### Pricing and cost estimation

#### How much does it cost to scrape Alibaba?

Each completed Alibaba search lookup costs **$0.10** through Apify's Pay-Per-Event pricing. One lookup covers one
GeoNode request and one Alibaba results page. The Actor stores the source markdown and dataset rows before it charges
one `search-lookup` event, and it checks the Apify run spending limit before starting the request.

Configure this price in the Apify Console, not in code: add custom event `search-lookup` at **$0.10**. Remove the
`apify-default-dataset-item` synthetic event or set it to **$0** so product rows are not charged separately. GeoNode
usage is billed by your GeoNode account according to its plan.

### Tips and advanced options

Use a focused phrase to improve relevance. If no products are parsed, inspect the `raw-markdown` key-value record;
it preserves the provider response for diagnostics. GeoNode manages its own purchased-thread capacity: requests beyond
the available thread allowance are queued by GeoNode. The Actor deliberately has no concurrency or batch setting, so
each run corresponds to one independent search lookup.

### FAQ, disclaimers, and support

This Actor is intended for lawful business research. You are responsible for complying with Alibaba's terms, robots
guidance, applicable laws, and your GeoNode account terms. Search layout and availability can change, so fields may
occasionally be missing and `units_sold` is nullable. Use the Actor's Issues tab for questions or feature requests;
custom sourcing, enrichment, and multi-page collection solutions can be developed separately.

# Actor input Schema

## `searchText` (type: `string`):

The Alibaba product phrase to search for.

## Actor input object example

```json
{
  "searchText": "earpiece for phone"
}
```

# Actor output Schema

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

No description

# 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 = {
    "searchText": "earpiece for phone"
};

// Run the Actor and wait for it to finish
const run = await client.actor("netdev/alibaba-product-search-api").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 = { "searchText": "earpiece for phone" }

# Run the Actor and wait for it to finish
run = client.actor("netdev/alibaba-product-search-api").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 '{
  "searchText": "earpiece for phone"
}' |
apify call netdev/alibaba-product-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,netdev/alibaba-product-search-api"
        }
    }
}

```

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/WlgTnxJng3qJ2iKCh/builds/RcHYVaSPapNH9E5Pr/openapi.json
