Tokopedia product search
Products on Tokopedia (Indonesia) for keywords, with sort, price range, condition and an official-stores filter. Each product: id, name, link, price and label, original price and discount, price range, rating, review count, sold label, category path, labels, image and the shop (id, name, link, city, official and power-merchant flags). total is the site's count. Pass next_page back as page; null on the last page. Also filters by minimum rating, shop_tier (Official Store / Power Merchant) and shop city (city_id).
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
qrequired | string | Keywords, e.g. iphone. Example: iphone |
sort | relevance | newest | price_asc | price_desc | reviews | relevance (default), newest, price_asc, price_desc, reviews. |
price_min | string | Lowest price in rupiah. |
price_max | string | Highest price in rupiah. |
condition | new | used | new or used. |
official | string | true = official stores only. |
page | integer | Page number. Pass next_page from the previous response. |
rating | string | Minimum star rating, 1 to 5 (e.g. 4 for 4 stars and up). |
shop_tier | string | Shop tier, comma-separated for several: official (Official Store), power_merchant (Power Merchant). |
city_id | string | Tokopedia city ids of the shop location, comma-separated (e.g. 174,175,176,177,178,179 for the Jakarta cities). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/tokopedia/v1/search?q=iphone" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/tokopedia/v1/search",
params={"q": "iphone"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/tokopedia/v1/search");
url.searchParams.set("q", "iphone");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).