This example shows how to scrape product data from JD.com (京东) in Node.js using the JD.com Product Scraper on Apify. Instead of building a scraper from scratch — dealing with anti-bot protection, proxies, and parsing — you call a ready-made Apify actor through the official apify-client package and get structured JSON back.
- Calls the
piotrv1001/jd-com-product-scraperactor via the Apify API - Passes an input with JD.com SKU IDs (or product page URLs) to scrape
- Waits for the actor run to finish
- Fetches the scraped results from the run's dataset
- Prints each product item to the console
- Node.js 18 or newer
- A free Apify account
- Your Apify API token
npm installCopy the example env file and add your Apify API token:
cp .env.example .envAPIFY_TOKEN=your_apify_token_herenpm startThe script runs the actor, waits for it to finish, and prints the scraped JD.com products. You'll also get a link to view the dataset in the Apify Console.
import { ApifyClient } from 'apify-client';
import 'dotenv/config';
// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
// Prepare Actor input
const input = {
"skuIds": [
"100008348542"
],
"startUrls": []
};
// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/jd-com-product-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/docsSee sample-output.json for a full example. Each scraped product includes:
| Field | Description |
|---|---|
skuId |
JD.com SKU identifier |
url |
Product page URL |
title / name |
Full product title and name |
brandId / brandName |
Brand info (e.g. Apple, 富士) |
shopId / shopName |
Seller / store info |
categoryIds / categoryNames |
Category hierarchy |
breadcrumb |
Full breadcrumb path |
mainImage / images |
Product image URLs |
description |
Product description |
scrapedAt |
Timestamp of the scrape |
- Price & catalog monitoring — track JD.com product listings for e-commerce intelligence
- Competitor research — analyze brands, sellers, and category positioning on China's largest B2C marketplace
- Product data enrichment — pull titles, images, and category data into your own catalog or PIM
- Market analysis — study product assortment and branding trends across JD.com categories
- Dropshipping & sourcing — collect structured product data for sourcing decisions
Open the JD.com Product Scraper on Apify
MIT
