# Tokopedia Product Search (TikTok Shop Indonesia) (`axery/tokopedia-product-search`) Actor

Scrape Tokopedia product listings - the marketplace behind TikTok Shop Indonesia - with prices parsed from Indonesian formatting into real numbers, plus seller, rating, price-band, city and sort filters.

- **URL**: https://apify.com/axery/tokopedia-product-search.md
- **Developed by:** [Axery](https://apify.com/axery) (community)
- **Categories:** E-commerce, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 result items

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/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 Product Search (TikTok Shop Indonesia)

Scrapes product listings from **tokopedia.com** — the marketplace behind **TikTok Shop Indonesia** since their 2024 merger — over plain HTTP. No browser, no login, no cookies.

### Who it's for

- **Sellers and brands**: monitor competitor prices and best sellers on Tokopedia / TikTok Shop Indonesia.
- **Market researchers**: size a category by price band, city and rating.
- **Dropshippers and resellers**: find products and suppliers by keyword, cheapest first.

### Quick start

```json
{ "keywords": ["sepatu running", "tas ransel"], "sort": "best_selling", "minRating": 4, "maxItems": 200 }
```

Download results as JSON, CSV or Excel, schedule daily runs, or pull them via the API. Turn on `incremental` to get only new products each run.

### Pricing

Pay per event: **$2.00 per 1,000 products** on the Free plan (lower on paid plans), plus $0.005 per run start and Apify platform usage. Apify's free plan includes $5 of monthly credit.

Also see: [Shopee Scraper](https://apify.com/axery/shopee-scraper) for the same research on Shopee.

### What makes this different

**Indonesian prices parsed correctly.** Tokopedia returns price as `"Rp139.000"`, where `.` is the **thousands separator, not a decimal point**. Reading that with English conventions turns 139,000 rupiah into 139 — a 1000× error that would quietly ruin any price analysis. This Actor parses it properly and keeps the original:

```json
"price": {
  "amount": 139000, "currency": "IDR",
  "original_amount": null, "discount_percentage": null,
  "price_range": null, "raw": "Rp139.000"
}
```

**Filters that are verified to work, not guessed.** Price band, minimum star rating, seller city, condition and five sort orders — each tested live. A `minPrice: 5000000` search genuinely returns 5-million-plus listings; `sort: cheapest` genuinely surfaces Rp100 items.

**Clean product URLs.** Tokopedia's own URLs carry `extParam` search-attribution tracking. Both forms are emitted: `url` (clean and shareable) and `url_with_tracking` (exactly as returned).

### How it works

Tokopedia's search page carries no usable product data in its HTML — it hydrates client-side. This Actor calls the same public GraphQL gateway (`gql.tokopedia.com`) the website itself uses, which accepts unauthenticated POSTs and returns typed JSON. That is both the only viable path and the cleaner one.

Three things cost real time to discover and are worth knowing if you fork this:

- **`device=desktop&source=search` are mandatory.** Omit either and the API returns HTTP 200 with `totalData: 0` — a silent empty, not an error.
- **Field selection is strictly validated.** Requesting one field the schema lacks (e.g. `header { keyword }`) fails the *entire* query with "Invalid request schema received", not a partial result.
- **Introspection is disabled server-side**, so field names can't be discovered that way — they were found by testing incrementally.

### Input

| Field | Type | Notes |
|---|---|---|
| `keywords` | array | Product keywords. Indonesian terms return far more results than English. |
| `sort` | enum | Relevance / cheapest / most expensive / newest / best selling. |
| `minPrice`, `maxPrice` | integer | Price band in IDR. |
| `minRating` | integer | 1–5 stars. |
| `cityIds` | string | Comma-separated Tokopedia city ids, e.g. `174` for Jakarta Pusat. |
| `condition` | string | `1` used, `2` new. Blank for both. |
| `maxItems` | integer | Per keyword. |
| `incremental` | boolean | Only products not seen in previous runs. |
| `proxyConfiguration` | object | Datacenter is enough — no IP-reputation gate observed. |

### Known limits

- **No review count.** Tokopedia's `countReview` field exists in the schema but is always `0` — apparently deprecated. It is deliberately not requested rather than shipped as a misleading zero. The live rating *is* available (via `ratingAverage`) and is returned as `rating`.
- **`category` is usually empty.** The field exists in Tokopedia's schema but comes back as an empty string on search results in practice. It is passed through rather than dropped, in case it populates for some product types — but do not rely on it.
- **An empty keyword returns nothing.** This endpoint cannot browse a category without a search term, so `keywords` is required.
- **Depth is finite per keyword.** Rather than expecting unlimited paging from one term, narrow by price band, city or rating to reach a different result set.

# Actor input Schema

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

One or more product keywords. Each runs independently and streams into the same dataset, tagged by `search_keyword`. Indonesian keywords generally return far more results than English ones.

## `sort` (type: `string`):

How Tokopedia orders the results.

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

Only return products at or above this price, in Indonesian rupiah. Verified working - e.g. 5000000 returns genuine 5-million-plus listings.

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

Only return products at or below this price, in Indonesian rupiah.

## `minRating` (type: `integer`):

Only return products rated at least this many stars (1-5).

## `cityIds` (type: `string`):

Comma-separated Tokopedia city ids to restrict sellers by location, e.g. `174` for Jakarta Pusat. Visible in the URL when you filter by city on Tokopedia itself.

## `condition` (type: `string`):

Tokopedia's own condition filter code - `1` for used, `2` for new. Leave blank for both.

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

Maximum products per keyword. Set to `0` for unlimited, which still stops at a safety offset guard - narrow by price band, city or rating to reach a different result set rather than expecting unlimited depth from one keyword.

## `incremental` (type: `boolean`):

Remember product ids between runs and return only products not seen before. You are charged only for the new rows, so a daily price monitor costs a fraction of a full re-scrape after the first run.

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

Apify Proxy settings. Defaults to Residential - e-commerce GraphQL gateways often rate-limit or block Datacenter IP ranges more aggressively than residential ones.

## Actor input object example

```json
{
  "keywords": [
    "laptop",
    "sepatu pria"
  ],
  "sort": "relevance",
  "minPrice": 5000000,
  "maxPrice": 10000000,
  "minRating": 4,
  "cityIds": "174",
  "condition": "2",
  "maxItems": 100,
  "incremental": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per product: name, numeric IDR price, rating, seller with city, and clean product URL.

## `coverage` (type: `string`):

What the run asked for versus what it returned, plus the filters that applied.

# 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 = {
    "keywords": [
        "laptop"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("axery/tokopedia-product-search").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 = {
    "keywords": ["laptop"],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("axery/tokopedia-product-search").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 '{
  "keywords": [
    "laptop"
  ],
  "maxItems": 100
}' |
apify call axery/tokopedia-product-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,axery/tokopedia-product-search"
        }
    }
}
```

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/kVVOWWh4aRrGDRdxY/builds/5eyIBAg1A3fWThlGA/openapi.json
