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

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://apify.com/dtrungtin/tiki-scraper.md
- **Developed by:** [Tin](https://apify.com/dtrungtin) (community)
- **Categories:** E-commerce
- **Stats:** 24 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

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(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 '{
  "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dtrungtin/tiki-scraper"
        }
    }
}
```

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/3FwRm5uzcCbXaqWgg/builds/ew57sysKWVcOL3PqZ/openapi.json
