Scrape Alibaba.com product offers by keyword: title, price range and quantity price tiers, minimum order, units sold, ratings, certifications, and the supplier's name, country, years, Gold and verified badges, Trade Assurance and response rate. About 47 offers a page.
This repository has ready scripts for the Alibaba Scraper: Prices, MOQ, Suppliers | $0.75 per 1,000 Actor on Apify. The Actor does the fetching, paging and cleaning; the scripts here run it with your input and save the results as a CSV or JSON file.
- Create an Apify account and copy your API token from Console > Settings > Integrations.
- Install the client and run the script with the example input:
pip install "apify-client>=2"
export APIFY_TOKEN=your_token
python run.py input.json -o results.csv --max-items 50Edit input.json for your own run. You can also run the Actor in the browser on its
Apify page, schedule it there, and connect its output to Google Sheets, Slack, Zapier or Make.
The example input (input.json):
{
"searchTerms": [
"led strip lights"
],
"maxPages": 1,
"maxItems": 20
}| Field | Type | What it does |
|---|---|---|
searchTerms |
array | Products as a buyer would type them, one per line, for example led strip lights. |
searchUrls |
array | Optional alibaba.com keyword pages (https://www.alibaba.com/wholesale/....html). |
maxPages |
integer | How many result pages (about 47 offers each) to read per keyword. |
maxItems |
integer | The run stops after this many result rows. |
onlyNew |
boolean | Skip rows that an earlier run with the same input already returned, so a scheduled run gives each new row once. |
One row per result. A real row from a run of the example input (more in
examples/sample-output.json):
{
"searchTerm": "led strip lights",
"page": 1,
"position": 1,
"productId": "1601629023546",
"title": "USB Smart LED Strip Light for Tv & Gaming RGB Remote Music Syncs Monitor LED Backlight for PC Gaming Room Decor Christmas Gifts",
"priceMin": 3.43,
"priceMax": 4.29,
"currency": "USD",
"priceText": "US $3.43-$4.29",
"minOrder": 2,
"minOrderUnit": "pieces",
"minOrderText": "2 pieces",
"quantityPrices": [
{
"minQuantity": 1,
"maxQuantity": null,
"price": 4.29,
"unit": "Piece"
}
],
"sold": 169,
"soldText": "169 sold",
"productRating": 4.9,
"supplierRating": 4.8,
"supplierReviews": 73,
"certifications": [
"DECLARATION OF CONFORMITY"
],
"supplierName": "Ningbo How-Lighting Co., Ltd.",
"supplierCountry": "China",
"supplierCountryCode": "CN",
"supplierYears": 6,
"goldSupplier": true,
"verifiedSupplier": true,
"tradeAssurance": true,
"responseRate": 97.7,
"image": "https://s.alicdn.com/@sc04/kf/H60f1d55e3e04481d9eca66f3608677f8P.png",
"url": "https://www.alibaba.com/product-detail/USB-Smart-LED-Strip-Light-for_1601629023546.html"
}Fields: searchTerm, page, position, productId, title, priceMin, priceMax, currency, priceText, minOrder, minOrderUnit, minOrderText, quantityPrices, sold, soldText, productRating, supplierRating, supplierReviews, certifications, supplierName, supplierCountry, supplierCountryCode, supplierYears, goldSupplier, verifiedSupplier, tradeAssurance, responseRate, image, url.
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('v0iddo/alibaba-scraper').call({"searchTerms": ["led strip lights"], "maxPages": 1, "maxItems": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();Full example: examples/node/run.mjs.
curl -X POST "https://api.apify.com/v2/acts/v0iddo~alibaba-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" -H 'Content-Type: application/json' \
-d '{"searchTerms": ["led strip lights"], "maxPages": 1, "maxItems": 20}'The response is the JSON array of results.
The Actor is paid per result: $0.75 per 1,000 results, nothing per run. maxItems caps the rows, and so the cost, of one run. A new Apify account gets $5 of platform credit every month.
MIT for the code in this repository. Made by vøiddo.