# JD.com Product Scraper · Variants by SKU · $1/1K (`mlg14/jd-scraper`) Actor

Get product details and linked SKU variants for catalog checks, variant mapping and stock monitoring from JD.com product IDs or URLs. Titles, images, shop, categories, stock state, package data, price-mask flag. $1/1K results.

- **URL**: https://apify.com/mlg14/jd-scraper.md
- **Developed by:** [MLG Data](https://apify.com/mlg14) (community)
- **Categories:** E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 results

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

## JD.com Scraper

Scrape JD.com product details and linked SKU variants from public product IDs or URLs. Export JD.com product data to JSON or CSV for catalog checks, variant mapping, and stock monitoring. This actor is a JD.com API alternative for the product fields visible on public mobile product pages; it does not currently provide keyword search, customer comments, shop catalogs, or reliable numeric prices.

### What data can you extract from JD.com?

Each requested SKU produces a selected product row. Turn on variant expansion to add a row for each linked color, size, capacity, or version visible on that page. Linked variant rows describe the option and its ID, but do not claim that the variant's price or stock was checked. The selected row contains the details actually observed for the requested SKU.

| Field | Description | Example |
| --- | --- | --- |
| `operation` | Dataset operation label | `productDetail` |
| `status` | Extraction result for an emitted row | `success` |
| `itemId` | SKU represented by this row | `100256400499` |
| `itemUrl` | Canonical desktop item link | `https://item.jd.com/100256400499.html` |
| `parentItemId` | Requested SKU whose page listed the row | `100256400499` |
| `isSelectedSku` | Whether fields were observed directly for this SKU | `true` |
| `productTitle` | Selected title or assembled variant label | Text or `null` |
| `brand` | Brand on the requested product page | Text or `null` |
| `model` | Product model when published | Text or `null` |
| `imageUrl` | Main SKU or variant image | HTTPS image URL |
| `galleryImageUrls` | Selected SKU image gallery | Array of image URLs |
| `price` | Visible numeric price in CNY, when available | `null` if masked |
| `priceMasked` | Whether question marks replace price digits | `true` |
| `priceText` | Raw displayed price text | `6??9` |
| `currency` | Currency for a visible numeric price | `CNY` |
| `salesText` | Sales count label if exposed | Usually `null` |
| `goodRate` | Positive review percentage if exposed | Usually `null` |
| `shopId` | Merchant shop identifier | `1000004259` |
| `shopName` | Merchant display name | Text or `null` |
| `shopUrl` | Shop link supplied by the page | URL or `null` |
| `categoryIds` | Category identifier path | `["9987","653","655"]` |
| `variantColor` | First product option, often color | Text or `null` |
| `variantSize` | Second option, often size or capacity | Text or `null` |
| `variantSpec` | Additional version or specification | Text or `null` |
| `variantCount` | Number of linked options on the requested page | `16` |
| `variantItemIds` | Linked IDs on the selected row | Array of IDs |
| `available` | Active listing flag for the selected SKU | `true` or `null` |
| `stockState` | Raw stock state code for selected SKU | `33` or `null` |
| `packageWidth` | Raw package width text for selected SKU | `99` or `null` |
| `packageHeight` | Raw package height text for selected SKU | `69` or `null` |
| `packageLength` | Raw package length text for selected SKU | `188` or `null` |
| `packageWeight` | Raw package weight text for selected SKU | `0.546` or `null` |
| `upc` | Published product barcode | Text or `null` |

The package measurements are copied as source values because the page does not consistently label units next to every field. An active listing flag is not a promise of local delivery or inventory in every region. `stockState` is kept as a raw code rather than translated into an availability claim. If you need a verified price or a regional inventory decision, use a separate source suited to that purpose.

### How to scrape JD.com

1. Copy a numeric SKU from a JD.com product URL. For example, `https://item.jd.com/100256400499.html` contains `100256400499`.
2. Paste one ID into `itemId`, or paste several IDs or URLs into `itemIds`. Both inputs can be used in the same run; duplicate IDs are removed.
3. Enable `expandVariants` when you want related SKU identifiers and option labels. Leave it off when you want one row for each requested ID.
4. Set `maxItems` to cap emitted rows. A run stops adding rows as soon as the cap is reached.
5. Start the run and download the dataset as JSON or CSV. Check `isSelectedSku` before treating price, stock, package, or barcode fields as direct SKU observations.

No account login is required for the product pages used here. If a product is removed, restricted, or missing the embedded data, the run records a warning and continues to the next requested ID. A run with no valid product rows fails rather than returning an empty success result.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `itemIds` | Array of strings | Empty | Numeric SKU IDs or public product URLs; use for batches. |
| `itemId` | String | Empty | One additional SKU ID or product URL. |
| `expandVariants` | Boolean | `false` | Emit linked variant rows from each requested page. |
| `maxItems` | Integer | `100` | Maximum distinct output rows; `0` removes this cap. |
| `proxyConfiguration` | Object | Automatic | Proxy settings for public product page requests. |

Example input for a small product family audit:

```json
{
  "itemIds": ["100256400499", "100036231505", "100282275848", "100012043978"],
  "expandVariants": true,
  "maxItems": 50
}
```

That input returned 48 distinct rows in the validation run. The four selected SKUs each contributed a product row and their visible linked variants; the families contained 16, 14, 9, and 9 linked IDs. Variant counts vary by listing and can change if the seller adds or removes options. A different set of products might yield only one row per input even with expansion enabled.

For a single product, set `itemId` and leave `expandVariants` off. This produces the most direct interpretation of the fields: the row represents the requested URL, and its price and stock fields belong to that SKU. For large batches, use `itemIds` and a sensible `maxItems` so that the output remains within your downstream import size.

### Output example

The following is a shortened excerpt from a selected product row in the successful validation run. Name and image fields are omitted from the excerpt; their values are present in the dataset.

```json
{
  "operation": "productDetail",
  "status": "success",
  "itemId": "100256400499",
  "itemUrl": "https://item.jd.com/100256400499.html",
  "parentItemId": "100256400499",
  "isSelectedSku": true,
  "price": null,
  "priceMasked": true,
  "priceText": "6??9",
  "currency": "CNY",
  "shopId": "1000004259",
  "categoryIds": ["9987", "653", "655"],
  "variantCount": 16,
  "available": true,
  "stockState": 33,
  "packageWeight": "0.546"
}
```

The mask is significant: `6??9` must not be converted into a guessed number. This actor reports `price: null` and `priceMasked: true` for that selected SKU. Linked variant rows have `price`, `priceMasked`, and `stockState` set to `null` because those variants were listed on the page but were not requested individually. To verify a variant's own detail fields, add its `itemId` as a separate input in a later run.

### Use cases

- **Catalog reconciliation:** Compare a list of known SKU IDs against current public titles, category paths, images, and shop identifiers. A missing or changed field can trigger a manual catalog review.
- **Variant mapping:** Turn one product URL into linked color and size identifiers. The `parentItemId` and `isSelectedSku` fields let you build relationships without mistaking a listed option for a fully checked page.
- **Product image checks:** Export the selected image gallery and each listed variant image to check whether catalog imagery matches internal records. The images are returned as links, not downloaded files.
- **Listing status audits:** Inspect the selected SKU's active flag and raw stock code across a set of product IDs. Interpret the code alongside the local page experience before making delivery promises.
- **Shop attribution:** Connect known SKUs to merchant identifiers and shop links, then compare those identifiers with an existing seller catalog. Shop names may change while the numeric shop ID remains useful for matching.
- **Package data review:** Capture source package dimensions and weight for selected SKUs. Since the source omits a consistent unit label, confirm units before using these values for shipping calculations.

These workflows start with product IDs already known to you. The actor does not discover arbitrary products from a keyword, browse an entire shop, or download reviews. Batch input and variant expansion make it useful when your inventory or research list already contains at least one valid product URL per family.

### How much does it cost to scrape JD.com?

The configured result event price is **$0.001 per emitted row**, or **$1.00 per 1,000 rows**. A run with four requested products and 48 emitted rows therefore has a result charge of **$0.048** at the current rate. A 500-row run costs **$0.50** in result events, while a 5,000-row run costs **$5.00** in result events. Check the run's final charge and current actor pricing before planning a large recurring schedule; pricing and platform terms can change.

Variant expansion affects the row count and therefore the result charge. Four selected pages in the validation run produced 48 rows because each family listed multiple SKUs. With expansion disabled, those same four inputs would produce at most four rows, one for each successfully parsed selected product. `maxItems` is a hard output cap, so it also bounds the number of result events in a run. An ID that cannot be parsed yields no result event; the run logs the failure for review.

Cost per input URL is not fixed. A product with many linked options can generate more rows than a product with none. Estimate spend from the expected output rows, not just the number of requested IDs. A small pilot run on representative product families is the most reliable way to estimate how many rows your full catalog will produce.

### Tips for best results

Use numeric IDs copied from product URLs. The actor accepts both desktop `item.jd.com` URLs and mobile `item.m.jd.com` URLs. It rejects unrelated domains and malformed values before making requests. Duplicate input IDs are removed, and duplicate variant IDs are emitted only once within a run. If two requested pages belong to the same family, the first page that exposes a variant determines the row for that variant.

Start with `expandVariants: false` if you need accurate detail fields for every input SKU. Enable expansion to discover option IDs, then feed the option IDs into another run when you need their own selected product data. A variant row copies some family level context from its parent page and intentionally leaves direct observations empty.

Review both `price` and `priceMasked`. A masked price stays `null`, while `priceText` preserves the displayed text for diagnosis. If `priceText` is empty, the page did not provide a visible price in the extracted object. Treat missing `salesText` and `goodRate` as unavailable source data, not as zero sales or a zero rating.

Use smaller batches when a large list contains uncertain IDs. The scraper continues after an individual product fails, but a long run with many unavailable URLs can take extra time because the request layer retries and rotates its proxy route after repeated blocks. Keep `maxItems` large enough for the output you expect but low enough for your export workflow.

### Limits

JD.com redirected keyword search pages to a verification page during source discovery on both datacenter and residential routes. The public comment endpoint returned a busy response, and direct mobile API requests returned access errors. The public price route timed out or rejected the proxy connection. Mobile shop pages contained an application shell rather than an immediately usable item list. Consequently, this actor currently supports **product details by ID and linked variant discovery only**. It cannot promise the leader actor's keyword search, comments, shop catalog, or bulk price lookup operations.

Many selected product prices are masked with question marks, so numeric `price` can be `null`. A linked variant's price and stock are always `null` unless that SKU is separately requested and emitted as a selected SKU. The selected `available` field reflects a page status flag, which may differ from stock in a delivery region. `stockState` is a source code, not a translated stock message.

The product page can omit model, barcode, package data, image gallery, or merchant name. Products that are removed or gated may have no parseable embedded data. Page structure and field names can change without notice; if required fields disappear, the actor will log a failure rather than invent values. Large families can reach the `maxItems` limit partway through a set of variants.

### Use with AI agents (MCP)

Add this actor to any MCP client (Claude, Cursor, VS Code, n8n...) with one URL:

`https://mcp.apify.com?tools=mlg14/jd-scraper`

An agent gets back one JD.com product row per SKU with title, brand, shop, category IDs, images, stock state, package data and the price-mask flag. Keep results bounded with `maxItems`; the actor needs product IDs or URLs, not keywords.

**Prompt 1:** "Get the JD.com product details for SKU 100256400499."

```json
{"itemId": "100256400499", "maxItems": 5}
```

**Prompt 2:** "List all color and size variants of these two JD.com products."

```json
{"itemIds": ["100256400499", "100036231505"], "expandVariants": true, "maxItems": 40}
```

**Prompt 3:** "Check whether this JD.com product page is active and who the shop is: https://item.jd.com/100282275848.html"

```json
{"itemIds": ["https://item.jd.com/100282275848.html"], "expandVariants": false, "maxItems": 1}
```

### FAQ

**Can I search JD.com by keyword?** No. The anonymous search routes tested during development returned verification pages. Supply product IDs or product URLs. Search support should only be added after a repeatable public source can be validated.

**Why is the price null?** The product page often replaces digits with question marks. The actor keeps the displayed text in `priceText` and marks `priceMasked: true`; it does not guess the missing digits. Linked variants also have null prices because their own pages were not fetched.

**Does an available flag mean I can buy the item now?** No. It reflects a listing status field for the selected SKU. Delivery and stock can vary by region and time. Inspect the product page for the destination that matters to your workflow.

**Do I need to configure a proxy?** The default request path manages routing automatically and escalates after repeated blocks. The proxy input is available for accounts with a preferred configuration. Some IDs may still fail if the page is removed or protected.

**How fast is a run?** The validation run processed four product pages and emitted 48 rows in about 30 seconds of run time. Time depends on page response, retries, the number of requested IDs, and whether a proxy escalation is needed.

**Can I schedule exports and use them in a spreadsheet?** Yes. Schedule repeat runs with the same input, then export the dataset as CSV or JSON. Compare stable IDs across snapshots; names and shop labels can change.

**What if a field is empty?** Read the field description first. `null` can mean that the source did not publish the value, the price was masked, or the row is a linked variant rather than a directly requested SKU. Empty arrays mean no values were collected for that array on the row.

**Is it legal to scrape this data?** This actor reads public product pages and does not use an account or seek private customer information. Use the data responsibly, respect the site's terms, and review the rules that apply to your use case and location.

### Integrations

Use the run interface for manual exports or call the actor through the platform API from a catalog job. Dataset items can feed a database, a webhook processor, a spreadsheet import, or a scheduled comparison pipeline. Use `itemId` as the stable row key and `parentItemId` to group variants. When building a monitoring job, compare snapshots by SKU and check `isSelectedSku` before evaluating price or stock changes. Failed product IDs appear in run logs rather than as fabricated dataset records.

### Support

Open an issue on the Issues tab; we reply within 24h and add fields on request. Include a public product URL, the field you expected, and the run date so the page structure can be checked against the dataset row.

# Actor input Schema

## `itemIds` (type: `array`):

JD.com product IDs or item.jd.com product URLs to scrape, one product row each. Numeric IDs or full URLs, e.g. \["100256400499", "https://item.jd.com/100036231505.html"]. Use for batches; leave empty if you set itemId.

## `itemId` (type: `string`):

A single JD.com product ID or item.jd.com URL, combined with itemIds when both are set. Example: 100256400499. Use for one-off lookups; leave empty when you use itemIds.

## `expandVariants` (type: `boolean`):

Also output one row per linked color, size or version SKU listed on each product page. Allowed values: true or false. Example: true to map all variants of a product. Leave false for one row per requested product.

## `maxItems` (type: `integer`):

Maximum number of distinct SKU rows across all products; the run stops at this cap and bounds cost. Integer, e.g. 50. Set 0 for no cap; use a small value like 10 for quick tests.

## `proxyConfiguration` (type: `object`):

Proxy settings for JD.com product pages. Example: {"useApifyProxy": true}. Leave the default, which starts with datacenter routing and escalates after repeated blocks.

## Actor input object example

```json
{
  "itemIds": [
    "100256400499",
    "100036231505"
  ],
  "itemId": "100256400499",
  "expandVariants": false,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items in the default dataset.

# 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 = {
    "itemIds": [
        "100256400499",
        "100036231505"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mlg14/jd-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 = { "itemIds": [
        "100256400499",
        "100036231505",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mlg14/jd-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 '{
  "itemIds": [
    "100256400499",
    "100036231505"
  ]
}' |
apify call mlg14/jd-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mlg14/jd-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/Z70Y9qG08vZMWoYes/builds/BQCFMnLVRM13BBCab/openapi.json
