# DHgate API Scraper (`rl1987/dhgate-api-scraper`) Actor

Scrapes DHgate product search results and product detail pages via DHgate's mobile-app API.

- **URL**: https://apify.com/rl1987/dhgate-api-scraper.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 search result rows

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/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 DHgate API Scraper do?

**DHgate API Scraper** extracts product data from [DHgate](https://www.dhgate.com) by calling the same internal API the official Android app uses, instead of rendering and parsing HTML pages. Give it search keywords and it returns structured product listings (title, price, images, seller, rating); give it product itemcodes and it returns full product detail (SKUs, price tiers, supplier info, coupons). Run it on the Apify platform to get scheduling, API access, dataset export, and proxy support on top.

### Why use DHgate API Scraper?

- **Fast and cheap** — calls a JSON API directly, no browser rendering needed.
- **Structured data on demand** — feed keywords in, get clean dataset rows out, ready for spreadsheets, BI tools, or price-monitoring pipelines.
- **Full product detail** — optionally pull SKU/price-tier/supplier data for every listing found, or for a specific list of product itemcodes.

### How to use DHgate API Scraper

1. Click **Try for free** (or **Run**) on the Actor page.
2. Enter one or more **Search keywords** (e.g. `led strip light`), or paste a list of **Product itemcodes** to fetch detail directly.
3. Adjust **Max pages per keyword** and **Max items per keyword** to control how much you scrape.
4. Optionally enable **Fetch product detail (PDP)** to merge full product-detail data into each search result row.
5. Click **Start** and download results from the **Output** tab in JSON, CSV, Excel, or other formats.

### Input

The Actor accepts:

- **keywords** — search terms to look up on DHgate.
- **itemcodes** — product itemcodes to fetch detail for directly, skipping search.
- **maxPages** — search-result pages to fetch per keyword (20 products/page).
- **maxItemsPerKeyword** — cap on products collected per keyword.
- **fetchProductDetails** — also fetch full product detail for every search result.
- **shipToCountry**, **dispCurrency**, **language** — localization for prices/content.
- **maxConcurrency** — concurrent requests to DHgate.

See the **Input** tab for the full schema with defaults.

### Output

Each dataset item is a product row. Example for a search result with detail fetching enabled:

```json
{
    "source": "search",
    "keyword": "led strip light",
    "productId": 1059815893,
    "itemcode": "1059815893",
    "title": "Custom LED Strip Light 12V/24V 240LEDs SMD 2835",
    "price": "1.23",
    "lowPrice": "1.10",
    "highPrice": "1.50",
    "imageurl": "https://img.dhresource.com/...",
    "url": "https://www.dhgate.com/product/...",
    "sellername": "example-store",
    "feedBackPercent": "98.5%",
    "detail": {
        "productName": "Custom LED Strip Light 12V/24V 240LEDs SMD 2835 ...",
        "minPrice": 2.51,
        "maxPrice": 2.77,
        "minOrder": 50,
        "measureName": "Meter",
        "category": "Lights & Lighting > Holiday Lighting > LED Strips",
        "specification": { "Color": "White", "Certification": "CE UKCA FCC LVD RoHS" },
        "images": ["https://img4.dhresource.com/..."],
        "shipping": { "cost": 25.06, "timeMinDays": 7, "timeMaxDays": 28 },
        "seller": { "name": "magicled", "businessType": "Manufacturer", "country": "CN" }
    }
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

#### Data table

| Field | Description |
| --- | --- |
| `source` | `search` or `itemcode_input` |
| `keyword` | Search keyword that produced this row (search rows only) |
| `productId` / `itemcode` | DHgate product identifiers |
| `title` | Product title |
| `price` / `lowPrice` / `highPrice` | Listed price range |
| `imageurl` | Main product image |
| `url` | Canonical product page URL |
| `sellername` | Seller/store name |
| `feedBackPercent` | Seller feedback score |
| `detail` | Curated product-detail payload: price/order/shipping/seller/spec fields (only when detail fetching is used) |

### Pricing / Cost estimation

This Actor makes one lightweight HTTP request per search page and, optionally, one per product detail fetch — no browser is launched. Runs are cheap in compute units; cost scales roughly linearly with the number of pages/products requested. Check the **Cost estimation** panel on the Actor page before running large jobs.

### Tips or Advanced options

- Leave **Fetch product detail (PDP)** off if you only need listing-level data — it roughly doubles request volume.
- Use **Max items per keyword** instead of a large **Max pages per keyword** if you only need a sample rather than exhaustive coverage.
- Provide **itemcodes** directly when you already know which products you want detail for — this skips search entirely.

### FAQ, disclaimers, and support

This Actor is intended for legitimate data collection (price monitoring, market research, catalog aggregation). You are responsible for complying with DHgate's Terms of Service and applicable law in your jurisdiction. The API endpoints and signing scheme used here were reverse-engineered from DHgate's public Android app and may change without notice, which can break this Actor until updated.

Found a bug or have a feature request? Use the **Issues** tab on this Actor's page. Custom scraping solutions are also available on request.

### Did you find this useful?

⭐ Rate this actor on Apify! Your feedback helps other users find it and helps us keep improving it.

# Actor input Schema

## `keywords` (type: `array`):

Keywords to search for on DHgate. Leave empty if only using "Product itemcodes" below.

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

Number of search-result pages to fetch per keyword (20 products/page).

## `maxItemsPerKeyword` (type: `integer`):

Stop fetching more pages for a keyword once this many products were collected (0 = no limit, only maxPages applies).

## `fetchProductDetails` (type: `boolean`):

For every found product, also call the product-detail endpoint and merge the extra fields (price tiers, SKUs, supplier info) into the output item. One extra request per product.

## `itemcodes` (type: `array`):

Optional: fetch product detail directly for these itemcodes, without running a search.

## `shipToCountry` (type: `string`):

Country code used for localized pricing/shipping.

## `dispCurrency` (type: `string`):

Currency code for displayed prices.

## `language` (type: `string`):

Language code for the response content.

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

Max number of concurrent requests to DHgate.

## Actor input object example

```json
{
  "keywords": [
    "led strip light"
  ],
  "maxPages": 1,
  "maxItemsPerKeyword": 0,
  "fetchProductDetails": false,
  "shipToCountry": "NL",
  "dispCurrency": "EUR",
  "language": "en",
  "maxConcurrency": 5
}
```

# Actor output Schema

## `dataset` (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 = {
    "keywords": [
        "led strip light"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/dhgate-api-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 = { "keywords": ["led strip light"] }

# Run the Actor and wait for it to finish
run = client.actor("rl1987/dhgate-api-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 '{
  "keywords": [
    "led strip light"
  ]
}' |
apify call rl1987/dhgate-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rl1987/dhgate-api-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/Y3Tdc6Nxm40ujiWUh/builds/0DhkKsnOSnbRH279f/openapi.json
