# DHgate Listings Scraper (`piotrv1001/dhgate-listings-scraper`) Actor

The DHgate Listings Scraper extracts product data from DHgate search URLs, capturing titles, images, prices, URLs, shipping status, ratings, and available coupons—ideal for market research, price tracking, and supplier analysis.

- **URL**: https://apify.com/piotrv1001/dhgate-listings-scraper.md
- **Developed by:** [FalconScrape](https://apify.com/piotrv1001) (community)
- **Categories:** E-commerce, Automation, Integrations
- **Stats:** 114 total users, 12 monthly users, 89.8% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 products

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/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 Listings Scraper

Easily extract product listings from DHgate. The **DHgate Listings Scraper** allows you to gather structured product data for market research, price tracking, and supplier analysis.

### ✨ Features

- 🏷️ **Comprehensive Product Data**: Retrieve product titles, images, prices, URLs, shipping status, ratings, and available coupons.
- 🔍 **Search-Based Extraction**: Provide DHgate search result URLs to extract relevant product listings.
- ⚡ **Fast & Efficient**: Quickly gather supplier data for e-commerce insights and sourcing strategies.

### 🛠️ How It Works

1. **Enter DHgate Search URLs** – Provide a list of DHgate search result page URLs.
2. **Run the Scraper** – Start the process and receive structured product data instantly.

### 📊 Sample Output Data

The scraper provides structured JSON output with key product details. Example:

```json
[
    {
        "itemCode": "989388595",
        "productId": "8aaaaeee9006250d019010cf825041a3",
        "productName": "Men Lace-up Shoes Four Season Sports Shoes Fashion Pattern Trainers Sneakers",
        "alt": "Men Lace-up Shoes Four Season Sports Shoes Fashion Pattern Trainers Sneakers",
        "productDetailUrl": "https://www.dhgate.com/product/men-lace-up-shoes-four-season-sports-shoes/989388595.html?d1_page_num=1#s1-47-7;searl|4120279226:48",
        "imageUrl": "//img4.dhresource.com/webp/m/260x260/f3/albu/jc/y/13/74ff1a1b-f13c-455d-a62d-0fe210727235.jpg",
        "price": "US $14.90 ",
        "minOrder": "1 Piece",
        "feedbackPercent": "94.6%",
        "reviewCount": 20,
        "recentlySold": null,
        "sellerStoreUrl": "https://www.dhgate.com/store/21901295#listing_store-48",
        "freeShipping": true,
        "coupons": ["$4 off $30+"]
    },
    {
        "itemCode": "989996355",
        "productId": "8aaaa5929010e548019019f1305d7c57",
        "productName": "Women Fashion Sports Shoes Korean Version Designer Thick Sole Chunky Shoes Sneakers Plus Size Comfort Running Shoes Triple Black Blue Red Free shipping",
        "alt": "Women Fashion Sports Shoes Korean Version Designer Thick Sole Chunky Shoes Sneakers Plus Size Comfort Running Shoes Triple Black Blue Red Free shipping",
        "productDetailUrl": "https://www.dhgate.com/product/autumn-women-s-shoes-athleisure-heighten/989996355.html?d1_page_num=1#s1-38-7;searl|4120279226:39",
        "imageUrl": "//img4.dhresource.com/webp/m/260x260/f3/albu/jc/z/18/dbde86c3-8ce6-4188-97e7-87ea5a0e93ba.jpg",
        "price": "US $19.90 ",
        "minOrder": "1 Pair",
        "feedbackPercent": "94.6%",
        "reviewCount": 26,
        "recentlySold": null,
        "sellerStoreUrl": "https://www.dhgate.com/store/21901295#listing_store-39",
        "freeShipping": true,
        "coupons": ["$4 off $30+"]
    }
]
```

Optimize your e-commerce strategy with **DHgate Listings Scraper** today! 🚀

### Search URLs and error handling

Use a nonempty `searchUrls` list. Supported forms are `/w/<keyword>.html`, `/w/<keyword>/<page>.html`, and `/wholesale/search.do?act=search&searchkey=<keyword>`. A `pageNum` query is preserved; conflicting path/query page numbers are rejected. Sort and filter parameters on `/w/` URLs (for example `sinfo=price&stype=up`, `freeshipping=1`) are kept. Category-filtered search pages (`/wholesale/<keyword>/s<id>.html`, `/wholesale-refine/...`) and `m.dhgate.com` search URLs also work. Tracking parameters `dspm`, `resource_id`, and `utm_*` are ignored. Category `/c<id>.html`, store and product pages are skipped with a note in the run status; they are not charged.

Blocked or unrecognized pages are retried and reported as failures, not empty search results. Genuine empty search payloads return zero products. If any batch URL exhausts retries, the run fails with an incomplete-results message while preserving products already saved. In standby, use either `?q=<keyword>` or `?url=<search URL>`; invalid input returns HTTP 400 and exhausted upstream failures return HTTP 502. Standby attempts at most four requests, with up to 10 seconds per request and a 45-second request/retry budget.

`recentlySold` and `afterSale` preserve source text (or null), including labels such as `100+` or return-policy descriptions. Numeric fields return finite numbers or null.

# Actor input Schema

## `searchUrls` (type: `array`):

DHgate search URLs: /w/<keyword>.html (optional /<page>.html or pageNum; sort and filter parameters are kept), /wholesale/search.do?searchkey=..., or category-filtered searches (/wholesale/<keyword>/s<id>.html, /wholesale-refine/...). Category /c<id>.html, store and product pages are skipped.

## Actor input object example

```json
{
  "searchUrls": [
    "https://www.dhgate.com/w/sneakers.html?dspm=pcen.hp.hotsearch.5.PyrNzJX8tC4mkXEVKusV&resource_id=#listing_hot-sneakers"
  ]
}
```

# 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 = {
    "searchUrls": [
        "https://www.dhgate.com/w/sneakers.html?dspm=pcen.hp.hotsearch.5.PyrNzJX8tC4mkXEVKusV&resource_id=#listing_hot-sneakers"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/dhgate-listings-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 = { "searchUrls": ["https://www.dhgate.com/w/sneakers.html?dspm=pcen.hp.hotsearch.5.PyrNzJX8tC4mkXEVKusV&resource_id=#listing_hot-sneakers"] }

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/dhgate-listings-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 '{
  "searchUrls": [
    "https://www.dhgate.com/w/sneakers.html?dspm=pcen.hp.hotsearch.5.PyrNzJX8tC4mkXEVKusV&resource_id=#listing_hot-sneakers"
  ]
}' |
apify call piotrv1001/dhgate-listings-scraper --silent --output-dataset

```

## MCP server setup

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