# Shopee Campaign Microsite Scraper (`xtracto/shopee-campaign`) Actor

Scrape products from Shopee campaign microsites (/m/{slug}). Discover active campaigns automatically from the homepage, or scrape a specific campaign by slug. Handles both card-grid layouts (full data) and editorial link grids (ID-based with optional detail enrichment).

- **URL**: https://apify.com/xtracto/shopee-campaign.md
- **Developed by:** [xtractoo](https://apify.com/xtracto) (community)
- **Categories:** E-commerce, SEO tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.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

## Shopee Campaign Microsite Scraper

Scrape products from Shopee campaign landing pages (`/m/{slug}`) — hand-curated promotional microsites for brand events and lifestyle programs like Shopee Fitcheck, Pilih Lokal, Barokah, and Dikelola Shopee.

### Why use this actor

- **Campaign-exclusive visibility** — see exactly which products Shopee's merchandising team is promoting right now
- **Automatic campaign discovery** — fetch the Shopee homepage to get a live list of active campaign slugs without hardcoding anything
- **Handles both layout types** — full product card data (Type A) and editorial link grids with optional enrichment (Type B)
- **No account or login required**
- **Stable JSON output** suitable for competitor intelligence and affiliate research

### How it works

1. Choose `mode: "discover"` to get a list of currently active campaign slugs from the Shopee homepage — or use `mode: "scrape"` with a known slug.
2. The actor fetches the campaign page and automatically detects the layout:
   - **Type A (card grid)**: full product data — name, price, image, rating, sold count — is immediately available.
   - **Type B (editorial link grid)**: hundreds of product links are extracted; enable `fetchDetail` to retrieve full product data for each.
3. Results stream into your dataset as JSON.

> **Campaign slugs change weekly** as Shopee rotates promotions. Use `mode: "discover"` regularly to stay current.

### Input

**Scrape a specific campaign:**
```json
{
  "mode": "scrape",
  "country": "id",
  "slug": "shopee-fitcheck",
  "maxProducts": 25,
  "fetchDetail": false
}
````

**Discover active campaigns from homepage:**

```json
{
  "mode": "discover",
  "country": "id"
}
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | `scrape` (default) — fetch products from a campaign. `discover` — list active campaigns. |
| `slug` | string | Campaign slug, e.g. `shopee-fitcheck`. Required for `mode=scrape` unless `url` is provided. |
| `url` | string | Full campaign URL as alternative to `slug`, e.g. `https://shopee.co.id/m/shopee-fitcheck`. |
| `country` | string | Shopee regional site: `id` (default), `sg`, `my`, `th`, `ph`, and more. |
| `maxProducts` | integer | Max products to return. Default: 25. For Type B, caps how many links are enriched. |
| `fetchDetail` | boolean | For Type B campaigns: fetch full product data (name, price, images, seller). Default: `false`. |
| `delay` | number | Seconds between requests. Default: 1.0. |

### Output

#### `mode: "scrape"` — Type A layout (e.g. shopee-fitcheck)

```json
[
  {
    "shop_id": 243352643,
    "item_id": 24094096408,
    "name": "kaos pria lengan panjang hoodie wafer",
    "url": "https://shopee.co.id/kaos-pria-lengan-panjang-hoodie-wafer-i.243352643.24094096408",
    "image_url": "https://down-id.img.susercontent.com/file/id-11134207-7rbka-m8m0h674emam50",
    "price": 50000,
    "discount_pct": null,
    "rating": null,
    "sold_count": 5000,
    "location": null,
    "is_mall": false,
    "currency": "IDR",
    "original_price": null,
    "rating_count": null,
    "campaign_slug": "shopee-fitcheck"
  },
  {
    "shop_id": 12597744,
    "item_id": 24914631167,
    "name": "Setelan Anak Rui Top Celana Cargo Korea Unik",
    "url": "https://shopee.co.id/Setelan-Anak-Rui-Top-Celana-Cargo-Korea-Unik-i.12597744.24914631167",
    "image_url": "https://down-id.img.susercontent.com/file/id-11134207-7r98x-ls0vcd63u5bx8c",
    "price": 35000,
    "discount_pct": null,
    "rating": null,
    "sold_count": 10000,
    "location": null,
    "is_mall": false,
    "currency": "IDR",
    "campaign_slug": "shopee-fitcheck"
  }
  // ... more
]
```

#### `mode: "discover"` — active campaign slugs

```json
[
  { "slug": "shopee-pilih-lokal", "url": "https://shopee.co.id/m/shopee-pilih-lokal", "country": "id" },
  { "slug": "barokah",            "url": "https://shopee.co.id/m/barokah",            "country": "id" },
  { "slug": "shopee-fitcheck",    "url": "https://shopee.co.id/m/shopee-fitcheck",    "country": "id" }
  // ... more
]
```

#### `mode: "scrape"` — Type B layout (fetchDetail: false)

When the campaign uses an editorial layout (e.g. Pilih Lokal, Barokah), the actor returns product ID stubs. Enable `fetchDetail: true` to retrieve full product data.

```json
{
  "shop_id": 123456789,
  "item_id": 98765432100,
  "url": "https://shopee.co.id/product/123456789/98765432100",
  "campaign_slug": "shopee-pilih-lokal",
  "country": "id",
  "layout_type": "B"
}
```

| Field | Type | Description |
|---|---|---|
| `shop_id` | integer | Numeric seller shop ID |
| `item_id` | integer | Numeric product item ID |
| `name` | string | Product title (Type A, or Type B with `fetchDetail: true`) |
| `price` | integer | Price in local currency |
| `discount_pct` | integer | Discount percentage, or `null` |
| `rating` | float | Average rating, or `null` |
| `sold_count` | integer | Units sold, or `null` |
| `currency` | string | ISO currency code |
| `campaign_slug` | string | The campaign slug this product was found in |
| `layout_type` | string | `"B"` for editorial link-grid campaigns (only in stub output) |

### Other Shopee Actors

| Actor | What it does |
|---|---|
| [shopee-search](../shopee-search-act) | Keyword + category search across all sellers |
| [shopee-mall-search](../shopee-mall-search) | Official brand store search (Shopee Mall) |
| [shopee-product-detail](../shopee-detail-act) | Full product detail by shop/item ID or URL |
| [shopee-shop](../shopee-shop-act) | All products from a specific Shopee shop |
| [shopee-flash-sale](../shopee-flash-sale) | Current flash sale session products |
| [shopee-search-hint](../shopee-search-hint) | Keyword autocomplete suggestions |

# Actor input Schema

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

scrape: Fetch products from a specific campaign page (requires slug or url). discover: List all active campaign slugs currently visible on the Shopee homepage — useful to find what campaigns are running right now.

## `slug` (type: `string`):

The campaign slug from the /m/{slug} URL. Example: 'shopee-fitcheck'. Required for mode=scrape unless url is provided. Use mode=discover to find active slugs automatically.

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

Full campaign microsite URL. The slug is extracted automatically. Example: https://shopee.co.id/m/shopee-fitcheck

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

Shopee regional site. Campaign microsites are most active and varied on shopee.co.id (Indonesia). Other countries may have fewer campaigns.

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

Maximum products to return. For card-grid campaigns (Type A), all available cards are returned up to this limit. For editorial link-grid campaigns (Type B), this limits how many product links are enriched when fetchDetail is enabled.

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

For editorial link-grid campaigns (Type B, e.g. Pilih Lokal, Barokah): fetch full product data — name, price, images, description, seller info — for each product link. Without this, only shop\_id, item\_id, and URL are returned for Type B. Card-grid campaigns (Type A) always include name and price regardless of this setting.

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

Delay between HTTP requests in seconds.

## Actor input object example

```json
{
  "mode": "scrape",
  "slug": "shopee-fitcheck",
  "country": "id",
  "maxProducts": 25,
  "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 = {
    "mode": "scrape",
    "slug": "shopee-fitcheck",
    "url": "",
    "country": "id",
    "maxProducts": 25,
    "fetchDetail": false,
    "delay": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/shopee-campaign").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 = {
    "mode": "scrape",
    "slug": "shopee-fitcheck",
    "url": "",
    "country": "id",
    "maxProducts": 25,
    "fetchDetail": False,
    "delay": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/shopee-campaign").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 '{
  "mode": "scrape",
  "slug": "shopee-fitcheck",
  "url": "",
  "country": "id",
  "maxProducts": 25,
  "fetchDetail": false,
  "delay": 1
}' |
apify call xtracto/shopee-campaign --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtracto/shopee-campaign",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Shopee Campaign Microsite Scraper",
        "description": "Scrape products from Shopee campaign microsites (/m/{slug}). Discover active campaigns automatically from the homepage, or scrape a specific campaign by slug. Handles both card-grid layouts (full data) and editorial link grids (ID-based with optional detail enrichment).",
        "version": "0.1",
        "x-build-id": "Yb6aTS0vY6ueT6Bzf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~shopee-campaign/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-shopee-campaign",
                "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/xtracto~shopee-campaign/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-shopee-campaign",
                "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/xtracto~shopee-campaign/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-shopee-campaign",
                "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": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "scrape",
                            "discover"
                        ],
                        "type": "string",
                        "description": "scrape: Fetch products from a specific campaign page (requires slug or url). discover: List all active campaign slugs currently visible on the Shopee homepage — useful to find what campaigns are running right now.",
                        "default": "scrape"
                    },
                    "slug": {
                        "title": "Campaign slug",
                        "type": "string",
                        "description": "The campaign slug from the /m/{slug} URL. Example: 'shopee-fitcheck'. Required for mode=scrape unless url is provided. Use mode=discover to find active slugs automatically."
                    },
                    "url": {
                        "title": "Campaign URL (alternative to slug)",
                        "type": "string",
                        "description": "Full campaign microsite URL. The slug is extracted automatically. Example: https://shopee.co.id/m/shopee-fitcheck"
                    },
                    "country": {
                        "title": "Country",
                        "enum": [
                            "id",
                            "sg",
                            "my",
                            "th",
                            "ph",
                            "vn",
                            "br",
                            "tw",
                            "mx",
                            "co",
                            "cl"
                        ],
                        "type": "string",
                        "description": "Shopee regional site. Campaign microsites are most active and varied on shopee.co.id (Indonesia). Other countries may have fewer campaigns.",
                        "default": "id"
                    },
                    "maxProducts": {
                        "title": "Max products",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum products to return. For card-grid campaigns (Type A), all available cards are returned up to this limit. For editorial link-grid campaigns (Type B), this limits how many product links are enriched when fetchDetail is enabled.",
                        "default": 25
                    },
                    "fetchDetail": {
                        "title": "Fetch full product detail",
                        "type": "boolean",
                        "description": "For editorial link-grid campaigns (Type B, e.g. Pilih Lokal, Barokah): fetch full product data — name, price, images, description, seller info — for each product link. Without this, only shop_id, item_id, and URL are returned for Type B. Card-grid campaigns (Type A) always include name and price regardless of this setting.",
                        "default": false
                    },
                    "delay": {
                        "title": "Request delay (seconds)",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "number",
                        "description": "Delay between HTTP requests in seconds.",
                        "default": 1
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
