# DHgate Scraper - Prices, MOQ, Sold Counts & Stores ($0.50/1K) (`ragnum/dhgate-scraper`) Actor

Scrape DHgate.com search and category results: wholesale price ranges, MOQ, sold counts, ratings and store data, plus optional quantity price tiers. $0.50 per 1,000 products, platform usage included; failed pages and duplicates are free.

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

## Pricing

from $0.35 / 1,000 product scrapeds

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

## DHgate Scraper: Wholesale Prices, MOQ, Sold Counts & Stores

Scrape **DHgate.com** search and category results into clean, typed rows: wholesale price ranges, minimum order quantity (MOQ), sold counts, ratings, discounts, coupons and the seller store behind each product. Turn on **price tiers** to also get each product's quantity price breaks (for example 1–9 pcs $34.33 … 1,000+ pcs $16.39).

- **$0.50 per 1,000 products.** Platform usage is included.
- **+$2.00 per 1,000 products with price tiers** (optional).
- **Blocked pages, empty pages and duplicates are free.** You pay only for rows delivered.
- Same output schema as Ragnum's **Alibaba, AliExpress and Facebook Marketplace** scrapers, so one script or AI agent can compare prices across marketplaces.

### What you get

| | |
|---|---|
| **Search by keyword** | Any product keyword, e.g. "yoga mat", "led strip", "packaging box" |
| **Category listings** | Paste a DHgate category URL such as `https://www.dhgate.com/wholesale/yoga-mats/c024064004009.html` |
| **Sort** | Best match, Most orders, Price low → high, Price high → low, Newest |
| **Wholesale fields** | Price range, MOQ value and unit, store feedback %, seller tier, free shipping, US warehouse, coupons |
| **Price tiers** (opt-in) | Every quantity break with its unit price, plus the category path |
| **Prices in US dollars** | Ship-to United States. Every row says its currency and flags anything that isn't USD |
| **Run report** | `RUN_SUMMARY` with pages tried, blocks, success rate and rows per keyword |

### Input example

```json
{
  "keywords": ["yoga mat", "bluetooth earbuds"],
  "sortBy": "orders",
  "maxItemsPerKeyword": 100,
  "maxPagesPerKeyword": 4,
  "includeDetails": false
}
```

Or start from DHgate URLs:

```json
{
  "startUrls": [
    { "url": "https://www.dhgate.com/wholesale/search.do?searchkey=led+strip" },
    { "url": "https://www.dhgate.com/wholesale/yoga-mats/c024064004009.html" }
  ],
  "maxItemsPerKeyword": 200,
  "maxPagesPerKeyword": 6
}
```

| Input | Default | Notes |
|---|---|---|
| `keywords` | `["yoga mat"]` (prefill) | One search per keyword |
| `startUrls` | — | DHgate search URLs (`/wholesale/search.do?searchkey=…`) or category URLs (`/wholesale/<name>/c<id>.html`, `…c<id>-<page>.html`). Product and store pages are rejected with a clear message |
| `sortBy` | `default` | `default`, `orders`, `priceAsc`, `priceDesc`, `newest` |
| `shipToCountry` | `US` | United States only in this version |
| `includeDetails` | `false` | Adds `priceTiers`, `categoryPath`, `detailFetched` from each product page |
| `maxItemsPerKeyword` | 20 | Up to 3,000 (DHgate's own limit per search) |
| `maxPagesPerKeyword` | 2 | Up to 50. About 40–50 products per page |
| `maxRetriesPerPage` | 10 | Advanced |
| `proxyConfiguration` | Managed for you | Advanced. Included in the price |

### Pricing

| Event | Price | When it's charged |
|---|---|---|
| `product` | **$0.0005** ($0.50 per 1,000) | One product row saved to the dataset |
| `product-detail` | **$0.002** ($2.00 per 1,000) | Only with `includeDetails`, and only when the product page was read and the price tiers were added |

- **Platform usage (compute, proxy, storage) is included.** There's no start fee.
- **Not charged:** blocked or failed pages, retries, empty pages, duplicate products, and detail pages that couldn't be loaded. Such a product is still delivered with `detailFetched: false`, charged as `product` only.
- **Spending limit:** if you set a maximum cost per run, the scraper stops cleanly at it. It never fetches price tiers it can't charge for.
- **Example:** 100 products cost $0.05, or $0.25 with price tiers.

### Output

One row per unique product (deduplicated by `productId` within a run). Example (shortened):

```json
{
  "marketplace": "dhgate",
  "productId": "1066500486",
  "title": "Contrast-Colored PU Natural Rubber Yoga Mat - Anti-Slip …",
  "url": "https://www.dhgate.com/product/contrast-colored-pu-natural-rubber-yoga-mat/1066500486.html",
  "imageUrl": "https://img4.dhresource.com/webp/m/300x300/f3/albu/ys/o/15/fcc6a113-….jpg",
  "price": 16.39, "originalPrice": 38.11, "discountPercent": 57,
  "currency": "USD", "currencyMismatch": false,
  "rating": 5, "reviewCount": 1, "soldCount": 1, "soldText": "1",
  "storeName": "keshanue1", "storeId": "22002356",
  "storeUrl": "https://www.dhgate.com/store/top-selling/22002356.html",
  "keyword": "yoga mat", "page": 1, "position": 1, "isSponsored": false,
  "scrapedAt": "2026-11-07T22:25:20.569Z",
  "priceMin": 16.39, "priceMax": 34.33, "priceText": "US $16.39 - 34.33",
  "moqValue": 1, "moqUnit": "Piece",
  "storeFeedbackPercent": 97.2, "storeLevel": 2, "freeShipping": null, "usLocalWarehouse": false,
  "coupons": ["$3 off $30+"],
  "priceTiers": [
    { "minQty": 1, "maxQty": 9, "price": 34.33 },
    { "minQty": 10, "maxQty": 13, "price": 32.61 },
    { "minQty": 14, "maxQty": 99, "price": 31.14 },
    { "minQty": 100, "maxQty": 999, "price": 26.22 },
    { "minQty": 1000, "maxQty": null, "price": 16.39 }
  ],
  "categoryPath": ["Sports & Outdoors", "Fitness Supplies", "Yoga", "Yoga Mats"],
  "detailFetched": true
}
```

| Field | Type | Description |
|---|---|---|
| `marketplace` | string | Always `"dhgate"` |
| `productId` | string | DHgate item code |
| `title` | string | null | Product title |
| `url` | string | Product page URL |
| `imageUrl` | string | null | Main image URL (images are never downloaded) |
| `price` | number | null | Lowest current unit price (the largest-quantity tier) |
| `originalPrice` | number | null | Lowest price before the running discount; null without a discount |
| `discountPercent` | number | null | Discount in percent |
| `currency` | string | ISO code detected from the price text; prices are never converted |
| `currencyMismatch` | boolean | True when the row isn't in USD |
| `rating` | number | null | Average out of 5; **null when there are no reviews** (never 0) |
| `reviewCount` | integer | null | Number of reviews |
| `soldCount` | integer | null | Recent sales as a number |
| `soldText` | string | null | Sales count exactly as DHgate gives it |
| `storeName` | string | null | Seller store name |
| `storeId` | string | null | DHgate store number |
| `storeUrl` | string | null | Store URL |
| `keyword` | string | null | Keyword that found the row; null for category listings |
| `page` | integer | Results page (1-based) |
| `position` | integer | Position on the page (ads included) |
| `isSponsored` | boolean | null | True for ads |
| `scrapedAt` | string | ISO timestamp |
| `priceMin` / `priceMax` | number | null | Lowest and highest unit price on the card |
| `priceText` | string | null | Price as displayed |
| `moqValue` | integer | null | Minimum order quantity |
| `moqUnit` | string | null | MOQ unit ("Piece", "Pieces", "Lot", …) |
| `storeFeedbackPercent` | number | null | Store's positive feedback rate |
| `storeLevel` | integer | null | DHgate seller tier (1–6) |
| `freeShipping` | boolean | null | Free-shipping flag from the card |
| `usLocalWarehouse` | boolean | Ships from a US local warehouse |
| `coupons` | string\[] | Store coupons on the card |
| `priceTiers` | array | null | *includeDetails:* `[{minQty, maxQty, price}]`; `maxQty` is null for the last, open-ended tier |
| `categoryPath` | string\[] | null | *includeDetails:* category breadcrumb |
| `detailFetched` | boolean | *includeDetails:* true when the price tiers were added |

The first 22 fields are the **Ragnum core schema**. They have the same names and types in our Alibaba, AliExpress and Facebook Marketplace scrapers.

### How many pages are read, and what happens when a page fails

A keyword stops at whichever comes first:

- `maxItemsPerKeyword`
- `maxPagesPerKeyword`
- the last page of results (DHgate shows at most 3,000 results per search)

DHgate sometimes refuses automated requests. The scraper doesn't try to get around this; it retries the page later, up to `maxRetriesPerPage` times, at no cost to you. A page that still fails **doesn't stop the keyword**: the next page is fetched. Failed pages do count toward `maxPagesPerKeyword`, so set it a page or two above `products ÷ 45` if you need an exact number.

### Run summary (`RUN_SUMMARY`)

Every run writes a `RUN_SUMMARY` record to its key-value store (also linked in the run's Output tab):

- **totals:** pages attempted, succeeded and failed, attempts, blocks, rows pushed, details fetched and failed, page success rate, block rate, attempts per page
- **per keyword:** the same numbers, blocks, duplicates skipped, pages with no results, currencies seen
- **currencyBreakdown**, **shipCountries**, **fillRates** per field
- **warnings:**
  - `STRUCTURE_CHANGE_SUSPECTED`: a page loaded but parsed to 0 products, or a key field dropped below 90% filled. DHgate changes its site from time to time, and we watch this.
  - `CURRENCY_MISMATCH`
  - `CHARGE_LIMIT_REACHED`
- **chargeLimitReached:** true when the run stopped at your spending limit

The run's status message sums it up, e.g. `120 products from 3/3 pages`.

### Use with AI agents / Apify MCP

Add this scraper as a tool for Claude, Cursor or any MCP client:

```
https://mcp.apify.com?tools=ragnum/dhgate-scraper
```

The input descriptions are written for agents as well as people. The output uses typed numbers (no "US $" strings to parse), and the core fields match our Alibaba, AliExpress and Facebook Marketplace scrapers. That makes "find the cheapest supplier for X across marketplaces" a single tool call per site.

### Scope

- Public, logged-out DHgate listing data. Optionally, the public product page for price tiers.
- Store-level data only. No buyer or reviewer personal data. Images are linked, not downloaded.
- US ship-to, prices in US dollars.
- Search and category listings.

### Your responsibility

This scraper reads publicly visible pages, the same ones a visitor sees without logging in. You're responsible for using it, and the data you collect, in line with DHgate's Terms of Use, its robots.txt, and the laws that apply to you (for example on databases, copyright and personal data). If in doubt, get legal advice before large or commercial use.

### FAQ

**Why did I get fewer products than I asked for?** Either a page stayed blocked after all retries (it counts toward the page limit), or the search simply has fewer results. Check `RUN_SUMMARY`.

**Can I get prices in other currencies or for other countries?** Not yet: v1 is US / USD only. A row in another currency would be flagged with `currencyMismatch: true`. Prices are never converted.

**Are ads included?** Yes. DHgate mixes sponsored listings into results, and they're marked `isSponsored: true`.

# Actor input Schema

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

What to search for on DHgate.com, one keyword per line, in English (for example "yoga mat", "led strip", "bluetooth earbuds"). Each keyword runs its own search. If you leave this and the listing URLs below empty, the scraper searches "yoga mat".

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

Alternative to keywords: DHgate listing URLs. Supported: search pages like https://www.dhgate.com/wholesale/search.do?searchkey=yoga+mat (a pageNum or sort in the URL is kept) and category pages like https://www.dhgate.com/wholesale/yoga-mats/c024064004009.html or ...c024064004009-2.html to start at page 2. Category pages are read through DHgate's search page filtered to that category, which has the full product data. Product, store and promotion pages are not supported and make the run fail with a clear message before any request is made.

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

Order of the results, as on DHgate's sort bar: Best match (default), Most orders, Price low to high, Price high to low, Newest. A sort given inside a start URL wins over this setting.

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

Destination country DHgate uses for prices and shipping labels. Only the United States is supported in this version; prices come in US dollars.

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

Also open each product's page and add its wholesale price tiers (quantity ranges with unit prices, e.g. 1–9 pcs $34.33, 1000+ pcs $16.39) and category path. Costs $0.002 per product on top of the $0.0005 listing price, and is slower (one extra page per product). If a product page can't be loaded, the product is still delivered with detailFetched=false and is not charged for details.

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

Stop a keyword (or start URL) after this many unique products (default 20). One results page has about 40–50 products, so 100 needs about 2–3 pages. This is the main control of how much a run costs: 100 products = $0.05 (or $0.25 with price tiers).

## `maxPagesPerKeyword` (type: `integer`):

Upper limit of results pages tried per keyword or start URL (default 2, max 50; DHgate itself shows at most 3,000 results = 75 pages). A keyword stops at whichever comes first: this limit, Max products per keyword, or the last results page. A page that stays blocked after all retries does not stop the keyword (the next page is still fetched), but it counts toward this limit.

## `maxRetriesPerPage` (type: `integer`):

DHgate sometimes refuses automated requests. The scraper never tries to get around this: a refused page is retried later, up to this many times. Retries are free for you. Lower values finish faster but can return fewer products.

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

Managed for you and included in the price. Keep the default: other settings mostly return blocked pages.

## Actor input object example

```json
{
  "keywords": [
    "yoga mat"
  ],
  "sortBy": "default",
  "shipToCountry": "US",
  "includeDetails": false,
  "maxItemsPerKeyword": 20,
  "maxPagesPerKeyword": 2,
  "maxRetriesPerPage": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `runSummary` (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": [
        "yoga mat"
    ],
    "maxItemsPerKeyword": 20,
    "maxPagesPerKeyword": 2,
    "maxRetriesPerPage": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ragnum/dhgate-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": ["yoga mat"],
    "maxItemsPerKeyword": 20,
    "maxPagesPerKeyword": 2,
    "maxRetriesPerPage": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ragnum/dhgate-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": [
    "yoga mat"
  ],
  "maxItemsPerKeyword": 20,
  "maxPagesPerKeyword": 2,
  "maxRetriesPerPage": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call ragnum/dhgate-scraper --silent --output-dataset

```

## MCP server setup

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