# Tokopedia Search Scraper — Product Data to JSON (`rgamerz/tokopedia-scraper`) Actor

Scrape Tokopedia Indonesia product search results into clean JSON. 30+ fields: price, discount, shop tier, ratings, sold count, category, badges. Multi-page, dedup, filters. PlaywrightCrawler bypasses anti-bot automatically.

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

## Pricing

from $0.70 / 1,000 product scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Search Scraper

Scrape product search results from **Tokopedia** — Indonesia's #1 marketplace — into clean JSON with **30+ fields** per product.

### Why This Actor?

- **30+ output fields** — more data per product than any other Tokopedia scraper
- **Auto anti-bot bypass** — PlaywrightCrawler handles Tokopedia's bot detection automatically
- **Multi-page scraping** — scrape up to 50 pages (~3,000 products per keyword)
- **Deduplication** — automatic duplicate removal across pages
- **Fast & reliable** — intercepts GraphQL API responses, not DOM parsing

### Output Fields

| Field | Description |
|-------|-------------|
| `keyword` | Search keyword used |
| `page` | Page number |
| `position` | Product position in results |
| `productId` | Tokopedia product ID |
| `title` | Product title |
| `price` | Current price (IDR) |
| `priceText` | Formatted price string |
| `originalPrice` | Price before discount |
| `discount` | Discount amount |
| `discountPercent` | Discount percentage |
| `currency` | Currency code (IDR) |
| `imageUrl` | Primary image URL |
| `imageUrls` | Array of all image URLs |
| `url` | Product page URL |
| `shopId` | Shop ID |
| `shopName` | Shop name |
| `shopUrl` | Shop page URL |
| `shopCity` | Shop location |
| `shopTier` | Shop tier level |
| `isOfficialStore` | Official store badge |
| `isPowerMerchant` | Power merchant badge |
| `badgeTitle` | Badge text |
| `badgeUrl` | Badge image URL |
| `rating` | Average rating (0-5) |
| `reviewCount` | Number of reviews |
| `favoriteCount` | Number of favorites/wishlists |
| `soldCount` | Units sold |
| `categoryId` | Category ID |
| `categoryName` | Category name |
| `categoryBreadcrumb` | Full category path |
| `isAd` | Sponsored result flag |
| `isWishlist` | Wishlisted flag |
| `weight` | Product weight in grams (from detail page) |
| `stock` | Available stock quantity |
| `condition` | Product condition (Baru/Bekas) |
| `minOrder` | Minimum order quantity |
| `wholesalePrice` | Wholesale/bulk price |
| `fetchedAt` | Scrape timestamp |

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `searchTerms` | string | ✅ | Search keyword (e.g. "laptop gaming") |
| `keywords` | array | No | **Bulk scrape** multiple keywords. JSON array: `["kw1","kw2","kw3"]` |
| `maxPages` | integer | No | Pages per keyword (1-50, default: 1) |
| `minRating` | number | No | Minimum rating filter (0-5) |
| `sortBy` | select | No | Sort: relevance, newest, price\_high, price\_low, popular, reviews |
| `minPrice` | integer | No | Min price in IDR |
| `maxPrice` | integer | No | Max price in IDR |
| `officialStore` | boolean | No | Official store only |
| `location` | string | No | Seller city filter |

### Sample Output

```json
{
  "keyword": "laptop gaming",
  "page": 1,
  "position": 1,
  "productId": 123456789,
  "title": "Laptop Gaming ASUS ROG Strix G15 RTX 3060",
  "price": 12999000,
  "priceText": "Rp12.999.000",
  "originalPrice": 15999000,
  "discount": 3000000,
  "discountPercent": 19,
  "currency": "IDR",
  "imageUrl": "https://images.tokopedia.net/img/cache/...",
  "url": "https://www.tokopedia.com/shop/product",
  "shopId": "98765432",
  "shopName": "ASUS Official Store",
  "shopCity": "Jakarta",
  "isOfficialStore": true,
  "isPowerMerchant": true,
  "rating": 4.9,
  "reviewCount": 150,
  "soldCount": 500,
  "categoryName": "Laptops",
  "fetchedAt": "2026-09-18T10:00:00.000Z"
}
```

### Pricing

Pay-per-item: **$0.001** per product scraped.

| Tier | Price/Item |
|------|-----------|
| FREE | $0.001 |
| BRONZE | $0.0009 |
| SILVER | $0.0008 |
| GOLD+ | $0.0007 |

### Use Cases

- **Price monitoring** — track price changes over time
- **Market research** — analyze product trends and competition
- **Competitive intelligence** — monitor competitor pricing and stock
- **Data analysis** — build datasets for ML/AI projects
- **Dropshipping** — find suppliers and compare prices

### Limitations

- Tokopedia may rate-limit aggressive scraping. The actor includes random delays.
- Some fields may be null if Tokopedia doesn't return them for certain products.

### Legal

This actor only extracts publicly available listing data from Tokopedia. Use responsibly and comply with Tokopedia's terms of service.

# Actor input Schema

## `searchTerms` (type: `string`):

Keywords to search for on Tokopedia (e.g., 'laptop gaming', 'sepatu nike'). For bulk scraping, use the 'keywords' field instead.

## `keywords` (type: `array`):

Scrape multiple keywords in one run. Provide as JSON array: \["laptop gaming", "laptop murah", "laptop asus"]. When provided, 'searchTerms' is ignored.

## `maxPages` (type: `integer`):

Number of pages to scrape. Each page yields up to ~60 products. Tokopedia typically caps results at ~60 unique products per query, so pages >1 may return duplicates (automatically deduped).

## `sortBy` (type: `string`):

Sort results by a specific field.

## `minPrice` (type: `integer`):

Filter products with price above this value. Leave 0 for no filter.

## `maxPrice` (type: `integer`):

Filter products with price below this value. Leave 0 for no filter.

## `minRating` (type: `string`):

Only return products with this rating or higher. 0 = any rating.

## `officialStore` (type: `boolean`):

Only return products from official/brand stores.

## `location` (type: `string`):

Filter by seller city (e.g., 'Jakarta', 'Surabaya'). Leave empty for all.

## Actor input object example

```json
{
  "searchTerms": "laptop gaming",
  "keywords": [],
  "maxPages": 1,
  "sortBy": "relevance",
  "minPrice": 0,
  "maxPrice": 0,
  "minRating": "0",
  "officialStore": false,
  "location": ""
}
```

# Actor output Schema

## `products` (type: `string`):

All scraped Tokopedia products. One dataset item per product, with price, discount, image, and shop fields.

## `summary` (type: `string`):

Search terms used, total products scraped, number of pages processed, and completion time.

# 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 = {
    "searchTerms": "laptop gaming",
    "maxPages": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("rgamerz/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 = {
    "searchTerms": "laptop gaming",
    "maxPages": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("rgamerz/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 '{
  "searchTerms": "laptop gaming",
  "maxPages": 1
}' |
apify call rgamerz/tokopedia-scraper --silent --output-dataset

```

## MCP server setup

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