# 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
- **Features:** Limited permissions
- **Stats:** 9 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.54 / 1,000 search result rows

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

### 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

The current price of every event is on the **Pricing** tab of this Actor's page in Apify Store. That tab is generated from the Actor's own pricing record, so it is always current, and your plan's rung is applied automatically. A figure repeated here would be a second copy that drifts out of date.

You can cap what any single run may spend with **Max total charge**.

### 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.

### Global marketplace toolkit

Part of the **Global marketplace toolkit** — product and pricing data across international B2B/B2C marketplaces and classifieds sites:

- [Shopify API Scraper](https://apify.com/rl1987/shopify-api-scraper) — Get product data from almost any Shopify store's public API.
- [Made-in-China.com API Scraper](https://apify.com/rl1987/made-in-china-api-scraper) — Scrapes product search results and details from Made-in-China.com's mobile app API.
- [Back Market API Scraper](https://apify.com/rl1987/backmarket-api-scraper) — Scrape refurbished-device listings and full product detail from Back Market's API.
- [Senukai.lt API Scraper](https://apify.com/rl1987/senukai-api-scraper) — Scrape Senukai.lt product listings and full detail — prices, discounts, EAN/GTIN, images.
- [Kleinanzeigen API Scraper](https://apify.com/rl1987/kleinanzeigen-api-scraper) — Scrape Kleinanzeigen (Germany) classified-ad listings and full details via mobile API.
- [Algolia API Scraper](https://apify.com/rl1987/algolia-api-scraper) — Generalised scraper for any Algolia-powered search index — scrape hits or discover facets.

### 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`):

Two-letter destination country used for shipping cost and availability. Note DHgate uses UK, not the ISO code GB - GB is accepted and rewritten to UK. Some products are not offered to every destination, so this changes how many results come back.

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

Three-letter currency for prices. DHgate prices in 52 currencies and silently returns US dollars for anything else (CNY and VND included), so an unsupported code stops the run with the list rather than delivering mislabelled dollars.

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

Language for product titles. DHgate serves this API in ar, de, en, es, fr, it, nl, pl, pt, ru, tr; any other code returns an empty product list rather than an error, so it is refused up front.

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

Max number of concurrent requests to DHgate.

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

Proxy used to reach DHgate. Not required - the API answers from a datacenter IP once the request carries the app's User-Agent - but a residential proxy is the fallback if DHgate ever starts refusing the platform's shared IPs, and it is what you want if results must reflect a particular country.

## Actor input object example

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

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// 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"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# 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"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
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/lWPXMedz8ruL1xgbS/openapi.json
