# Weidian Product Detail API (`pizani/weidian-product-detail-api`) Actor

Extract detailed product data from Weidian, including title, price, reviews, specifications, images, options, and categories. Perfect for market research, e-commerce insights, and data-driven decision-making

- **URL**: https://apify.com/pizani/weidian-product-detail-api.md
- **Developed by:** [Pizani](https://apify.com/pizani) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🛍️ Weidian Product Scraper

This Actor extracts product data from **Weidian** (微店) and returns a ready-to-use JSON. No browser is used — the data comes from JSON APIs, so runs are fast and cheap.

***

### ✨ What it does

- Accepts a Weidian **product\_url** (or a bare item ID).
- Extracts **title** (translated + original Chinese), **price** (USD and CNY), **domestic shipping fee**, **stock**, **images** and **SKU variants** (sizes/colours with per-SKU price and stock).
- Collects **store data** (name, numeric ID and shop URL).
- Pushes the result to the **Dataset** (Output tab).

***

### 🔧 Input

```json
{
  "product_url": "https://weidian.com/item.html?itemID=4281670129"
}
```

All of these are accepted:

- `https://weidian.com/item.html?itemID=4281670129`
- `https://shop1826085585.v.weidian.com/item.html?itemID=7331453669`
- `4281670129` (bare item ID)

***

### 🧾 Example Output

```json
{
  "sellerInfo": {
    "shopTitle": "H12纯原总仓",
    "shopID": "1826085585",
    "shopLink": "https://shop1826085585.v.weidian.com"
  },
  "productInfo": {
    "urlproduct": "https://weidian.com/item.html?itemID=7331453669",
    "title": "N378310",
    "titleCN": "🔑N378310",
    "price": "35.33",
    "priceCNY": "210.0",
    "shippingFee": "10",
    "minOrderQuantity": 1,
    "totalStock": 9986,
    "imgList": [
      "https://si.geilicdn.com/weidian1790815530-3d59000001932b9007680a20e672_1080_1620.jpg",
      "... more images ..."
    ],
    "atributtes": {
      "Model Size-NK/AJ": "36, 36.5, 38, 38.5, 39, US7=40, US8=41, US9=42.5"
    },
    "options": [
      {
        "name": "36",
        "imgUrl": null,
        "price": "35.33",
        "priceCNY": "210.0",
        "stock": 666,
        "skuNo": "124463963907"
      }
    ]
  }
}
```

***

### 🧩 Field Reference

- `sellerInfo.shopTitle`: Store name (original Chinese).
- `sellerInfo.shopID`: Numeric Weidian shop ID.
- `sellerInfo.shopLink`: Store URL, built as `https://shop{shopID}.v.weidian.com`.
- `productInfo.urlproduct`: Item URL.
- `productInfo.title` / `titleCN`: Translated title / original Chinese title.
- `productInfo.price` / `priceCNY`: Base price in USD / CNY.
- `productInfo.shippingFee`: Domestic shipping fee in CNY — a Weidian-specific field; `0` means the seller ships free inside China.
- `productInfo.minOrderQuantity`: Minimum order quantity (usually 1).
- `productInfo.totalStock`: Total stock across all SKUs.
- `productInfo.imgList`: List of image URLs (main image first).
- `productInfo.atributtes`: Variation groups with every available value — e.g. `{"Model Size": "36, 37, 38"}`. Weidian items have **no spec sheet**, so this is derived from the SKUs.
- `productInfo.options[]`: SKU variants — `name`, `imgUrl`, `price` (USD), `priceCNY`, `stock`, `skuNo`.

***

### ⚠️ Notes on Weidian

| | Behaviour |
| --- | --- |
| Spec sheet | Does not exist on Weidian — `atributtes` is built from the SKU variation groups instead |
| SKU images | Weidian rarely attaches an image per variant, so `options[].imgUrl` is often `null` |
| Shipping | `shippingFee` exists only on Weidian (Taobao/1688 do not expose it) |
| Removed items | Weidian sellers delete listings constantly; a removed item makes the run fail with a clear message |
| Titles | Many sellers use codes like `🔑N378310` as the title — that is the real listing title, not a parsing error |

The Actor queries two independent APIs **in parallel** and merges them, because each one carries only half of the data: one provides the translated title, the SKU labels and the shop name; the other provides the numeric shop ID and the total stock. If one is unavailable the run still succeeds with whatever the other returned, and a third API is used as a last resort.

***

### 🛠️ How to use via API

```python
import os
import time
import json
import requests

API_TOKEN = "YOUR_APIFY_API_KEY"
ACTOR_ID = "pizani~weidian-product-scraper"
PRODUCT_URL = "https://weidian.com/item.html?itemID=4281670129"

output_dir = "./scraped_results"
os.makedirs(output_dir, exist_ok=True)
output_file = os.path.join(output_dir, "product_data.json")

run_resp = requests.post(
    f"https://api.apify.com/v2/acts/{ACTOR_ID}/runs?token={API_TOKEN}",
    json={"product_url": PRODUCT_URL}
)

run_data = run_resp.json()
run_id = run_data.get("data", {}).get("id")

if not run_id:
    raise Exception(f"Failed to start Actor: {run_data}")

status_url = f"https://api.apify.com/v2/actor-runs/{run_id}?token={API_TOKEN}"
while True:
    status_resp = requests.get(status_url).json()
    status = status_resp.get("data", {}).get("status")
    if status in {"SUCCEEDED", "FAILED", "ABORTED", "TIMED-OUT"}:
        break
    time.sleep(5)

items_url = (
    "https://api.apify.com/v2/datasets/"
    f"{status_resp['data']['defaultDatasetId']}"
    f"/items?clean=true&format=json&token={API_TOKEN}"
)
result = requests.get(items_url).json()

with open(output_file, "w", encoding="utf-8") as f:
    json.dump(result, f, ensure_ascii=False, indent=4)
```

***

### ℹ️ Notes

- Fields can vary depending on the product and site availability.
- USD prices come from the upstream agent's exchange rate; `priceCNY` is the seller's actual price.

# Actor input Schema

## `product_url` (type: `string`):

The Weidian item URL to scrape (e.g., https://weidian.com/item.html?itemID=4281670129). Shop subdomain URLs (shop123.v.weidian.com/item.html?itemID=...) and a bare item ID are also accepted.

## Actor input object example

```json
{
  "product_url": "https://weidian.com/item.html?itemID=4281670129"
}
```

# 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 = {
    "product_url": "https://weidian.com/item.html?itemID=4281670129"
};

// Run the Actor and wait for it to finish
const run = await client.actor("pizani/weidian-product-detail-api").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 = { "product_url": "https://weidian.com/item.html?itemID=4281670129" }

# Run the Actor and wait for it to finish
run = client.actor("pizani/weidian-product-detail-api").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 '{
  "product_url": "https://weidian.com/item.html?itemID=4281670129"
}' |
apify call pizani/weidian-product-detail-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pizani/weidian-product-detail-api"
        }
    }
}

```

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/awzfYK99kyuTrekRJ/builds/mkhiQ1SPSVA57zY2n/openapi.json
