# TikTok Shop Product Detail Scraper — US & Southeast Asia (`rainfetch/tiktok-shop-product-scraper`) Actor

Scrape product pages by URL or ID (US, ID, MY, SG, PH, VN, TH): prices, SKU stock, sold count, ratings & seller stats. $1.25/1K, errors unbilled.

- **URL**: https://apify.com/rainfetch/tiktok-shop-product-scraper.md
- **Developed by:** [Rainfetch](https://apify.com/rainfetch) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.25 / 1,000 products

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TikTok Shop Product Detail Scraper — US & Southeast Asia

Scrape structured product data and live seller metrics from **TikTok Shop** across the **United States and six Southeast Asia markets** — **US, Indonesia (Shop | Tokopedia, `shop-id.tokopedia.com`), Malaysia, Singapore, Philippines, Vietnam, and Thailand**. Pass product URLs or numeric IDs to get multi-sample prices, SKU stock, sold counts, ratings, embedded reviews, shipping, and seller stats over plain HTTP/2 with no browser overhead. Delisted or failed items return structured error rows and are never billed.

> **Disclaimer:** This Actor is not affiliated with, endorsed by, or sponsored by TikTok, ByteDance, or Tokopedia. It accesses publicly available storefront pages and public store metadata only.

***

### About prices (read this)

Anonymous visitors to TikTok Shop and Shop | Tokopedia are shown a randomized server-side markup of roughly 0–20 % on all price fields (`price.current`, `price.original`, `price.min`, `price.max`, and per-variant SKU prices), even on consecutive requests from the same IP and session. For direct (non-proxy) successes, this Actor fetches the product page `priceSamples` times (default `3`, range `1`–`5`) and keeps all price fields from the single payload with the lowest observed sale price, which is an upper bound on the real price; raise `priceSamples` for a tighter bound (at lower throughput) and inspect `price.sampleCount`, `price.lowestObserved`, `price.highestObserved`, `price.isEstimated`, and `price.maxOverstatementPct` on every record. Because TikTok Shop applies one multiplier to the entire price block, `price.discountPercent` is exact — as are `inStock`, `stockTotal`, `soldCount`, `rating`, `reviews`, and `seller` stats.

***

### What It Does

Given a list of product URLs, bare numeric product IDs, or `shop_id:product_id` pairs, the scraper fetches each product's server-rendered detail page (`__MODERN_ROUTER_DATA__`) and optionally enriches seller metrics via TikTok Shop's public `store_info` endpoint.

For every product, it returns a clean, flat JSON record containing:

- **Core metadata:** canonical URL, product ID, shop/seller ID, region, currency, title, description, brand, and category breadcrumb path (`id` + `name`).
- **Multi-sample upper-bound pricing & exact discounts:** lowest observed `current` price across `priceSamples` fetches, consistent `original` and SKU `min`/`max` from that same payload, exact `discountPercent`, plus sampling diagnostics (`sampleCount`, `lowestObserved`, `highestObserved`, `isEstimated`, `maxOverstatementPct`).
- **Exact inventory & sales:** `inStock` boolean, summed `stockTotal` across SKUs, `soldCount`, and full per-SKU `variants` array (`skuId`, `name`, `options`, upper-bound `price` and `originalPrice` from the lowest-price sample, exact `stock`).
- **Media:** full `images` list, `mainImage`, and `videoUrl` (when present).
- **Exact ratings & embedded reviews:** overall rating score, total review count, 1–5 star rating histogram, and up to 5 SSR-embedded reviews (text, rating, verified purchase flag, author, ISO 8601 date, SKU label, images).
- **Exact seller & shop intelligence:** seller name, store URL, region/location, total sold, followers, shop rating, review count, 48-hour ship rate, and 24-hour response rate (cached per seller within a run).
- **Shipping:** shipping fee, currency, free-shipping flag, origin/from indicator, and estimated lead time (computed for the storefront's default domestic destination).
- **Honest error reporting:** delisted products, unsupported URLs, or CAPTCHA failures after retries still emit a record with `inputUrl` echoed and a structured `error: { code, message }` object — and are **never billed**.

***

### Measured Scale & Performance

Benchmarked live on Apify (`1024 MB` memory, `proxyMode: "auto"`, default `maxRetries`, `priceSamples: 3`, `maxConcurrency: 10`, build `1.2.6`):

- **Indonesia (`ID`, 100 live products — two independent runs):** **199 / 200 OK (99.5%)** combined (**99 / 100** with `1` `CAPTCHA_BLOCKED` in `132.7s`; **100 / 100** with `0` errors in `103.9s`) — about **100–130 seconds per 100 products**.
- **Multi-region SEA & US (`MY`, `SG`, `PH`, `VN`, `TH`, `US` — 5 runs across two URL sets):** **277 / 299 active products OK (92.6%)** combined ("active" = rows not flagged `DELISTED`; delisted old links are reported as `DELISTED`, not Actor failures), typically **1–2 minutes for 60–90 URLs**:
  - **60-URL set (10 per region, 3 runs):** **139 / 149 active OK (93.3%)** (`46/50`, `46/49`, `47/50`; `6` `CAPTCHA_BLOCKED`, `4` `ANTI_CRAWLER`; `74–131s` per run). Per-region active success across those three runs: `SG` **27/27**, `PH` **18/18**, `MY` **23/24**, `TH` **23/24**, `VN` **24/27**, `US` **24/29** (`US` is the weakest region).
  - **90-URL set (15 per region, 2 runs):** **138 / 150 active OK (92.0%)** (`70/76`, `68/74`; `5` `CAPTCHA_BLOCKED`, `7` `ANTI_CRAWLER`; `127–130s` per run).
- **4-product multi-region sample (`US`, `ID`, `SG`, `VN`, pure defaults, 3 runs):** **4 / 4 OK** every run in **8–44s**.

***

### Supported Regions

| Region | Code | Storefront Host | Currency |
|---|---|---|---|
| Indonesia | `ID` | `shop-id.tokopedia.com` | `IDR` |
| Malaysia | `MY` | `shop.tiktok.com/my` | `MYR` |
| Singapore | `SG` | `shop.tiktok.com/sg` | `SGD` |
| Philippines | `PH` | `shop.tiktok.com/ph` | `PHP` |
| Vietnam | `VN` | `shop.tiktok.com/vn` | `VND` |
| Thailand | `TH` | `shop.tiktok.com/th` | `THB` |
| United States | `US` | `shop.tiktok.com/us` | `USD` |

Regional product URLs auto-detect their region — `shop-id.tokopedia.com/...` resolves to `ID`, and URLs with a `/<region>/` path segment (`/<region>/pdp/...` or `/<region>/view/product/<id>`) resolve to that region — and all `/view/product/<id>` and `shop.tiktok.com/id/...` routes are rewritten to the working SSR `/pdp/` route. Region-less URLs such as `www.tiktok.com/view/product/<id>` read an optional `?region=<CODE>` query parameter if present and otherwise fall back to the `region` input (default: `ID`), as do bare product IDs and `shop_id:product_id` pairs.

***

### Limitations (Read Before Running)

- **Anonymous price markup:** As explained in [About prices (read this)](#about-prices-read-this), anonymous storefront pages include a randomized ~0–20 % markup on all price fields, and logged-in account vouchers or member-only flash-sale prices are not accessible without login. Reported prices are upper bounds taken from the lowest of `priceSamples` direct fetches (or `1` sample when fetched via residential proxy).
- **No keyword search or category crawling:** This Actor scrapes specific product URLs/IDs (and optional `sellerIds`). TikTok Shop's search and shop-catalog pagination APIs are gated behind anti-bot signing (`X-Bogus`/`oec_whale`).
- **Up to 5 embedded reviews per product:** Only the top 5 reviews and the 1–5 star histogram embedded in SSR HTML are returned. Full paginated review histories are not accessible over plain HTTP.
- **Shipping estimates use a default domestic destination:** `shipping.fee` and `shipping.leadTime` are computed by TikTok Shop for a fixed default domestic destination (independent of requester IP location) and may differ from buyer-specific checkout shipping quotes.
- **CAPTCHA retries may slow batches:** `shop.tiktok.com` (MY/SG/PH/VN/TH/US) frequently serves `oec_whale` Security Check challenges on datacenter IPs, and `shop-id.tokopedia.com` (`ID`) can also challenge datacenter IPs intermittently. In `auto` mode (recommended), `ID` and `US` run direct-first with fallback to regional Apify Residential Proxies (`ID` tries direct twice before falling back; `US` tries direct once), while SEA regions (`MY`/`SG`/`PH`/`VN`/`TH`) start directly on regional Apify Residential Proxies with a sticky healthy session pool, per-region proxy concurrency capped at `4`, and automatic rotation on challenge (`5` retries by default for `ID`, `8` for all other regions). `US` currently has the highest anti-bot failure rate among supported regions (`24/29` active OK across three 60-URL runs). Proxy successes are never resampled (`price.sampleCount: 1`).
- **Non-uniform `seller.url` host format:** Depending on the upstream SSR / `store_info` response, `seller.url` for TikTok Shop stores may come back as either `https://shop.tiktok.com/<region>/store/<slug>/<id>` or `https://www.tiktok.com/shop/store/<slug>/<id>` (Indonesia stores typically return `https://shop-id.tokopedia.com/store/<slug>/<id>`). Key and deduplicate sellers on `seller.id` rather than the `seller.url` string.

***

### Large Batches

- **Throughput & timeout:** Default run timeout is **3,600 seconds (1 hour)** at `1024 MB` memory. Estimated from the measured `100–130s` per 100 `ID` products (default `priceSamples: 3`, `maxConcurrency: 10`), a single 1-hour run handles roughly **2,700–3,600 Indonesian products** (~2,700–3,600 products/hour). For multi-region SEA/US batches (typically **1–2 minutes for 60–90 URLs** at `maxConcurrency: 10`), a single 1-hour run handles roughly **1,300–2,000 OK products** depending on region mix and CAPTCHA retry volume.
- **Concurrency:** Keep the default **`maxConcurrency: 10`** for both Indonesia (`ID`, direct-first with fallback to `ID` residential proxy) and multi-region SEA/US batches. Per-region residential proxy concurrency is already capped at **`4`** internally, so `10` allows multiple regions to run in parallel without overloading any single region's proxy pool.
- **Handling `CAPTCHA_BLOCKED` / `ANTI_CRAWLER` rows:** Every failed item is written to the Dataset with its original `inputUrl` and `error.code` (`CAPTCHA_BLOCKED` or `ANTI_CRAWLER`) and is **not billed**. After a large multi-region run, filter dataset items where `error.code` is `CAPTCHA_BLOCKED` or `ANTI_CRAWLER` and submit just those `inputUrl` values in a follow-up run (optionally with `maxRetries: 10` or `proxyMode: "always"`).

***

### Pricing

**$1.25 per 1,000 successfully scraped products** ($0.00125 per product). No start fee, no monthly fee — you only pay for products that come back with data.

| Products | Approx. cost |
|---|---|
| 100 | $0.13 |
| 1,000 | $1.25 |
| 10,000 | $12.50 |

Platform usage (compute, proxy retries, storage) is included in the event price.

Only **successfully parsed products** trigger a single `product` billing event — regardless of `priceSamples`. Error rows (delisted products, invalid URLs, CAPTCHA failures), retry attempts, extra price samples, and seller intelligence lookups are never charged.

***

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `productUrlsOrIds` | `string[]` | *(required)* | Product URLs (`/pdp/<slug>/<id>`, `/pdp/x/<id>`, `/pdp/<id>`, `shop.tiktok.com/<region>/pdp/...`, `www.tiktok.com/view/product/<id>`), bare numeric IDs, or `shop_id:product_id` pairs. |
| `region` | `string` | `"ID"` | Default region (`ID`, `MY`, `SG`, `PH`, `VN`, `TH`, `US`) used only for bare IDs or region-less URLs. |
| `priceSamples` | `integer` | `3` | Number of direct fetches per product (`1`–`5`) used to reduce TikTok Shop's randomized anonymous price markup. Keeps all price fields from the payload with the lowest observed sale price. Only runs on direct (non-proxy) successes so residential proxy cost never increases. |
| `sellerIds` | `string[]` | `[]` | Optional extra seller IDs to look up via live Shop Intelligence (saved to the `SHOP_INTELLIGENCE` Key-Value Store record; not billed). Routed through a regional residential proxy in `region` when `proxyMode` is `auto` or `always` so `sold` and `followers` are not geo-masked. |
| `includeEmbeddedReviews` | `boolean` | `true` | Include the top 5 embedded reviews and the 1–5 star rating histogram. |
| `includeShopIntelligence` | `boolean` | `true` | Enrich each product's `seller` object with live `store_info` metrics (cached per seller within a run). |
| `proxyMode` | `string` | `"auto"` | `auto` (direct first for `ID`/`US` with residential retry on Security Check; regional residential proxy from attempt 1 with healthy session reuse for `MY`/`SG`/`PH`/`VN`/`TH`), `always` (residential proxy from attempt 1 for all regions), or `never` (direct datacenter IP only). Ignored if `proxyConfiguration` is enabled. |
| `maxItems` | `integer` | `100` | Hard cap on how many entries from `productUrlsOrIds` to process. |
| `maxConcurrency` | `integer` | `10` | Maximum concurrent product fetches (`1`–`10`). Default `10` works for both Indonesia and multi-region batches; per-region residential proxy concurrency is capped at `4` internally. |
| `maxRetries` | `integer` | *(auto: `5` ID / `8` other)* | Maximum retries per product on Security Check or transient HTTP/network errors (`0`–`10`). Leave empty for region-adaptive defaults (`5` for `ID`, `8` for `MY`/`SG`/`PH`/`VN`/`TH`/`US`), reusing proven-clean regional proxy sessions and rotating immediately on challenge with backoff. |
| `requestDelayMs` | `integer` | `0` | Optional per-worker base delay in milliseconds (randomised ±50%). |
| `includeRaw` | `boolean` | `false` | Include the raw parsed `product_info` JSON object under `raw` (or `component_data` on BFF error rows). |
| `proxyConfiguration` | `object` | *(optional)* | Standard Apify Proxy Configuration. When enabled (`useApifyProxy: true` or custom `proxyUrls`), overrides `proxyMode`. |

#### Example Input

Running this 4-product sample (`US`, `ID`, `SG`, `VN`) on default settings returned **4/4 OK** across 3 runs in **8–44 seconds**:

```json
{
  "productUrlsOrIds": [
    "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
    "https://shop-id.tokopedia.com/pdp/kotak-penyimpanan-serbaguna-angola-e77-desain-transparan-multifungsi/1729733406224975400",
    "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
    "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595"
  ],
  "region": "ID",
  "priceSamples": 3,
  "includeEmbeddedReviews": true,
  "includeShopIntelligence": true,
  "proxyMode": "auto",
  "maxItems": 100,
  "maxConcurrency": 10
}
```

***

### Output Schema

Each item in the default Dataset represents one requested product input:

| Field | Type | Description |
|---|---|---|
| `inputUrl` | `string` | Exact input string echoed back for traceability. |
| `url` | `string \| null` | Canonical product URL returned by the storefront. |
| `productId` | `string \| null` | Numeric TikTok Shop product ID. |
| `shopId` | `string \| null` | Numeric seller / shop ID. |
| `region` | `string \| null` | Two-letter storefront region (`ID`, `MY`, `SG`, `PH`, `VN`, `TH`, `US`). |
| `currency` | `string \| null` | ISO 4217 currency code (`IDR`, `MYR`, `SGD`, `PHP`, `VND`, `THB`, `USD`). |
| `title` | `string \| null` | Full product title. |
| `description` | `string \| null` | Plain-text product description assembled from description blocks. |
| `brand` | `string \| null` | Brand name from product attributes/specifications if listed. |
| `category` | `Array<{id, name}>` | Ordered category breadcrumb path from root to leaf. |
| `price` | `object` | `{ current, original, min, max, discountPercent, sampleCount, lowestObserved, highestObserved, isEstimated, maxOverstatementPct }`. `current` is the lowest observed sale price across samples (upper bound on the real price); `original`/`min`/`max` come from that same payload; `discountPercent` is exact; `sampleCount` is the number of successful samples; `lowestObserved` and `highestObserved` are the min/max sale prices seen; `isEstimated` is `false` only when 2+ samples agreed identically; `maxOverstatementPct` is `(highestObserved - lowestObserved) / lowestObserved * 100` rounded to 1 decimal. |
| `inStock` | `boolean \| null` | Exact availability flag (`true` if at least one active SKU has stock > 0). |
| `stockTotal` | `integer \| null` | Exact sum of stock across all SKUs when exposed. |
| `soldCount` | `integer \| null` | Exact total units sold reported by the storefront. |
| `variants` | `Array<object>` | Per-SKU list: `{ skuId, name, options, price, originalPrice, stock }`. `price` and `originalPrice` come from the same lowest-sale-price payload as `price.current`; `stock` is exact. |
| `images` | `string[]` | All product gallery image URLs. |
| `mainImage` | `string \| null` | Primary product image URL (`images[0]`). |
| `videoUrl` | `string \| null` | Product header or description video URL if present. |
| `rating` | `object` | Exact rating summary: `{ score, count, histogram }` where `histogram` maps `"1"`–`"5"` to counts. |
| `reviews` | `Array<object>` | Up to 5 embedded reviews: `{ id, rating, text, author, date, verified, skuText, images }`. |
| `seller` | `object` | Exact seller metadata & shop intelligence: `{ id, name, url, location, sold, followers, rating, ratingCount, shipWithin48hRate, responseWithin24hRate }`. |
| `shipping` | `object` | `{ fee, currency, freeShipping, from, leadTime }` — computed for the storefront's default domestic destination (invariant to requester IP). |
| `scrapedAt` | `string` | UTC ISO 8601 scrape timestamp. |
| `error` | `object \| null` | `null` on success, or `{ code, message }` (e.g. `DELISTED`, `CAPTCHA_BLOCKED`, `UNSUPPORTED_URL`, `UNSUPPORTED_REGION`, `HTTP_404`). |
| `raw` | `object` *(optional)* | Only present when `includeRaw: true`. Holds the raw `product_info` JSON node on successful records, or the raw `component_data` node on BFF error rows (e.g. `DELISTED`, `ANTI_CRAWLER`, `BFF_ERROR_*`, `PRODUCT_NOT_FOUND`); omitted on parse, HTTP/CAPTCHA, and input validation errors. |

#### Example Output Record

Real record produced by Run `acGkdjSThVxLcnjxE` on Apify (`priceSamples: 3`):

```json
{
  "inputUrl": "1729733406224975400",
  "url": "https://shop-id.tokopedia.com/pdp/x/1729733406224975400",
  "productId": "1729733406224975400",
  "shopId": "7494064357066507816",
  "region": "ID",
  "currency": "IDR",
  "title": "ANGOLA Kotak Penyimpanan Serbaguna Tempel E77 Tempat Penyimpanan Brush/Skincare/Kapas Multifungsi Plastik/ Rak Tempel / Rak Gantung",
  "description": "Kotak penyimpanan serbaguna E77 adalah tempat penyimpanan berbentuk kotak dengan desain transparan bergelombang, berfungsi untuk membantu Anda mengorganisir skincare, make up brush, make up, kapas, sikat gigi, dll...",
  "brand": "LOGO KUCING",
  "category": [
    { "id": "600001", "name": "Perlengkapan Rumah Tangga" },
    { "id": "851848", "name": "Rak & Penyimpanan" },
    { "id": "853000", "name": "Botol & Stoples Penyimpanan" }
  ],
  "price": {
    "current": 10028,
    "original": 16733,
    "min": 10028,
    "max": 20057,
    "discountPercent": 40.1,
    "sampleCount": 3,
    "lowestObserved": 10028,
    "highestObserved": 10515,
    "isEstimated": true,
    "maxOverstatementPct": 4.9
  },
  "inStock": true,
  "stockTotal": 6645,
  "soldCount": 117999,
  "variants": [
    {
      "skuId": "1729733410664252968",
      "name": "Transparan",
      "options": { "Warna": "Transparan" },
      "price": 10028,
      "originalPrice": 16733,
      "stock": 4430
    },
    {
      "skuId": "1732612688000550440",
      "name": "Isi 2 Transparan",
      "options": { "Warna": "Isi 2 Transparan" },
      "price": 20057,
      "originalPrice": 33466,
      "stock": 2215
    }
  ],
  "images": [
    "https://p16-oec-va.ibyteimg.com/tos-maliva-i-o3syd03w52-us/78100db73d574ff89c9276162c278063~tplv-o3syd03w52-resize-webp:800:800.webp"
  ],
  "mainImage": "https://p16-oec-va.ibyteimg.com/tos-maliva-i-o3syd03w52-us/78100db73d574ff89c9276162c278063~tplv-o3syd03w52-resize-webp:800:800.webp",
  "videoUrl": "https://v16m.tiktokcdn.com/...",
  "rating": {
    "score": 4.9,
    "count": 7602,
    "histogram": { "1": 46, "2": 15, "3": 83, "4": 636, "5": 6822 }
  },
  "reviews": [
    {
      "id": "7658634597617534740",
      "rating": 5,
      "text": "Bgus bnget,ccok untuk simpan lipstik biar ga berantakan",
      "author": "@**🌷",
      "date": "2026-07-04T11:33:43.818000+00:00",
      "verified": true,
      "skuText": "Transparan",
      "images": [
        "https://p16-oec-sg.ibyteimg.com/tos-alisg-i-aphluv4xwc-sg/4870ad2829e8459f862d74d1d8104ac4~tplv-aphluv4xwc-crop-webp:300:300.webp"
      ]
    }
  ],
  "seller": {
    "id": "7494064357066507816",
    "name": "Angola Indonesia",
    "url": "https://shop-id.tokopedia.com/store/angola-indonesia/7494064357066507816",
    "location": "ID",
    "sold": 5460009,
    "followers": 423391,
    "rating": 5,
    "ratingCount": 688650,
    "shipWithin48hRate": 91.94,
    "responseWithin24hRate": 100
  },
  "shipping": {
    "fee": 9500,
    "currency": "IDR",
    "freeShipping": false,
    "from": "local",
    "leadTime": "Nov 25 - Nov 28"
  },
  "scrapedAt": "2026-11-24T07:36:39.693917+00:00",
  "error": null
}
```

***

### Quick Start

#### 1. Apify Console

1. Open **TikTok Shop Product Detail Scraper — US & Southeast Asia** in Apify Console.
2. Paste one or more product URLs or numeric product IDs into **Product URLs or IDs**.
3. Pick the default **Region** (for bare IDs), keep **Price Samples** at `3` (or raise to `5` for a tighter upper bound), and keep **Proxy Mode** set to `auto`.
4. Click **Start** and download your results as JSON, CSV, or Excel from the **Dataset** tab. (The default 4-product sample across `US`, `ID`, `SG`, and `VN` finished **4/4 OK** in **8–44 seconds** across 3 test runs.)

#### 2. Apify REST API (`curl`)

```bash
curl -X POST "https://api.apify.com/v2/acts/rainfetch~tiktok-shop-product-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "productUrlsOrIds": [
      "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
      "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250"
    ],
    "region": "ID",
    "priceSamples": 3,
    "proxyMode": "auto"
  }'
```

#### 3. Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "productUrlsOrIds": [
        "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
        "https://shop-id.tokopedia.com/pdp/kotak-penyimpanan-serbaguna-angola-e77-desain-transparan-multifungsi/1729733406224975400",
        "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
        "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595",
    ],
    "region": "ID",
    "priceSamples": 3,
    "includeEmbeddedReviews": True,
    "includeShopIntelligence": True,
    "proxyMode": "auto",
}

run = client.actor("rainfetch/tiktok-shop-product-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["error"]:
        print("Error:", item["inputUrl"], item["error"])
    else:
        p = item["price"]
        print(item["productId"], item["title"], item["currency"], p["current"], f"(samples={p['sampleCount']}, est={p['isEstimated']})")
```

# Actor input Schema

## `productUrlsOrIds` (type: `array`):

List of TikTok Shop / Tokopedia Shop product URLs (e.g. https://shop-id.tokopedia.com/pdp/<slug>/<id>, https://shop.tiktok.com/<region>/pdp/<slug>/<id>, https://shop.tiktok.com/<region>/view/product/<id>, or region-less https://www.tiktok.com/view/product/<id> which uses ?region=<CODE> or the Region input), bare numeric product IDs, or shop_id:product_id pairs.

## `region` (type: `string`):

Storefront region used when a bare product ID (or URL without a region segment) is provided. Full regional URLs auto-detect their region.

## `sellerIds` (type: `array`):

Optional list of numeric TikTok Shop seller IDs to look up via the Shop Intelligence API (sold count, followers, rating, SLA rates). Results are stored in the SHOP_INTELLIGENCE Key-Value Store record (not billed as products).

## `includeEmbeddedReviews` (type: `boolean`):

Include the top 5 SSR-embedded product reviews and the 1-5 star rating histogram on each product record.

## `includeShopIntelligence` (type: `boolean`):

Enrich each product's seller object with live store_info metrics (total sold, followers, rating count, 48h shipping rate, 24h response rate). Cached per seller within a run.

## `proxyMode` (type: `string`):

Controls proxy usage when no custom Proxy Configuration is supplied. 'auto' uses direct requests first for ID and US (retrying via regional Apify Residential Proxy on Security Check) and goes straight to regional Residential Proxy with healthy session reuse for SEA storefronts (MY, SG, PH, VN, TH); 'always' uses Residential Proxy from the first attempt for all regions; 'never' disables proxies.

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

Maximum number of product inputs to process from productUrlsOrIds. The Actor stops at this limit and never fetches more than requested.

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent product requests (1-10). Default 10 is optimal for Indonesia; use 5 for heavy multi-region SEA/US batches.

## `maxRetries` (type: `integer`):

Maximum retry attempts per product on Security Check CAPTCHAs or transient HTTP/network errors. Failed proxy sessions are discarded and rotated to a fresh residential IP/cookie jar while proven-clean regional sessions are reused. Leave empty for region-adaptive defaults: 5 for Indonesia (ID), 8 for other regions (MY, SG, PH, VN, TH, US).

## `requestDelayMs` (type: `integer`):

Base delay in milliseconds between requests per worker (randomised by +/-50%). Set to 0 for maximum speed.

## `priceSamples` (type: `integer`):

Number of direct fetches per product (1-5, default 3) used to reduce TikTok Shop's randomized anonymous price markup. The Actor returns the lowest observed sale price across samples (an upper bound on the real price). Only direct (non-proxy) successes are resampled so residential proxy usage does not increase.

## `includeRaw` (type: `boolean`):

Attach the raw parsed `product_info` JSON node from **MODERN_ROUTER_DATA** under the `raw` key for debugging or custom fields.

## `proxyConfiguration` (type: `object`):

Optional standard Apify Proxy Configuration. If enabled (useApifyProxy: true or custom proxyUrls), this configuration is used and `proxyMode` is ignored.

## Actor input object example

```json
{
  "productUrlsOrIds": [
    "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
    "https://shop-id.tokopedia.com/pdp/kotak-penyimpanan-serbaguna-angola-e77-desain-transparan-multifungsi/1729733406224975400",
    "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
    "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595"
  ],
  "region": "ID",
  "sellerIds": [
    "7494064357066507816"
  ],
  "includeEmbeddedReviews": true,
  "includeShopIntelligence": true,
  "proxyMode": "auto",
  "maxItems": 100,
  "maxConcurrency": 10,
  "requestDelayMs": 0,
  "priceSamples": 3,
  "includeRaw": false
}
```

# Actor output Schema

## `results` (type: `string`):

All rows of the default dataset: successful product records and labelled error rows. The structure of each row is defined by the dataset schema.

# 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 = {
    "productUrlsOrIds": [
        "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
        "https://shop.tiktok.com/id/view/product/1729425629348006083",
        "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
        "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rainfetch/tiktok-shop-product-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 = { "productUrlsOrIds": [
        "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
        "https://shop.tiktok.com/id/view/product/1729425629348006083",
        "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
        "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rainfetch/tiktok-shop-product-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 '{
  "productUrlsOrIds": [
    "https://shop.tiktok.com/us/pdp/yonifu-4mm-tungsten-wedding-band-green-opal-inlay-hypoallergenic/1732131340301799679",
    "https://shop.tiktok.com/id/view/product/1729425629348006083",
    "https://shop.tiktok.com/sg/pdp/wulong-extrait-de-parfum-by-nefertum-mild-fragrance-for-tea-lovers-quality-glass-bottle-kosher-certified/1729654313118041250",
    "https://shop.tiktok.com/vn/pdp/vo-bao-ve-tai-nghe-justicase-cho-airpods-1-4-hoa-tiet-meo/1731173056297142595"
  ]
}' |
apify call rainfetch/tiktok-shop-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rainfetch/tiktok-shop-product-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/Bs2BMiOgE8wmynuQz/builds/7bNAd54gEIdFUGRGW/openapi.json
