# Shein Product Scraper (`crawlerbros/shein-scraper`) Actor

Scrape product details from Shein (us.shein.com) by direct product URL. Returns SKU, product ID, title, price, sale price, images, sizes, colors, and rating.

- **URL**: https://apify.com/crawlerbros/shein-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Stats:** 47 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## Shein Featured Products Scraper

Scrape featured products from **[Shein](https://shein.com)** regional homepages across **22 countries**. Returns product ID, title, URL, sale and retail prices with formatted currency text, discount %, category, and images — all in local currency.

### What it does

- Fetches the Shein homepage for the selected country
- Parses ~6–16 server-rendered featured products from the embedded `productList` JSON (varies by country and session)
- Bracket-counted JSON extraction tolerates non-JSON fragments in the surrounding page
- Returns prices in local currency with sale/retail/discount and formatted symbol text
- Hardcoded residential proxy (Shein blocks all datacenter IPs)

### Scope note

**This scraper returns *currently-featured* Shein homepage products, not a keyword/URL-based catalog lookup.** Shein's category (`/dress-c-1727.html`) and product detail (`/...-p-39521541.html`) pages redirect every anonymous session to `/risk/challenge?captcha_type=903`. Only the root homepage is reachable without cookies, so the scraper extracts the featured products from the homepage server-side render.

The featured set rotates per session ID, so each run can return different products. Run the scraper multiple times to accumulate variety.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `country` | enum | `US` | Shein regional homepage (see supported countries below) |
| `maxItems` | integer | `30` | Maximum featured products to return (1–200) |

#### Supported countries

| Code | Country | Currency |
|---|---|---|
| `US` | United States | USD |
| `UK` | United Kingdom | GBP |
| `DE` | Germany | EUR |
| `FR` | France | EUR |
| `ES` | Spain | EUR |
| `IT` | Italy | EUR |
| `AU` | Australia | AUD |
| `BR` | Brazil | BRL |
| `CA` | Canada | CAD |
| `MX` | Mexico | MXN |
| `NL` | Netherlands | EUR |
| `SE` | Sweden | SEK |
| `PL` | Poland | PLN |
| `CH` | Switzerland | CHF |
| `PT` | Portugal | EUR |
| `AT` | Austria | EUR |
| `IL` | Israel | ILS |
| `PH` | Philippines | PHP |
| `SG` | Singapore | SGD |
| `MY` | Malaysia | MYR |
| `NZ` | New Zealand | NZD |
| `ZA` | South Africa | ZAR |

#### Example input

```json
{
    "country": "DE",
    "maxItems": 20
}
```

### Output

Each product is a JSON record. Fields are omitted when not present — no field is ever `null`.

| Field | Type | Always present | Description |
|---|---|---|---|
| `productId` | string | ✓ | Shein goods\_id |
| `title` | string | ✓ | Product name |
| `url` | string | ✓ | Product page URL |
| `countryCode` | string | ✓ | 2-letter country code |
| `scrapedAt` | string | ✓ | UTC ISO 8601 scrape timestamp |
| `mainImage` | string | ✓ | Main product image URL |
| `currency` | string | ✓ | Local currency code |
| `salePrice` | number | ✓ | Current sale price (numeric) |
| `salePriceText` | string | ✓ | Formatted sale price with symbol (e.g. `$18.23`) |
| `retailPrice` | number | ✓ | Original retail price (numeric) |
| `retailPriceText` | string | ✓ | Formatted retail price with symbol (e.g. `$26.39`) |
| `discountPercentage` | integer | — | Discount % off retail (present on ~95% of products) |
| `catId` | string | — | Shein category ID (present on ~96% of products) |
| `images` | array | — | Additional product image URLs (present on ~99% of products) |

#### Sample output

```json
{
    "productId": "410596328",
    "title": "Aloruh Women's Beaded Floral Loose Halter Neck Top",
    "url": "https://us.shein.com/-p-410596328.html",
    "countryCode": "US",
    "mainImage": "https://img.ltwebstatic.com/v4/j/pi/2026/03/16/ea/1773668717f1aeb4cce6f077e48c10775ec0127141_thumbnail_405x552.jpg",
    "currency": "USD",
    "salePrice": 13.33,
    "salePriceText": "$13.33",
    "retailPrice": 20.49,
    "retailPriceText": "$20.49",
    "discountPercentage": 35,
    "catId": "2223",
    "images": [
        "https://img.ltwebstatic.com/v4/j/pi/2026/02/28/3b/1772264392b9902f7c9c914bac00c237fb58631ada_thumbnail_405x552.jpg",
        "https://img.ltwebstatic.com/v4/j/pi/2026/03/16/72/177366871989f4c9815bf2e1e447c739a678fb483d_thumbnail_405x552.jpg"
    ],
    "scrapedAt": "2026-05-15T16:34:10Z"
}
```

### FAQ

**Do I need a proxy?**
No configuration needed — a residential proxy is hardcoded and applied automatically. Shein blocks all direct datacenter access.

**Why featured products only, not keyword search?**
Shein blocks category and product detail pages with a `/risk/challenge?captcha_type=903` redirect for anonymous sessions. Only the root homepage is reachable without pre-seeded cookies or a captcha-solver.

**How many products per run?**
The server-rendered homepage typically contains 6–16 featured products depending on country and session. `maxItems` caps the output (default 30, max 200), but you will rarely exceed ~16 per run.

**Do different countries return different products?**
Yes. Each regional site has its own featured set with local pricing, currency, and products.

**Is the data fresh?**
Every run fetches the live homepage. The featured set rotates per session, so repeated runs build up a rolling catalog.

### Use cases

- **Daily trending monitor** — track what Shein is featuring on each regional homepage
- **Price sampling** — accumulate a rolling catalog of Shein prices across 22 markets
- **Market research** — monitor product themes, categories, and promotions globally
- **Cross-market comparison** — compare US vs EU featured picks, pricing, or discount levels
- **Competitive intelligence** — track which products Shein promotes in emerging markets

### Notes

- Pricing is configured in the Apify UI (pay-per-result).
- The daily Apify test run uses `country=US`, `maxItems=5`.
- Parser: `_iter_product_blocks` walks every `{"goods_id":"..."}` object with a bracket counter + `json.loads`, tolerant of nested JSON fragments in the enclosing array.

# Actor input Schema

## `country` (type: `string`):

Which Shein regional homepage to scrape. Each region returns its own featured products in local currency.

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

Maximum featured products to return. The Shein homepage typically yields 6–16 products per session.

## Actor input object example

```json
{
  "country": "US",
  "maxItems": 5
}
```

# 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 = {
    "country": "US",
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/shein-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 = {
    "country": "US",
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/shein-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 '{
  "country": "US",
  "maxItems": 5
}' |
apify call crawlerbros/shein-scraper --silent --output-dataset

```

## MCP server setup

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