# 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:** 2 total users, 1 monthly users, 100.0% runs succeeded, 11 bookmarks
- **User rating**: 5.00 out of 5 stars

## 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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://us.shein.com)** regional homepages across 7 countries. Returns product ID, name, URL, prices (sale + retail), image, discount percentage, and category.

### What it does

- Fetches the Shein homepage for the selected country
- Parses ~50 server-rendered featured products from the embedded `productList` JSON
- Per-product bracket-counted JSON extraction tolerates non-JSON fragments in the surrounding page
- Returns prices in local currency (`USD`, `GBP`, `EUR`, `AUD`) with sale/retail/discount
- Hardcoded residential proxy (Shein hard-blocks 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 (`https://us.shein.com/`) is reachable without cookies, so the scraper extracts 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: `US`, `UK`, `DE`, `FR`, `ES`, `IT`, `AU` |
| `maxItems` | integer | `30` | Maximum featured products to return (1-200) |

#### Example input

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

### Output

Each product is a JSON record with the following fields (missing fields are omitted, never `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 (`USD`, `GBP`, `EUR`, `AUD`) |
| `salePrice` | number | — | Current sale price |
| `salePriceText` | string | — | Formatted price with currency symbol |
| `retailPrice` | number | — | Original retail price (before discount) |
| `discountPercentage` | number | — | Discount % off retail |
| `catId` | string | — | Shein category ID |
| `brand` | string | — | Brand name if present |
| `images` | array | — | Additional product images |

#### Sample output

```json
{
    "productId": "323288283",
    "title": "Amplova Women's Slogan Print Yellow Bandeau Top And Low Waist Mini Shorts Set",
    "url": "https://us.shein.com/-p-323288283.html",
    "countryCode": "US",
    "mainImage": "https://img.ltwebstatic.com/v4/j/pi/2025/12/11/af/1765421201aae6799000f50a389fe2f87ee624a82d_thumbnail_405x552.jpg",
    "currency": "USD",
    "salePrice": 18.23,
    "salePriceText": "$18.23",
    "retailPrice": 26.39,
    "discountPercentage": 31,
    "catId": "1780",
    "scrapedAt": "2026-04-14T08:42:22Z"
}
```

### FAQ

**Do I need a proxy?**
No configuration needed — a residential proxy is hardcoded and applied automatically. Shein blocks 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. Only the root homepage is reachable without pre-seeded cookies or a captcha-solver, so this scraper extracts the featured products embedded in the homepage server-side render.

**How many products per run?**
The homepage ships 6-60 products depending on session / IP. The scraper returns up to `maxItems` (default 30).

**Do different countries return different products?**
Yes. Each regional site (`us.shein.com`, `uk.shein.com`, etc.) has its own feature set with local pricing and currency.

**Is the data fresh?**
Every run fetches the live homepage and 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 countries
- **Market research** — monitor product themes / categories across 7 markets
- **Cross-market comparison** — compare US vs EU featured picks for the same brand

### 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.

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

Maximum featured products to return (the homepage ships ~50 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/shein-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Shein Product Scraper",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "BwmTjeyvFm0Ot1t2b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~shein-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-shein-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~shein-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-shein-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~shein-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-shein-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "country": {
                        "title": "Country",
                        "enum": [
                            "US",
                            "UK",
                            "DE",
                            "FR",
                            "ES",
                            "IT",
                            "AU"
                        ],
                        "type": "string",
                        "description": "Which Shein regional homepage to scrape.",
                        "default": "US"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum featured products to return (the homepage ships ~50 products per session).",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
