Skip to content

About

DHgate scraper API in Python: wholesale products, prices, MOQ, discounts, sold counts and seller feedback via Apify

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

DHgate Scraper API in Python: wholesale products, prices, MOQ, discounts and sellers

A DHgate scraper tutorial for Python (and Node.js): pull DHgate.com keyword listings into JSON or CSV with the price range, original price and discount %, MOQ, sold count, rating, free shipping and the seller's store and positive feedback %. Use it as an unofficial DHgate API for dropshipping product research, wholesale price benchmarking and supplier scouting.

Disclosure: I built this actor; it's a paid tool on Apify (DHgate Scraper & API, $0.50 per 1,000 products). This repo is a free, MIT-licensed example of how to call it.

What you get per product

  • Product: item code, title, URL, 300 px and full-size image, video flag, category ID, sponsored flag
  • Price: priceMin / priceMax in USD, price unit, originalPriceMin / originalPriceMax, discountPercent, promotionEnds
  • MOQ: moq as a number, moqUnit, moqText
  • Demand: soldCount, rating, reviewCount, positiveReviewPercent
  • Shipping: freeShipping and sevenDayReturn for the ship-to country (US by default)
  • Seller: sellerName, sellerId, sellerStoreUrl, sellerYears, sellerPositiveFeedbackPercent

No browser, no DHgate login. Plain HTTP over DHgate's public listing pages, 40 products per page, about 100 products in under 10 seconds.

Quick start (Python)

pip install apify-client
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")

run = client.actor("rel8ble/dhgate-scraper").call(run_input={
    "searchTerms": ["led light", "yoga mat"],
    "maxResultsPerSearch": 100,
    "maxMoq": 1,              # single-unit orders only (filtered before you are charged)
    "maxPrice": 15,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["priceText"], item["moqText"], item["soldCount"], item["sellerName"], item["title"][:60])

Get your token at console.apify.com/settings/integrations. Never commit it; example.py reads APIFY_TOKEN from the environment.

Quick start (Node.js)

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('rel8ble/dhgate-scraper').call({
    searchTerms: ['phone case'],
    maxResultsPerSearch: 100,
    freeShippingOnly: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((p) => p.discountPercent >= 50).length, 'products at 50%+ off');

The full example: dropshipping shortlist

example.py runs one or more keywords, writes every product to dhgate_products.csv, and prints per keyword: product and seller counts, median from-price and range, how many are MOQ 1 / free shipping / on sale / sponsored, the sellers with the most listings, and a shortlist of products with MOQ 1, 10+ sold, 4.5+ stars and a seller at 95%+ positive feedback, best sellers first.

pip install -r requirements.txt
export APIFY_TOKEN=<YOUR_APIFY_TOKEN>      # Windows: set APIFY_TOKEN=<YOUR_APIFY_TOKEN>
python example.py "led light" "yoga mat"

Real output on the actor's saved 20-row led light sample (24 Oct 2026, US ship-to):

== led light: 20 products, 13 sellers
   median from-price $5.17 (range $0.95 - $15.44)
   MOQ 1: 13  free shipping: 8  on sale: 11  sponsored: 0
   sellers with most listings: best2011 (4), lighting1617 (2), barefoot1 (2)
   shortlist (MOQ 1, 10+ sold, 4.5+ stars, seller 95%+): 4
     $9.70  sold 83  4.7*  lighting1617  5M/10M LED Strip RGB USB 5050 SMD LEDs Lights 44key controll
     $2.61  sold 34  5*  royallight  5V USB LED Strip Light 2835 DC Leds Lights Flexible 1M 2M 3M
     $2.72  sold 21  4.8*  tabletpc2015  Led Strip 15 20 Meters Outdoor Wifi Alexa 5050 5V Rgb Tape L
     $2.42 -58%  sold 15  5*  urban_sweetheart  LED Strip Lights 1-5m 10m 15m 20m 30m Rgb Tape Neon Led Ligh

11 of the 20 listings were on sale (mostly 50-61% off), all with the same promotion end date, so track the original price over time before you treat a discount as real.

Sample output (one product, trimmed)

{
  "searchTerm": "led light",
  "position": 8,
  "productId": "1060632844",
  "title": "24V RGB 5m 10m 20m 30m LED Neon Strip Light Bluetooth APP 24key 44key Remote Control Music Sync Power Kit 60LED Waterproof Decor H260511",
  "url": "https://www.dhgate.com/product/24v-rgb-5m-10m-20m-30m-led-neon-strip-light/1060632844.html",
  "priceMin": 6.58,
  "priceMax": 13.49,
  "priceText": "US $6.58 - 13.49",
  "priceUnit": "Piece",
  "originalPriceMin": 13.99,
  "discountPercent": 53,
  "promotionEnds": "2026-10-31 23:59:00",
  "moq": 1,
  "moqText": "1 Piece",
  "soldCount": 4,
  "rating": 5,
  "reviewCount": 2,
  "freeShipping": false,
  "isAd": false,
  "sellerName": "joykiss",
  "sellerStoreUrl": "https://www.dhgate.com/store/top-selling/22048458.html",
  "sellerPositiveFeedbackPercent": 98.4,
  "shipTo": "United States"
}

Input

Field Default Description
searchTerms ["led light"] Keywords or DHgate search URLs
maxResultsPerSearch 100 Unique products per keyword; 0 = as many as the keyword's category pages hold
categories all Top-level categories by name or URL, e.g. Lights & Lighting, Home & Garden
minPrice / maxPrice - Unit price filter in USD
maxMoq - e.g. 1 for single-unit orders
freeShippingOnly false Only free-shipping products
minRating - Minimum product rating 1-5
minSold - Minimum units sold
includeAds true Keep sponsored listings (flagged isAd)

Filters are applied before anything is charged.

Price and limits

  • $0.50 per 1,000 products, pay per result, no start fee. 100 products = $0.05. Duplicates, filtered-out products and failed requests are never charged. The Apify free plan's $5 monthly credit covers about 10,000 products.
  • Each keyword reads the all-categories page, then walks the keyword's category facets (40 products each). A keyword can return fewer products than you asked for when its category pages run out or your filters remove the rest; the run's RUN_SUMMARY record shows the counts and stop reason.
  • Prices are for the US ship-to by default. sellerYears is often null (DHgate doesn't always show it).
  • Listing data only: no product detail pages, variants or shipping cost tables.

Use cases

  • Dropshipping research: low-MOQ, free-shipping products with real sold counts before you list them on Shopify, eBay or Amazon
  • Wholesale price benchmarking for one product type across dozens of sellers
  • Discount tracking: schedule daily and compare priceMin, discountPercent and soldCount by productId
  • Supplier scouting: rank sellers by positive feedback and by how many of your keyword's products they carry

Related example repos

Links

MIT licensed. Not affiliated with DHgate.

About

DHgate scraper API in Python: wholesale products, prices, MOQ, discounts, sold counts and seller feedback via Apify

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages