# Shopee Scraper - All In One (`xtracto/shopee-scraper`) Actor

All-in-one Shopee scraper to extract product, search, category, and shop data across multiple countries. fast, lightweight, and no browser or account required.

- **URL**: https://apify.com/xtracto/shopee-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 2,511 total users, 169 monthly users, 99.8% runs succeeded, 17 bookmarks
- **User rating**: 4.09 out of 5 stars

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

## Shopee Scraper

Extract product data from Shopee across **11 countries** - keyword search, category browsing, product detail, and shop listings. No browser automation, no proxy required for most regions.

***

### Related Actors

<table>
  <tr>
    <td colspan="4"><strong>Shopee Scraper Suite</strong> &nbsp;·&nbsp; Search, browse, get product details, and extract entire shop catalogs across 11 Shopee countries</td>
  </tr>
  <tr valign="top">
    <td width="25%"><strong>All-in-One</strong><br/><strong>&#9656; You are here</strong><br/><sub>Every mode in one actor</sub></td>
    <td width="25%"><a href="https://apify.com/xtracto/shopee-search"><strong>Search &amp; Category</strong></a><br/><sub>Keyword &amp; category listings</sub></td>
    <td width="25%"><a href="https://apify.com/xtracto/shopee-product-detail"><strong>Product Detail</strong></a><br/><sub>Full single-product data</sub></td>
    <td width="25%"><a href="https://apify.com/xtracto/shopee-shop-scraper"><strong>Shop Scraper</strong></a><br/><sub>Every product from a shop</sub></td>
  </tr>
</table>

***

### Why Use This Actor?

Shopee does not provide a public API. Most scraping solutions rely on full browser automation (Playwright/Puppeteer), which is slow, expensive, and fragile. This actor works without launching a browser at all, making it:

- **Fast** - lightweight HTTP requests instead of rendering a full browser
- **Cost-efficient** - lower compute unit consumption
- **Stable** - no dependency on browser fingerprinting or JS rendering pipelines

#### Supported Countries

| Code | Domain |
|------|--------|
| `id` | shopee.co.id (Indonesia) |
| `sg` | shopee.sg (Singapore) |
| `my` | shopee.com.my (Malaysia) |
| `th` | shopee.co.th (Thailand) |
| `ph` | shopee.ph (Philippines) |
| `vn` | shopee.vn (Vietnam) |
| `br` | shopee.com.br (Brazil) |
| `tw` | shopee.tw (Taiwan) |
| `mx` | shopee.com.mx (Mexico) |
| `co` | shopee.com.co (Colombia) |
| `cl` | shopee.cl (Chile) |

***

#### ⚠️ Important: product detail is now partial for ALL countries (Shopee change, mid-2026)

> **Full product detail — description, brand, per-variant models, attributes,
> tier variations, full image gallery — is no longer obtainable via HTTP
> scraping for any Shopee country.**
>
> In mid-2026 Shopee migrated every product page to a client-rendered SPA,
> **including `shopee.co.id`**, which used to be the one region that
> server-rendered full data. The product data now loads from an internal API
> guarded by a JavaScript-signed anti-bot token, so it can't be reached without
> running a real browser. This is a Shopee platform change, not an actor bug.
>
> **No proxy fixes this.** The block is token-based, not IP-based — a
> residential proxy in the target country (or any other proxy) changes the IP
> but never supplies the required token. Residential proxy still helps avoid
> IP blocks on *listing* pages, which is a separate thing.

**What `detail` and `fetchDetail: true` return today (every country):**
title, `price` / `price_min` / `price_max`, original price, discount, primary
image, rating, sold count, **categories + `cat_id` + breadcrumb**, and full
seller/shop info.

**What they no longer return:** description, brand, per-variant models,
attributes, tier variations, per-model stock, and the full image gallery. Those
require a browser-based approach that is out of scope for this HTTP-only actor.

##### What you get per country × mode

| Country | `keyword` | `category` | `shop` | `detail` | `fetchDetail: true` |
|---------|:---------:|:----------:|:------:|:--------:|:-------------------:|
| `id` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `sg` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `my` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `th` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `ph` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `vn` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `br` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `tw` | ✅ | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `mx` | ✅ (60–70% have a price) | ✅ | ✅ | ⚠️ Partial | ⚠️ Partial |
| `co` | ✅ | ❌ Not available | ✅ | ⚠️ Partial | ⚠️ Partial |
| `cl` | ✅ | ❌ Not available | ✅ | ⚠️ Partial | ⚠️ Partial |

**Legend:**

- ✅ = works and returns the fields documented for that mode.
- ⚠️ **Partial** = title + price (`price` / `price_min` / `price_max`) + original price + discount + primary image + rating + sold count + **categories + `cat_id` + breadcrumb** + seller/shop info. Does **not** include description, brand, variants/models, attributes, tier variations, per-model stock, or the full image gallery (see the note above — Shopee removed these from HTTP-reachable data mid-2026). Same for every country now, including `id`.
- ❌ **Not available** = the mode is rejected with a clear error message in the run log. Use `keyword` or `shop` mode for these regions instead.

***

### Use Cases

- **Price monitoring** - track price changes across products or categories over time
- **Competitor research** - analyze competitor shop listings, pricing tiers, and discount strategies
- **Market research** - discover bestselling products in a category or keyword segment
- **Product catalog extraction** - pull product titles, images, attributes, and variants from a shop or search result
- **Lead generation** - collect seller info (shop name, location, rating, follower count, response rate)

***

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country` | select | No (default: `id`) | Shopee regional domain to scrape |
| `mode` | select | **Yes** | Scraping mode (see below) |
| `keyword` | string | mode=keyword | Search term, e.g. `"laptop gaming"` |
| `url` | string | mode=url | Any Shopee URL - product, search, category, or shop page |
| `shopId` | integer | mode=detail | Seller's numeric shop ID |
| `itemId` | integer | mode=detail | Product's numeric item ID |
| `category` | string | mode=category | Category slug, e.g. `/Laptop-cat.11044364.11044440` |
| `shop` | string | mode=shop | Shop username or numeric shop ID |
| `sort` | select | No (default: `relevancy`) | Sort order for search/category results |
| `maxProducts` | integer | No (default: `40`) | Maximum products to return |
| `minPrice` | integer | No | Minimum price filter in local currency (keyword mode only) |
| `maxPrice` | integer | No | Maximum price filter in local currency (keyword mode only) |
| `fetchDetail` | boolean | No (default: `false`) | If `true`, each product card in keyword/category/shop/url modes is enriched with the extra detail fields still reachable over HTTP: `price_min`/`price_max`, availability, categories + `cat_id` + breadcrumb, and full seller/shop info. Slower — each product adds up to 3 HTTP requests. Recommended for ≤ 20 products. (Does **not** add description/brand/variants/attributes — those are browser-only since mid-2026.) |
| `delay` | number | No (default: `1.0`) | Delay in seconds between requests |

#### Modes Explained

##### `keyword` - Search by keyword

Searches Shopee for a keyword and returns product cards (name, price, discount, images, IDs, location).

> **Note:** Results are capped at ~40 products per sort variant. To get more products, increase `maxProducts` - the actor will automatically cycle through additional sort orders (`sales`, `newest`, `price_asc`, `price_desc`) to surface more unique results.

##### `url` - Auto-detect from any Shopee URL

Paste any Shopee URL and the actor auto-detects whether it's a product page, search result, category, or shop listing. Country is also auto-detected from the URL domain, so you can paste a `shopee.sg` URL even when the country input is set to `id`.

##### `detail` - Product detail by Shop ID + Item ID

Fetches the (now partial) detail for a single product: title, pricing, primary image, rating, sold count, **categories + `cat_id` + breadcrumb**, and full seller info. Description, brand, variants/models, attributes, tier variations, and the full image gallery are no longer returned for any country — see the **"product detail is now partial for all countries"** note above. You need the **Shop ID** and **Item ID**, which can both be found in the product URL:

```
https://shopee.co.id/Product-Name-i.{SHOP_ID}.{ITEM_ID}
                                     ↑          ↑
```

##### `category` - Browse a category page

Provide a category slug (e.g. `/Laptop-cat.11044364.11044440`) or a full category URL. Returns up to `maxProducts` product cards from that category.

##### `shop` - Fetch a shop's product listing

Provide a shop username (e.g. `rasyidjaya_computer`) or a numeric shop ID. Returns product cards from that shop's storefront.

***

### fetchDetail — Rich Enrichment Mode

By default, modes `keyword`, `category`, `shop`, and `url` return lightweight **ProductCard** data (name, price, discount, rating, image URL). This is fast and suitable for large-scale discovery.

Set `fetchDetail: true` to enrich each card with the extra **ProductDetail** fields still reachable over HTTP: `price_min` / `price_max`, availability, **categories + `cat_id` + breadcrumb**, and full seller/shop info.

> **Note:** description, brand, variants/models, attributes, tier variations, per-model stock, and the full image gallery are **no longer returned for any country** — Shopee moved them behind a browser-only anti-bot API in mid-2026. See the **"product detail is now partial for all countries"** note above. `fetchDetail: true` is now a modest enrichment (categories/breadcrumb/pricing range/shop), not a full-detail upgrade.

#### Speed & Cost

| Mode | fetchDetail | ~Time for 40 products | Requests |
|------|-------------|----------------------|----------|
| keyword | `false` | ~40–60 sec | ~2 |
| keyword | `true` | ~6–10 min | ~122 |
| detail | — | ~5–10 sec | 3 |

> Each enriched product requires up to 3 HTTP requests (shop-listing lookup + shop API + fbbot JSON-LD for categories). With the default 1 second delay, expect ~8–12 seconds per product.
>
> **Recommendation:** Use `fetchDetail: false` for discovery (large keyword/category runs). Since full PDP fields are no longer HTTP-reachable, `fetchDetail: true` mainly adds categories/breadcrumb and shop info.

#### What fetchDetail Adds

| Field | ProductCard | ProductDetail (fetchDetail=true) |
|-------|:-----------:|:--------------------------------:|
| name / title | ✓ | ✓ |
| price, discount\_pct | ✓ | ✓ |
| rating, sold\_count | ✓ | ✓ |
| image\_url (1 image) | ✓ | ✓ |
| **price\_min, price\_max** | ✗ | ✓ |
| **availability** | ✗ | ✓ |
| **categories\[], cat\_id** | ✗ | ✓ |
| **breadcrumb\[]** | ✗ | ✓ |
| **shop{}** (seller detail) | ✗ | ✓ |
| description | ✗ | ✗ *(browser-only since mid-2026)* |
| brand, brand\_id | ✗ | ✗ *(browser-only since mid-2026)* |
| images\[] (full gallery) | ✗ | ✗ *(browser-only since mid-2026)* |
| models\[] (variants) | ✗ | ✗ *(browser-only since mid-2026)* |
| tier\_variations\[] | ✗ | ✗ *(browser-only since mid-2026)* |
| attributes\[] | ✗ | ✗ *(browser-only since mid-2026)* |
| stock, historical\_sold | ✗ | ✗ *(browser-only since mid-2026)* |

#### Example — fetchDetail enabled

**Input:**

```json
{
  "country": "id",
  "mode": "keyword",
  "keyword": "laptop gaming",
  "maxProducts": 5,
  "fetchDetail": true
}
```

**Output (one item, enriched):**

```json
{
  "shop_id": 250649369,
  "item_id": 10547676232,
  "title": "ASUS VIVOBOOK GO 14 E1404FA RYZEN 3 7320 8GB 512GB W11+OHS 14.0FHD",
  "currency": "IDR",
  "price": 11648000.0,
  "price_min": 11648000.0,
  "price_max": 11648000.0,
  "discount_pct": 49,
  "rating_star": 5.0,
  "sold": 280,
  "images": ["https://down-id.img.susercontent.com/file/id-11134207-7ra0o-xxx"],
  "cat_id": 11044443,
  "categories": [
    { "catid": 11044364, "name": "Komputer & Aksesoris", "url": "https://shopee.co.id/Komputer-Aksesoris-cat.11044364" },
    { "catid": 11044440, "name": "Laptop", "url": "https://shopee.co.id/Laptop-cat.11044364.11044440" },
    { "catid": 11044443, "name": "Laptop Gaming", "url": "https://shopee.co.id/Laptop-Gaming-cat.11044364.11044440.11044443" }
  ],
  "breadcrumb": [
    { "position": 1, "name": "Shopee", "url": "https://shopee.co.id/" },
    { "position": 2, "name": "Komputer & Aksesoris", "url": "https://shopee.co.id/Komputer-Aksesoris-cat.11044364" },
    { "position": 3, "name": "Laptop", "url": "https://shopee.co.id/Laptop-cat.11044364.11044440" },
    { "position": 4, "name": "Laptop Gaming", "url": "https://shopee.co.id/Laptop-Gaming-cat.11044364.11044440.11044443" }
  ],
  "shop": {
    "shopid": 250649369,
    "name": "Agres Official Shop",
    "username": "agresid",
    "rating_star": 4.91,
    "item_count": 2127,
    "follower_count": 191828,
    "is_official_shop": true
  }
}
```

> `description`, `brand`, `models`, `attributes`, `tier_variations`, and `stock` are returned as empty/`null` — Shopee no longer exposes them over HTTP (see the limitation note above).

***

### Sample Input & Output

#### Example 1 - Keyword Search

**Input:**

```json
{
  "country": "id",
  "mode": "keyword",
  "keyword": "laptop gaming",
  "sort": "sales",
  "maxProducts": 40
}
```

**Output (one item):**

```json
{
  "shop_id": 12345678,
  "item_id": 98765432100,
  "name": "Laptop Gaming ASUS ROG Strix G15 Ryzen 7 16GB 512GB RTX3060",
  "url": "https://shopee.co.id/Laptop-Gaming-ASUS-ROG-i.12345678.98765432100",
  "image_url": "https://down-id.img.susercontent.com/file/id-11134207-xxx",
  "price": 14999000,
  "original_price": 17500000,
  "discount_pct": 14,
  "rating": 4.9,
  "rating_count": 312,
  "sold_count": 1200,
  "location": "Jakarta Barat",
  "is_mall": false,
  "currency": "IDR"
}
```

#### Example 2 - Product Detail

**Input:**

```json
{
  "country": "id",
  "mode": "detail",
  "shopId": 196846900,
  "itemId": 11089699432
}
```

**Output:**

```json
{
  "shop_id": 250649369,
  "item_id": 10547676232,
  "title": "ASUS VIVOBOOK GO 14 E1404FA RYZEN 3 7320 8GB 512GB W11+OHS 14.0FHD GRN GRY",
  "currency": "IDR",
  "shop_location": "KOTA JAKARTA UTARA",
  "price": 11648000.0,
  "price_min": 11648000.0,
  "price_max": 11648000.0,
  "discount_pct": 49,
  "rating_star": 5.0,
  "sold": 280,
  "images": [
    "https://down-id.img.susercontent.com/file/id-11134207-7ra0o-xxx"
  ],
  "cat_id": 11044443,
  "categories": [
    { "catid": 11044364, "name": "Komputer & Aksesoris", "url": "https://shopee.co.id/Komputer-Aksesoris-cat.11044364" },
    { "catid": 11044440, "name": "Laptop", "url": "https://shopee.co.id/Laptop-cat.11044364.11044440" },
    { "catid": 11044443, "name": "Laptop Gaming", "url": "https://shopee.co.id/Laptop-Gaming-cat.11044364.11044440.11044443" }
  ],
  "breadcrumb": [
    { "position": 1, "name": "Shopee", "url": "https://shopee.co.id/" },
    { "position": 2, "name": "Komputer & Aksesoris", "url": "https://shopee.co.id/Komputer-Aksesoris-cat.11044364" },
    { "position": 3, "name": "Laptop", "url": "https://shopee.co.id/Laptop-cat.11044364.11044440" },
    { "position": 4, "name": "Laptop Gaming", "url": "https://shopee.co.id/Laptop-Gaming-cat.11044364.11044440.11044443" }
  ],
  "shop": {
    "shopid": 250649369,
    "name": "Agres Official Shop",
    "username": "agresid",
    "location": "KOTA JAKARTA UTARA",
    "rating_star": 4.91,
    "item_count": 2127,
    "follower_count": 191828,
    "response_rate": 100,
    "is_official_shop": true
  }
}
```

> Note: `description`, `brand`, `models`/variants, `attributes`, `tier_variations`, and per-item `stock` are no longer returned for any country (Shopee moved them behind a browser-only API mid-2026). See the limitation note near the top.

#### Example 3 - URL Auto-detect

**Input:**

```json
{
  "mode": "url",
  "url": "https://shopee.co.id/search?keyword=mouse+wireless",
  "maxProducts": 20
}
```

Returns the same format as keyword search. Country is auto-detected from the URL.

***

### Known Limitations

- **Per-variant prices and stock are hidden by Shopee.** For products
  with multiple variants (size, color, spec), each variant entry will
  have `price: null` and `stock: null`. You receive an overall price
  range (`price_min` / `price_max`) for most products, plus a single
  aggregate `stock` value.

- **The exact displayed `price` is hidden in detail mode.** Shopee
  removes it from the data served to crawlers. You usually still
  receive `price_min` and `price_max`. If you need the exact price,
  scrape the product through `keyword` / `category` / `shop` mode
  first — the product card always carries a price.

- **"Sold count" is missing for most products.** Shopee hides this
  number. The actor recovers it on a best-effort basis from visible
  page text, succeeding for roughly 30–50% of products. Many products
  will return `null` for `sold_count` / `sold`.

- **Keyword search returns around 40 products per page.** The actor
  rotates through different sort orders (sales, newest, price low,
  price high) to surface more unique items, but the total can fall
  short of `maxProducts` for narrow queries.
  > **Tip — to collect more varied results, run several related keywords**
  > instead of one broad term. For example, rather than only `laptop`,
  > run separate runs for `laptop`, `laptop gaming`, `laptop bekas`,
  > `laptop asus`, `notebook`, etc., then merge the datasets. Each keyword
  > surfaces a different slice of Shopee's catalog, so combining them gives
  > far broader coverage than a single search.

- **Category pages have only one page of results** in `category` mode.
  Deeper navigation is not available through public access.

- **`category` mode is not available for Colombia (`co`) and Chile
  (`cl`).** These regions do not expose category pages publicly. Use
  `keyword` or `shop` mode for those countries.

- **Full product detail is no longer available for any country (Shopee
  change, mid-2026).** Description, brand, per-variant models, attributes,
  tier variations, per-model stock, and the full image gallery were moved
  behind a client-rendered SPA + JavaScript-signed anti-bot API that can't
  be reached over HTTP — including `shopee.co.id`, previously the one region
  that served full data. `detail` and `fetchDetail: true` now return title,
  pricing, primary image, rating, sold count, **categories + `cat_id` +
  breadcrumb**, and full seller/shop info for every country. **No proxy
  restores the removed fields** — the block is token-based, not IP-based.
  Recovering them requires a browser-based approach (out of scope for this
  HTTP-only actor). See the **"product detail is now partial for all countries"** note
  near the top.

- **Flash sale and voucher prices are not available.** These require an
  authenticated browser session and cannot be obtained through public
  access

# Actor input Schema

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

Shopee regional site. Notes: (1) mode=category is NOT available for Colombia (co) and Chile (cl) — these regions do not expose category pages publicly. (2) mode=detail and fetchDetail=true return full product information (description, brand, all variants, attributes, image gallery) only for id/sg/my/th/ph when running on Apify Cloud (residential proxy is used automatically); for other countries you receive a lighter set: title, price, primary image, rating, sold count, seller info.

## `mode` (type: `string`):

Choose what to scrape:
• **Keyword search** — search products by keyword
• **Any Shopee URL** — paste any Shopee link, auto-detected
• **Product detail** — get product data (title, price, categories, breadcrumb, seller) by Shop ID + Item ID
• **Category page** — scrape all products in a category
• **Shop listing** — scrape all products from a shop

## `keyword` (type: `string`):

Keyword to search for (e.g. "laptop gaming", "iphone 15"). Required when mode = keyword.

## `sort` (type: `string`):

Sort order for keyword search results.

## `maxProducts` (type: `integer`):

Maximum number of products to collect. Shopee shows ~40 per page; the scraper auto-paginates to reach this limit.

## `minPrice` (type: `integer`):

Minimum price in local currency (e.g. 100000 for IDR 100.000). Leave empty for no minimum. Only applies to keyword search.

## `maxPrice` (type: `integer`):

Maximum price in local currency. Leave empty for no maximum. Only applies to keyword search.

## `url` (type: `string`):

Any Shopee URL — product page, search results, category, or shop. Required when mode = url.

## `shopId` (type: `string`):

Numeric seller shop ID (entered as text to preserve every digit). Required when mode = detail. Example: 196846900

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

Numeric product item ID (entered as text to preserve every digit — number fields round off long IDs). Required when mode = detail. Example: 11089699432

## `category` (type: `string`):

Category slug or full URL. Example: /Laptop-cat.11044364.11044440. Required when mode = category.

## `shop` (type: `string`):

Shop username (e.g. xiaomi.sg) or numeric Shop ID. Required when mode = shop.

## `fetchDetail` (type: `boolean`):

If enabled, each product card from keyword/category/shop/url mode is enriched with the detail fields still reachable over HTTP: price\_min/price\_max, availability, categories + cat\_id + breadcrumb, and full seller/shop info. Uses more requests and takes longer. Note: description, brand, variants and attributes are no longer available for any country (Shopee moved them behind a browser-only API in mid-2026).

## `delay` (type: `number`):

Minimum delay between HTTP requests. Increase if you hit rate limits; decrease for faster scraping. Default 1.0s is safe for most runs.

## Actor input object example

```json
{
  "country": "id",
  "mode": "keyword",
  "keyword": "laptop gaming",
  "sort": "relevancy",
  "maxProducts": 40,
  "url": "https://shopee.co.id/search?keyword=laptop",
  "shopId": "196846900",
  "itemId": "11089699432",
  "category": "/Laptop-cat.11044364.11044440",
  "shop": "rasyidjaya_computer",
  "fetchDetail": false,
  "delay": 1
}
```

# 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": "id",
    "mode": "keyword",
    "keyword": "laptop gaming",
    "sort": "relevancy",
    "maxProducts": 40,
    "url": "https://shopee.co.id/search?keyword=laptop",
    "shopId": "196846900",
    "itemId": "11089699432",
    "category": "/Laptop-cat.11044364.11044440",
    "shop": "rasyidjaya_computer",
    "fetchDetail": false,
    "delay": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/shopee-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": "id",
    "mode": "keyword",
    "keyword": "laptop gaming",
    "sort": "relevancy",
    "maxProducts": 40,
    "url": "https://shopee.co.id/search?keyword=laptop",
    "shopId": "196846900",
    "itemId": "11089699432",
    "category": "/Laptop-cat.11044364.11044440",
    "shop": "rasyidjaya_computer",
    "fetchDetail": False,
    "delay": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/shopee-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": "id",
  "mode": "keyword",
  "keyword": "laptop gaming",
  "sort": "relevancy",
  "maxProducts": 40,
  "url": "https://shopee.co.id/search?keyword=laptop",
  "shopId": "196846900",
  "itemId": "11089699432",
  "category": "/Laptop-cat.11044364.11044440",
  "shop": "rasyidjaya_computer",
  "fetchDetail": false,
  "delay": 1
}' |
apify call xtracto/shopee-scraper --silent --output-dataset

```

## MCP server setup

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