Tokopedia API endpoint
Returns public product cards from a canonical Tokopedia category path. `path` must begin with `/p/`; use the category page path, not a product or search URL.
/tokopedia/categoryQuery parameters:
path (required): canonical Tokopedia category path starting with /p/, for example /p/handphone-tablet/handphone.Returns public product cards from that category page. Product, search, and arbitrary external URLs are rejected.
| Field | Filled in, of 5 checked | Values in the sample |
|---|---|---|
| name | 5 | “Sony SHAKE-X10D Home Audio Speaker Bluetooth With DVD Shake…” and 4 other values |
| url | 5 | tokopedia.com |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| path | string | Yes | Canonical Tokopedia category path beginning with /p/ | /p/handphone-tablet/handphone | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/tokopedia/category?path=%2Fp%2Fhandphone-tablet%2Fhandphone" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"category_path": "/p/handphone-tablet/handphone",
"products": [
{
"name": "Sepatu Lari",
"price": 1250000,
"price_text": "Rp1.250.000"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/tokopedia.categoryResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | tokopedia.CategoryResponse | No | ||||
| data.category_path | string | No | ||||
| data.fetched_at | string | No | ||||
| data.products | array | No | Product record, 8 fields: image_url, name, price, price_text, rating, shop_city, shop_name, url. Described under Tokopedia home recommendations API. | |||
| data.source_url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/tokopedia/category?path=%2Fp%2Fhandphone-tablet%2Fhandphone" \
-H "x-api-key: $CRAWLORA_API_KEY"