# 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:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 product details

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tokopedia Scraper",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "73obbOu1bWMcP4EpL"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~tokopedia-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-tokopedia-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/khadinakbar~tokopedia-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-tokopedia-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/khadinakbar~tokopedia-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-tokopedia-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Tokopedia URLs",
                        "type": "array",
                        "description": "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.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "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.",
                        "default": 100
                    },
                    "maxPagesPerList": {
                        "title": "Max pages per listing URL",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "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.",
                        "default": 5
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "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.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
