# Tokopedia Scraper — Produk, Harga, Rating & Jumlah Terjual (`anyoneo/tokopedia-scraper`) Actor

Ambil data produk Tokopedia: harga Rupiah, diskon, rating, jumlah terjual, dan profil toko. Ekspor JSON/CSV/Excel. Untuk riset harga dan pemantauan kompetitor di marketplace terbesar Indonesia. Kolom sudah bersih (harga jadi angka, '3rb+ terjual' jadi 3000).

- **URL**: https://apify.com/anyoneo/tokopedia-scraper.md
- **Developed by:** [Muhammad Riszky Wibowo](https://apify.com/anyoneo) (community)
- **Categories:** E-commerce
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

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

## Tokopedia Scraper — Produk, Harga, Rating & Jumlah Terjual

Ambil data produk dari **Tokopedia**, marketplace terbesar Indonesia. Masukkan kata kunci, dapatkan baris produk siap pakai: harga, harga coret, persen diskon, rating, jumlah terjual, nama toko, kota toko, dan kategori.

**Sudah teruji:** 120 produk dari 2 kata kunci, kelengkapan 100% pada semua kolom harga/rating/terjual/toko/kota. Uji otomatis 7/7 lulus memakai payload nyata.

### Hasil nyata (bukan contoh buatan)

Satu baris dari dataset, apa adanya:

```json
{
  "id": "102459767201",
  "nama": "Sepatu Flash Series Public Low Black Natural Sepatu Sneakers Sekolah Cowok Cewek",
  "harga": 27400,
  "harga_teks": "Rp27.400",
  "harga_asli": 150000,
  "diskon_pct": 82,
  "rating": 4.6,
  "terjual": 10000,
  "toko_nama": "YOKATA.Id",
  "toko_kota": "Kab. Mojokerto",
  "toko_tier": 3,
  "toko_url": "https://www.tokopedia.com/yokataid",
  "kategori": "Fashion Pria",
  "kategori_jalur": "fashion-pria/sepatu-pria/sneakers-pria",
  "iklan": false,
  "url": "https://www.tokopedia.com/yokataid/sepatu-flash-series-...",
  "diambil_pada": "2026-10-12T07:34:37.185Z"
}
```

### Kolom

| Kolom | Isi |
|---|---|
| `id` | ID produk Tokopedia |
| `nama` | Nama produk |
| `harga` / `harga_teks` | Harga dalam Rupiah (**angka bulat** + teks asli) |
| `harga_asli` | Harga sebelum diskon (bila ada) |
| `diskon_pct` | Persentase diskon |
| `rating` | Rating rata-rata (1–5) |
| `terjual` | Jumlah unit terjual (**sudah jadi angka**) |
| `toko_id` / `toko_nama` / `toko_kota` / `toko_tier` / `toko_url` | Identitas penjual |
| `kategori` / `kategori_jalur` | Kategori produk |
| `iklan` | Apakah hasil berbayar |
| `url` / `gambar` | Tautan produk dan gambar utama |
| `diambil_pada` | Waktu pengambilan (ISO 8601) |

Harga sudah berupa angka Rupiah bulat — tidak perlu membersihkan titik ribuan lagi. Kolom `terjual` di situs muncul sebagai label teks (mis. `"3rb+ terjual"`); di sini sudah dinormalkan menjadi angka (`3000`). Ekspor ke **JSON, CSV, atau Excel** langsung dari dataset Apify, atau pakai lewat API.

### Cara pakai

Isi **queries** dengan kata kunci (boleh beberapa sekaligus). Atur **maxItems** sesuai kebutuhan.

```json
{
  "queries": ["sepatu", "kopi arabika"],
  "maxItems": 200
}
```

### Untuk apa

- **Riset harga & pemantauan kompetitor** — pantau perubahan harga dan posisi toko dari waktu ke waktu
- **Kurasi katalog** — kumpulkan nama, gambar, dan kategori produk
- **Analisis pasar** — siapa penjual terbesar di sebuah kategori, kota mana yang dominan
- **Peluang produk** — produk dengan penjualan tinggi tapi sedikit pesaing

### Catatan teknis

Pengambilan dilakukan dengan membuka halaman pencarian lewat peramban sungguhan dan membaca payload JSON internal Tokopedia (`SearchProductV5Query`), lalu memetakannya ke kolom di atas. Pendekatan ini jauh lebih tahan perubahan dibanding membaca markup HTML.

Ada tiga jalur otomatis dengan cadangan berlapis (sadap respons → GraphQL langsung dari konteks halaman → *request context*), karena Tokopedia kadang menolak HTTP/2 dari peramban tanpa kepala.

### Harga

**$0,90 per 1.000 hasil** (pay-per-result), plus biaya mulai Actor yang sangat kecil ($0,00005 per run). Biaya platform sudah termasuk — tidak ada tagihan terpisah dari Apify untuk compute.

Penghitungan biaya: jika Anda mengambil 3.000 produk, biayanya **$2,70**.

### Dukungan

Ada kolom tambahan yang Anda butuhkan, atau situs target berubah perilaku? Kirim pesan lewat tab Issues — perbaikan diutamakan untuk pelanggan berbayar.

# Actor input Schema

## `queries` (type: `array`):

Daftar kata kunci produk yang ingin diambil. Contoh: \["sepatu", "kopi arabika"]. Boleh juga URL kategori Tokopedia.

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

Batas total produk yang diambil pada satu kali jalan. Semakin besar, semakin lama.

## `maxScrolls` (type: `integer`):

Jumlah pengguliran halaman untuk memicu pemuatan produk tambahan.

## Actor input object example

```json
{
  "queries": [
    "sepatu"
  ],
  "maxItems": 100,
  "maxScrolls": 3
}
```

# Actor output Schema

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

No description

## `datasetCsv` (type: `string`):

No description

## `datasetXlsx` (type: `string`):

No description

## `ringkasan` (type: `string`):

No description

# 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 = {
    "queries": [
        "sepatu"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyoneo/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 = { "queries": ["sepatu"] }

# Run the Actor and wait for it to finish
run = client.actor("anyoneo/tokopedia-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 '{
  "queries": [
    "sepatu"
  ]
}' |
apify call anyoneo/tokopedia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,anyoneo/tokopedia-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/2s1jFBrgg5VxSaHES/builds/DoQ3w3VAA9zj3rxie/openapi.json
