# TIKI scraper (`dtrungtin/tiki-scraper`)

TIKI Scraper extracts all and any items from any category page on TIKI or by the specific keyword, provided you copy & paste the search URL

- **URL**: https://beta-securitybyobscurity.apify.com/dtrungtin/tiki-scraper.md
- **Developed by:** [Tin](https://beta-securitybyobscurity.apify.com/dtrungtin) (community)
- **Categories:** E-commerce
- **Stats:** 16 total users, 2 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# README

TIKI Scraper extracts all and any items from any category page on TIKI or by the specific keyword, provided you copy\&paste the search URL. Download your data as HTML or Excel table, as well as in JSON, CSV or XML format.

### Cost of usage

Keep in mind that it is much more efficient to run one longer scrape (at least one minute) than a few shorter ones.  because of the startup time. In average, this scraper will cost you around **0.63 USD** per 1000 items. For more details, see the [platform pricing page](https://apify.com/pricing/actors).
If you’re not sure how much CUs you have left on your plan and whether you might need to upgrade, you can always check your limits in the *Settings -> Usage and Billing* tab in  [your Console](https://console.apify.com/). The easiest way to know how many CUs you will need is to *perform a test run.*

### Input Parameters

This actor will need only three settings from you - **a link**, **max pages** and a **proxy**:

- **startUrls** *(required)*: List of [Request objects](https://sdk.apify.com/docs/api/request#docsNav), specifying the search queries/categories you want to scrape. The URL can be any search/category page on TIKI.
- **maxPages** *(optional)*: Max of pages per search/category URL on TIKI.
- **proxyConfig** *(required)*: Specifies the proxy settings used while running the actor. When running this actor on the platform, the proxy setting must always be set on. The default value is  `{ "useApifyProxy": true }`

#### Example

```json
{
  "startUrls": [
    {
      "url": "https://tiki.vn/nha-sach-tiki/c8322"
    },
    {
      "url": "https://tiki.vn/search?q=apple"
    }
  ],
  "maxPages": 10,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "VN"
  }
}
```

### Output

After the TIKI actor finishes the scraping run, it will store the scraped results in a dataset and show them to you as output results. The results can be downloaded in various formats.

#### Output example:

```json
[{
  "id": 262977989,
  "sku": "9650047486657",
  "name": "Kế Toán Vỉa Hè - Thực Hành Báo Cáo Tài Chính Căn Bản Từ Quầy Bán Nước Chanh",
  "url_key": "ke-toan-via-he-thuc-hanh-bao-cao-tai-chinh-can-ban-tu-quay-ban-nuoc-chanh-p262977989",
  "url_path": "ke-toan-via-he-thuc-hanh-bao-cao-tai-chinh-can-ban-tu-quay-ban-nuoc-chanh-p262977989.html?spid=262977990",
  "type": "",
  "author_name": "",
  "book_cover": null,
  "brand_name": "",
  "short_description": "",
  "price": 160550,
  "list_price": 0,
  "badges": [],
  "badges_new": [
    {
      "code": "tikinow",
      "icon": "https://salt.tikicdn.com/ts/tka/a8/31/b6/802e2c99dcce64c67aa2648edb15dd25.png",
      "icon_height": 16,
      "icon_width": 32,
      "placement": "delivery_info",
      "text": "Giao siêu tốc 2h",
      "type": "delivery_info_badge"
    },
    {
      "code": "authentic_brand",
      "icon": "https://salt.tikicdn.com/ts/tka/69/cf/22/1be823299ae34c7ddcd922e73abd4909.png",
      "icon_height": 20,
      "icon_width": 89,
      "placement": "under_product_image",
      "type": "icon_badge"
    },
    {
      "code": "video_icon",
      "icon": "https://salt.tikicdn.com/ts/upload/d5/f3/6f/fdd40db52ff4afe497d0c2240dcfd25b.png",
      "icon_height": 28,
      "icon_width": 28,
      "placement": "bottom_right",
      "type": "icon_badge"
    }
  ],
  "discount": 38450,
  "discount_rate": 19,
  "rating_average": 5,
  "review_count": 248,
  "order_count": 0,
  "favourite_count": 0,
  "thumbnail_url": "https://salt.tikicdn.com/cache/280x280/ts/product/87/08/0e/db4f09b6ee8bc317f097ebcca1933a2d.png",
  "thumbnail_width": 280,
  "thumbnail_height": 280,
  "freegift_items": [],
  "has_ebook": false,
  "inventory_status": "",
  "is_visible": false,
  "productset_id": 242,
  "productset_group_name": "",
  "seller": null,
  "is_flower": false,
  "is_gift_card": false,
  "inventory": null,
  "url_attendant_input_form": "",
  "option_color": [],
  "stock_item": null,
  "salable_type": "",
  "seller_product_id": 262977990,
  "installment_info": null,
  "url_review": "",
  "bundle_deal": false,
  "quantity_sold": {
    "text": "Đã bán 13258",
    "value": 13258
  },
  "tiki_live": null,
  "original_price": 199000,
  "shippable": true,
  "impression_info": [
    {
      "impression_id": "thanos-ljhoNaSJaZvKciRu-WmrQeWWM",
      "metadata": {
        "astra_reward": 0,
        "category": 8322,
        "delivery_zone": "VN039006001",
        "discount_rate": 15,
        "flags": {
          "_v": "filter_revamp"
        },
        "is_ad": 0,
        "is_astra_plus": 0,
        "is_official_store": 0,
        "is_tikinow": 1,
        "is_tikipro": 0,
        "is_trusted_store": 0,
        "mpid": 262977989,
        "params": {
          "_v": "filter_revamp",
          "category": "8322",
          "limit": "40",
          "page": "1",
          "urlKey": "nha-sach-tiki"
        },
        "position": 1,
        "price": 169000,
        "quantity_sold": 13258,
        "rating": 5,
        "request_id": "ljhoNaSJaZvKciRu",
        "spid": 262977990,
        "tiki_verified": 1
      },
      "checksum": ""
    }
  ],
  "advertisement": null,
  "availability": 1,
  "primary_category_path": "1/2/8322/316/846/67904/369",
  "product_reco_score": 0,
  "seller_id": 2953,
  "visible_impression_info": {
    "amplitude": {
      "all_time_quantity_sold": 13258,
      "category_l1_name": "Nhà Sách Tiki",
      "category_l2_name": "Sách tiếng Việt",
      "category_l3_name": "Sách kinh tế",
      "category_l4_name": "Sách tài chính",
      "deboosted_high_price_diff_position": 0,
      "discounted_by_rule_ids": "3301989",
      "earliest_delivery_estimate": 0,
      "is_authentic": 1,
      "is_best_offer_available": false,
      "is_flash_deal": false,
      "is_freeship_xtra": true,
      "is_gift_available": false,
      "is_hero": false,
      "is_high_price_penalty": false,
      "is_imported": false,
      "joined_strategy_rerank": false,
      "layout": "grid_view",
      "master_product_sku": "9472868482700",
      "number_of_reviews": 248,
      "order_route": "same_province",
      "partner_rewards_amount": 0,
      "price": 169000,
      "primary_category_name": "Kế toán",
      "product_rating": 5,
      "search_rank": 0,
      "seller_id": 2953,
      "seller_product_id": 262977990,
      "seller_product_sku": "9650047486657",
      "seller_type": "OFFICIAL_STORE",
      "standard_delivery_estimate": 0,
      "tiki_verified": 1,
      "tikinow_delivery_estimate": 0.21,
      "tikipro_delivery_estimate": 0,
      "variant": false
    }
  },
  "badges_v3": [
    {
      "code": "product_image_badge",
      "image": "https://salt.tikicdn.com/ts/upload/f7/9e/83/ab28365ea395893fe5abac88b5103444.png",
      "placement": "badge_overlay_product_image",
      "type": "image_badge"
    }
  ]
}]
```

Note that the search results may vary if you're executing scraping from different locations. We recommend to use the proxies for the best scraping results from the same location.

### Proxy usage

This actor, as many scrapers in the [retail industry](https://apify.com/industries/ecommerce-and-retail), will require you to use **Proxy servers** to function properly.
We don't recommend running it on a free account for more complicated tasks than getting a sample of results. If you are planning to run this scraper for getting more than a few results, subscribing to the [Apify platform](https://console.apify.com/sign-up) will provide you with access to a large pool of proxies.

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start with.

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

Limit of pages per url to be scraped

## `proxyConfig` (type: `object`):

It's required to use proxies when running on the platform.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://tiki.vn/search?q=apple"
    }
  ],
  "maxPages": 10,
  "proxyConfig": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://tiki.vn/search?q=apple"
        }
    ],
    "maxPages": 10,
    "proxyConfig": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dtrungtin/tiki-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 = {
    "startUrls": [{ "url": "https://tiki.vn/search?q=apple" }],
    "maxPages": 10,
    "proxyConfig": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dtrungtin/tiki-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://tiki.vn/search?q=apple"
    }
  ],
  "maxPages": 10,
  "proxyConfig": {
    "useApifyProxy": true
  }
}' |
apify call dtrungtin/tiki-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dtrungtin/tiki-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TIKI scraper",
        "description": "TIKI Scraper extracts all and any items from any category page on TIKI or by the specific keyword, provided you copy & paste the search URL",
        "version": "0.0",
        "x-build-id": "R705U7uQR90D1qEBz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dtrungtin~tiki-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dtrungtin-tiki-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dtrungtin~tiki-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dtrungtin-tiki-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dtrungtin~tiki-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dtrungtin-tiki-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "URLs to start with.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxPages": {
                        "title": "Max pages",
                        "type": "integer",
                        "description": "Limit of pages per url to be scraped",
                        "default": 10
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "It's required to use proxies when running on the platform.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
