# Tokopedia API scraper — Indonesia's #1 e-commerce marketplace: product search with price/condition/rating filters, full product detail (price, discount, stock, variants, specs, images, sold count, rating), store/shop profiles, a shop's product catalog, and paginated product reviews — id locale, IDR prices, no API key required

> Search Tokopedia products by keyword with optional price / condition / rating filters and sort. Returns up to 20 products per page (product_id, name, url, price in IDR, rating, sold count, category, shop) with page-based pagination.
> ReefAPI engine `tokopedia` · 5 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/tokopedia/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /tokopedia/v1/search — 1 credit
Search Tokopedia products by keyword with optional price / condition / rating filters and sort. Returns up to 20 products per page (product_id, name, url, price in IDR, rating, sold count, category, shop) with page-based pagination.

**Parameters:**
- `q` (string, required) — Search keyword — a product, brand or category in Indonesian or English ('laptop gaming', 'iphone 15', 'sepatu nike', 'kopi').
- `page` (integer, optional, default 1) — 1-based page number (20 results per page). Page forward with meta.next_page.
- `sort` (enum, optional, default "23") — Result ordering (Tokopedia 'ob' code). [one of: 23, 5, 3, 4, 8, 9]
- `price_min` (integer, optional) — Minimum price filter in IDR (rupiah, e.g. 100000 = Rp100.000).
- `price_max` (integer, optional) — Maximum price filter in IDR (rupiah).
- `condition` (enum, optional) — Filter by item condition (new = baru, used = bekas). [one of: new, used]
- `rating` (enum, optional) — Minimum product star rating filter. [one of: 4, 5]

**Returns:** products[]{product_id, name, url, image_url, price, price_value, rating, category, sold, labels[], shop{shop_id, name, city, url, is_official}} + meta{total, page, has_more, next_page}

**Example request body:**
```json
{
  "q": "laptop"
}
```

### POST /tokopedia/v1/detail — 1 credit
Full product detail by product_id (or product url): price, slashed/original price, discount, active campaign, stock, min/max order, weight, rating, review/view/talk counts, sold count, full description, spec rows, category breadcrumb, image gallery, variants and the seller shop.

**Parameters:**
- `product_id` (string, optional) — Tokopedia numeric product id (from a search result's product_id). Alternatively pass a full product `url`.
- `url` (string, optional) — Full Tokopedia product URL (tokopedia.com/<shop>/<product-slug>). Use this when you have the link rather than the numeric id.

**Returns:** product{product_id, name, url, condition, price, price_value, original_price, discount_pct, campaign, stock, min_order, max_order, weight, rating, review_count, sold, description, specs[], category_breadcrumb[], images[], variants[], shop{shop_id, name}}

### POST /tokopedia/v1/shop — 1 credit
Store/shop profile by shop domain (the tokopedia.com/<shop> handle): name, description, open-since, follower count, active product count, total products sold, successful transactions, location, avatar and cover.

**Parameters:**
- `shop` (string, required) — Shop/store domain — the handle in tokopedia.com/<shop> (or a full shop URL).

**Returns:** shop{shop_id, name, domain, url, description, open_since, is_open, location, city, total_favorite, active_product_count, product_sold, transaction_success, avatar, cover, status}

**Example request body:**
```json
{
  "shop": "unitechofficial"
}
```

### POST /tokopedia/v1/shop_products — 1 credit
Paginated product catalog of one shop by shop domain. Returns up to 20 products per page (same shape as search) plus the shop's total product count. Page through every product a store sells.

**Parameters:**
- `shop` (string, required) — Shop/store domain — the handle in tokopedia.com/<shop> (or a full shop URL).
- `page` (integer, optional, default 1) — 1-based page number (20 results per page). Page forward with meta.next_page.
- `sort` (enum, optional, default "23") — Result ordering (Tokopedia 'ob' code). [one of: 23, 5, 3, 4, 8, 9]

**Returns:** products[]{product_id, name, url, price, rating, sold, shop{}} + meta{total, page, has_more, next_page}

**Example request body:**
```json
{
  "shop": "unitechofficial"
}
```

### POST /tokopedia/v1/reviews — 1 credit
Paginated public product reviews by product_id (or url): star rating, review text, variant bought, relative date, reviewer handle, photos/videos, likes and the seller's reply. 20 reviews per page — page with `page`; meta.total / meta.has_more tell you how many.

**Parameters:**
- `product_id` (string, optional) — Tokopedia numeric product id (from a search result's product_id). Alternatively pass a full product `url`.
- `url` (string, optional) — Full Tokopedia product URL (tokopedia.com/<shop>/<product-slug>). Use this when you have the link rather than the numeric id.
- `page` (integer, optional, default 1) — 1-based page number (20 results per page). Page forward with meta.next_page.
- `sort_reviews` (enum, optional) — Order reviews (helpfulness or date). [one of: informative_score desc, create_time desc, create_time asc]
- `filter_rating` (enum, optional) — Show only reviews with this star rating. [one of: 5, 4, 3, 2, 1]

**Returns:** reviews[]{review_id, rating, text, variant, date, author, likes, images[], videos[], shop_reply} + meta{total, page, has_more, next_page}

## More
- Try it live, no code: https://reefapi.com/playground?engine=tokopedia
- Human docs page: https://reefapi.com/docs/tokopedia
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
