Alibaba Supplier Store Scraper 如何把供應商目錄轉成 JSON 並評估供應商
Downloading an Alibaba supplier's whole catalog as JSON (and vetting suppliers with it)
作者 Gio Rich 開發的 Alibaba Supplier Store Scraper 可把 Alibaba 供應商商品目錄擷取成每件商品一行的 JSON。
I built this actor; it's a paid tool on Apify with a free trial credit.
Searching Alibaba shows you products from hundreds of suppliers. Once you have a shortlist, the useful question flips: what else does this supplier sell, how focused is the catalog, which of their products actually sell, what is certified, and is the company behind it a 140-person factory or an 8-person trading office? That answer lives on the supplier's storefront (name.en.alibaba.com), 16 products per page, often 30 to 80 pages deep.
Copying that by hand gets old fast, so I wrote Alibaba Supplier Store Scraper to turn a store URL, a product URL or a keyword into one clean JSON row per product, over plain HTTP. This post covers how it works, calling it from Python and Node, what a row looks like, and a small project: scoring suppliers from their catalogs.
How it works
A supplier storefront page server-renders its modules as URL-encoded JSON inside module-data attributes: the supplier card, the store's own category tree, and the product list with paging. The actor decodes those, maps each product card to flat fields (price range, MOQ, certificates, sold in the last 180 days, orders, ready-to-ship, store category with its parent) and copies the supplier card onto every row: business type, supplier identity, years on Alibaba, verified staff count, store rating, the inspection company that verified it, ranking badges, main products and capability tags such as "ODM services available" or "Patents awarded (6)". No contact person names, phones or emails are collected.
After page 1 it knows the product count, so it queues exactly the pages it needs and reads them in parallel. Give it a product URL and it finds the supplier on the product page first; give it a keyword and it uses the JSON endpoint Alibaba's own search page calls to collect the suppliers behind the results. A keyword inside each store, ready-to-ship only, and price / MOQ filters are applied before anything is charged. It connects directly and only retries blocked requests through a proxy.
Calling it from Python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("rel8ble/alibaba-supplier-store-scraper").call(run_input={
"storeUrls": [
"https://alextechnology.en.alibaba.com/",
"https://www.alibaba.com/product-detail/High-Quality-PU-Yoga-Mat-Custom_1601669249206.html",
],
"searchTerms": ["bluetooth speaker"],
"maxStoresPerSearch": 3,
"maxProductsPerStore": 50,
})
for p in client.dataset(run["defaultDatasetId"]).iterate_items():
print(p["supplierName"][:30], "|", p["storeCategory"], "|", p["priceText"], "| MOQ", p["moq"], "| sold", p["soldLast180Days"])
The same from Node:
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('rel8ble/alibaba-supplier-store-scraper').call({
storeUrls: ['alextechnology'],
keywordInStore: 'earphone',
readyToShipOnly: true,
maxProductsPerStore: 0, // the whole matching catalog
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'ready-to-ship earphones from', items[0]?.supplierName);
What a row looks like
From a real run, trimmed:
{
"productId": "1601240924267",
"title": "HM11 Retro Bluetooth Speaker, Vintage Decor, Mini Wireless Bluetooth Speaker, Fashion Style Outdoor Accessories",
"priceMin": 3.89,
"priceMax": 4.49,
"moq": 2,
"moqUnit": "pieces",
"readyToShip": true,
"certificates": ["FCC", "DECLARATION OF CONFORMITY"],
"soldLast180Days": 4,
"orderCount": 3,
"storeCategory": "Bluetooth Speaker",
"supplierName": "Shenzhen Yuzhuo Technology Co., Ltd.",
"supplierBusinessType": ["Trading Company"],
"supplierIdentity": "Multispecialty Supplier",
"supplierYearsOnAlibaba": 13,
"supplierStaffCount": 8,
"supplierRating": 4.4,
"supplierVerifiedBy": "SGS Group",
"supplierCapabilities": ["Registered trademarks (3)", "Patents awarded (2)", "ODM services available"],
"storeTotalProducts": 271,
"source": "search",
"searchTerm": "bluetooth speaker"
}
Project: scoring suppliers from their catalogs
A supplier that sells yoga mats, mouse pads and flower pots is a different partner from one with 300 listings in a single category. With one run you can measure that:
from collections import Counter, defaultdict
rows = list(client.dataset(run["defaultDatasetId"]).iterate_items())
by_store = defaultdict(list)
for r in rows:
by_store[r["storeUrl"]].append(r)
print(f"{'supplier':32} {'focus':>5} {'certs':>5} {'selling':>7} {'staff':>5} {'years':>5} type")
for store, items in by_store.items():
s = items[0]
top_cat = Counter((i["storeCategory"] or "").split(" > ")[0] for i in items).most_common(1)[0][1]
focus = top_cat / len(items) # share of products in the biggest category
certified = sum(bool(i["certificates"]) for i in items) / len(items)
selling = sum(i["soldLast180Days"] > 0 or i["orderCount"] > 0 for i in items) / len(items)
print(f"{s['supplierName'][:32]:32} {focus:5.0%} {certified:5.0%} {selling:7.0%} "
f"{s['supplierStaffCount'] or '-':>5} {s['supplierYearsOnAlibaba'] or '-':>5} {'/'.join(s['supplierBusinessType'])}")
Focus, certification share and the share of listings with real sales are three quick signals you cannot get from search results alone. Pass the url of the products that survive to a detail scraper when you need full price ladders and lead times.
Pricing and limits
$1.50 per 1,000 products, no start fee. Products skipped by filters, duplicates, missing stores and failed requests are never charged. This is listing-level data: full quantity ladders, SKUs and specs are on product pages. Sales counts show on about a third of products in my tests; supplier rating, years, business type and verification on every row. Up to 4,000 products per store (scrape by category or keyword for bigger ones).
Store page: https://apify.com/rel8ble/alibaba-supplier-store-scraper
This article was drafted with AI and published by me.
來源:DEV Community · dev.to