# Tokopedia Scraper (`khadinakbar/tokopedia-scraper`) Actor

Scrape Tokopedia product detail, category listings, and shop catalogs by URL — price, rating, reviews, stock, shop, image. HTTP-only via Chrome-TLS impersonation, no login. MCP-ready.

- **URL**: https://apify.com/khadinakbar/tokopedia-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** E-commerce, MCP servers, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 product details

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

## Tokopedia Scraper

Scrape **Tokopedia** — Indonesia's largest marketplace — for product detail, category listings, and shop catalogs. Paste any Tokopedia product, category, or shop URL and get clean, structured JSON: price, rating, reviews, stock, seller, image, and more. HTTP-only (no browser), no login, no cookies. Built for analysts, sellers, and AI agents.

### What it does

Give the actor one or more Tokopedia URLs. It auto-detects the page type and returns one flat record per product:

| URL you paste | Mode | What you get |
|---|---|---|
| `https://www.tokopedia.com/{shop}/{product-slug}` | **Product detail** | Name, price, slash/original price, discount, rating score, total ratings, per-star breakdown, description, image, shop |
| `https://www.tokopedia.com/p/handphone-tablet/handphone` | **Category listing** | Up to ~80 product cards per page (auto-paginated): name, price, rating, reviews, stock, badges, image, shop |
| `https://www.tokopedia.com/{shop}` or `.../{shop}/product` | **Shop catalog** | The shop's products (auto-paginated): name, price, rating, reviews, image |

### When to use it

- **Price & competitor monitoring** — track competitor SKUs, prices, and stock on Tokopedia.
- **Catalog research** — pull an entire category or a competitor's shop catalog.
- **Market research** — rating, review counts, and badges across a category.
- **AI agents** — a single URL in, structured JSON out. MCP-ready.

> **Not for free-text keyword search.** Tokopedia loads `/search?q=...` results from a bot-protected internal API that this HTTP-only actor cannot reach. Browse by **category** (`/p/...`) or **shop** instead — those pages are server-rendered and fully scrapable. Passing a `/search?q=` URL is skipped with a clear message.

### Output sample

```json
{
  "type": "listing",
  "productId": "102798088938",
  "name": "OPPO RENO 15 5G (8/256 GB, 12/256 GB) Garansi Resmi",
  "url": "https://www.tokopedia.com/cellsius/oppo-reno-15-5g-8-256-gb-12-256-gb-garansi-resmi-1733884686684424021",
  "price": "Rp9.299.000",
  "priceInt": 9299000,
  "rating": 5,
  "reviewCount": 1,
  "stock": 30,
  "categoryBreadcrumbs": "Handphone & Tablet/Handphone/Android OS",
  "badges": ["Mall"],
  "imageUrl": "https://images.tokopedia.net/...",
  "shopName": "cellsius",
  "shopUrl": "https://www.tokopedia.com/cellsius",
  "sourceUrl": "https://www.tokopedia.com/p/handphone-tablet/handphone",
  "scrapedAt": "2026-06-21T00:00:00.000Z"
}
```

Product-detail records add `slashPrice`, `discountPercentage`, `ratingScore`, `ratingCount`, `ratingBreakdown`, and `description`.

### Pricing

This actor is **pay-per-event**. You are billed only for what you get:

| Event | Price | When |
|---|---|---|
| Actor start | $0.00005 | Once per run (scaled by memory) |
| Listing product | **$0.003** | Each product from a category or shop page |
| Product detail | **$0.005** | Each product from a product-detail (PDP) URL |

A 100-product category pull costs about **$0.30**. The actor enforces your `maxResults` cap and stops charging once it's reached. Pay-Per-Usage (compute + proxy) is also available for very large jobs.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array of strings | — (required) | Tokopedia product, category (`/p/...`), or shop URLs |
| `maxResults` | integer | 100 | Hard cap on products returned across all URLs |
| `maxPagesPerList` | integer | 5 | Pagination depth per category/shop URL (~80 products/page) |
| `proxyConfiguration` | object | Apify datacenter | Proxy; default is sufficient |

#### Example input

```json
{
  "startUrls": [
    "https://www.tokopedia.com/p/handphone-tablet/handphone",
    "https://www.tokopedia.com/cuan-gadgetid/product"
  ],
  "maxResults": 200,
  "maxPagesPerList": 5
}
```

### How it works

Tokopedia protects its edge with TLS/HTTP-2 fingerprinting that blocks ordinary HTTP clients. This actor uses **impit** Chrome-TLS impersonation to pass that block from a plain datacenter proxy — no headless browser, no residential IPs required — then parses the product data Tokopedia embeds in each server-rendered page (its Apollo `window.__cache`). That keeps runs fast and cheap while staying reliable.

The actor is resilient by design: it auto-paginates listings, de-duplicates products across pages so you are never charged twice for the same item, retries on transient blocks with a fresh session, fails honestly (a fully blocked run is reported as failed, not a silent empty success), and prints an up-front cost cap.

### Use with AI agents (MCP)

This actor is MCP-ready and exposed through the Apify MCP server as `apify--tokopedia-scraper`. Agents pass a Tokopedia URL and receive flat, token-efficient JSON. Input descriptions are written for routing ("use this when…"), and errors return actionable guidance.

### FAQ

**Can it search by keyword?** No — Tokopedia serves `/search?q=` from a bot-protected API. Use category (`/p/...`) or shop URLs, which are server-rendered.

**Do I need an Indonesia proxy?** No. The default Apify datacenter proxy works; the Chrome-TLS impersonation does the heavy lifting.

**Does it need login or cookies?** No. It only reads public, server-rendered pages.

**What if a product was removed?** Dead/removed URLs are skipped with a warning; the run still succeeds for the rest.

**How many products per listing page?** About 80. Increase `maxPagesPerList` to go deeper.

### Legal & ethical use

This actor collects only publicly available data from Tokopedia pages. You are responsible for complying with Tokopedia's Terms of Service, applicable laws (including Indonesian data-protection law), and for not collecting personal data without a lawful basis. Use the data for legitimate purposes such as price monitoring and market research. This actor is not affiliated with, endorsed by, or sponsored by Tokopedia.

### Support

Found a bug or want a new field? Open an issue on the actor's Issues tab.

# Actor input Schema

## `startUrls` (type: `array`):

Tokopedia URLs to scrape; the mode is auto-detected per URL. Accepts product detail pages (e.g. 'https://www.tokopedia.com/{shop}/{product-slug}'), category pages ('https://www.tokopedia.com/p/handphone-tablet/handphone'), and shop catalog pages ('https://www.tokopedia.com/{shop}' or '.../{shop}/product'). Free-text search result URLs ('/search?q=...') are NOT supported because Tokopedia loads them from a blocked API — browse by category or shop instead.

## `maxResults` (type: `integer`):

Maximum number of products to return across all URLs combined. The actor stops (and stops charging) once this cap is reached. Defaults to 100. Set lower for cheap test runs; raise for large catalog pulls.

## `maxPagesPerList` (type: `integer`):

How many pages to paginate through for each category or shop URL (each page yields up to ~80 products). Defaults to 5. Ignored for product detail URLs, which are always a single page. Raise to go deeper into a category or shop catalog.

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

Proxy used for requests. Defaults to Apify datacenter proxy, which works for normal usage thanks to Chrome-TLS impersonation. For maximum reliability on large or concurrent jobs, select Apify RESIDENTIAL (ideally Indonesia) or supply your own residential proxy URLs — residential exit IPs avoid Tokopedia's occasional edge resets entirely.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.tokopedia.com/p/handphone-tablet/handphone",
    "https://www.tokopedia.com/cuan-gadgetid/product"
  ],
  "maxResults": 100,
  "maxPagesPerList": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

All product records (listing and detail) scraped across the input URLs. Download as JSON, CSV, Excel, HTML, or RSS.

# 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 = {
    "startUrls": [
        "https://www.tokopedia.com/p/handphone-tablet/handphone"
    ],
    "maxResults": 100,
    "maxPagesPerList": 5,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/tokopedia-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 = {
    "startUrls": ["https://www.tokopedia.com/p/handphone-tablet/handphone"],
    "maxResults": 100,
    "maxPagesPerList": 5,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/tokopedia-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.tokopedia.com/p/handphone-tablet/handphone"
  ],
  "maxResults": 100,
  "maxPagesPerList": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call khadinakbar/tokopedia-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/dcoN7sCL3xgwvRhz4/builds/unPbbSzwxa27iNNjp/openapi.json
