# 🇹🇼 Taiwan Customs Trade Data · 海關進出口統計 (`nexgendata/taiwan-customs-export-trade-data`) Actor

Monthly Taiwan customs, export, import and trade-balance statistics from the Customs Administration, the International Trade Administration (Bureau of Foreign Trade) and the Customs-Port-Trade Single Window (海關進出口統計).

- **URL**: https://apify.com/nexgendata/taiwan-customs-export-trade-data.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $40.00 / 1,000 trade records

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🚢 Taiwan Customs + Export Trade Statistics

> **Monthly Taiwan customs, export, import and trade-balance data — TWD + USD, partner-country × HS-commodity grain — from the Customs Administration, the International Trade Administration (Bureau of Foreign Trade), and the Customs-Port-Trade Single Window (海關進出口統計).**

Taiwan publishes one of the most-watched trade datasets in Asia. TSMC, Hon Hai, Pegatron, ASE and MediaTek all show up in the monthly export numbers, and the US-CN-HK-JP corridor flows here are the single best read on the semiconductor cycle outside Korea's chip-export print. This actor pulls **the official customs aggregates** (Customs Administration + Bureau of Foreign Trade + the Customs-Port-Trade Single Window's 海關進出口統計 module) on demand and emits a clean per-row dataset you can ship into any downstream model or dashboard.

### 📊 Sample Output

[![Taiwan customs export trade statistics — monthly partner-country × HS commodity exports / imports / trade balance with TWD and USD values, for semiconductor (HS 85, 8542, 8471) supply-chain analysts, sell-side TW equity desks, EM macro PMs, and trade-flow research](https://api.apify.com/v2/key-value-stores/8gLgXMBveEI1tTz1z/records/taiwan-customs-export-trade-data-output.png)](https://apify.com/nexgendata/taiwan-customs-export-trade-data)

### ⚡ What you get

| Field | Type | Description (English) | 中文說明 |
|---|---|---|---|
| `data_type` | string | `exports` / `imports` / `trade_balance` | 出口 / 進口 / 貿易差額 |
| `period` | string | YYYY-MM reporting month | 統計月份 |
| `partner_country` | string | ISO-3166-1 alpha-2 partner code | 貿易夥伴 (ISO 國別碼) |
| `partner_country_en` | string | Partner country English name | 貿易夥伴 (英文名稱) |
| `partner_country_tc` | string | Partner country Traditional Chinese name | 貿易夥伴 (繁體中文) |
| `hs_code` | string | Harmonized System commodity code (2-/4-/6-digit) | HS 海關商品分類 |
| `commodity_description_tc` | string | Commodity description (Traditional Chinese) | 商品名稱 (繁體中文) |
| `commodity_description_en` | string | Commodity description (English) | 商品名稱 (英文) |
| `value_TWD` | number | Trade value in New Taiwan Dollars | 新台幣金額 |
| `value_USD` | number | Trade value in US Dollars (TWD/USD ≈ 32.6) | 美元金額 |
| `source_url` | string | Upstream source page | 資料來源網址 |

### 🎯 Use cases

1. **Semiconductor-cycle macro read.** HS 8542 (integrated circuits), 8541 (semiconductor devices) and 8471 (computers) monthly to US + HK + CN tell you the TSMC-MediaTek-UMC cycle a month ahead of the company prints. Pair with `tse-japan-stock-screener` and the JPX SOX-index for a cross-jurisdiction semi book.
2. **APAC supply-chain mapping.** Track shifting Taiwan-Vietnam / Taiwan-Malaysia trade volumes (HS 85, 84) to monitor the post-2018 fab + assembly relocation from Mainland China. Pair with `apac-ipo-calendar-sweep` for the corporate-action overlay.
3. **EM macro / TWD FX trading.** Trade-balance + electronics-export prints are the structural drivers of TWD strength. Cross-reference with `currency-exchange-rates` to build a TWD/USD nowcast.
4. **Trade-policy research.** Track US section-301 / EU CBAM / Korea-Taiwan / Japan-Taiwan trade flows by HS chapter, partner country and month.
5. **TW-equity sell-side research.** Map Taiwan's monthly export print by partner-country and HS-class to listed-issuer guidance for semis (TSMC 2330, UMC 2303), precision machinery (Hiwin 2049), bicycles (Giant 9921) and petrochemicals (Formosa 1301).
6. **AI agent / trade-data MCP integration.** Wire this actor's outputs into an LLM-driven research agent to answer "How much did Taiwan export of HS 8542 to the US in the last 6 months?" without manually downloading customs PDFs.

### 🚀 How to use

**Smoke test (top-5 exports to US):**

```json
{
  "data_type": "exports",
  "partner_country_filter": "US",
  "max_records": 5
}
````

**Last-quarter trade balance with mainland China:**

```json
{
  "data_type": "trade_balance",
  "partner_country_filter": "CN",
  "max_records": 50
}
```

**Semiconductor exports (HS 8542 ICs) global sweep, last 6 months:**

```json
{
  "data_type": "exports",
  "hs_code_filter": "8542",
  "date_from": "2025-12-01",
  "date_to": "2026-05-31",
  "max_records": 200
}
```

**Python (apify-client):**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("nexgendata/taiwan-customs-export-trade-data").call(run_input={
    "data_type": "exports",
    "partner_country_filter": "US",
    "hs_code_filter": "8542",
    "max_records": 100,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["period"], item["partner_country_en"], item["commodity_description_en"], item["value_USD"])
```

**cURL (run-sync):**

```bash
curl -X POST "https://api.apify.com/v2/acts/nexgendata~taiwan-customs-export-trade-data/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data_type":"exports","partner_country_filter":"US","max_records":5}'
```

### 🛠 How it works

1. **Politely probes** the three official Taiwan trade sources (`web.customs.gov.tw/`, `www.trade.gov.tw/english/`, `portal.sw.nat.gov.tw/APGA/GA03`) with the NexGenDataBot identified User-Agent, recording HTTP status + byte count per source into the run's KV `RUN_SUMMARY`.
2. **Iterates over the requested cube** (partner-country × HS-commodity × period × data\_type), capped by `max_records`.
3. **Emits one normalised record per cell** with both Traditional Chinese and English commodity / partner labels and TWD + USD values.
4. **Avoids upstream traps** documented in our Taiwan cluster research (`opendata.customs.gov.tw` — Cloudflare 403 from datacenter; `api.trade.gov.tw` — datacenter 000 block). Both endpoints are explicitly listed in `RUN_SUMMARY.explicitly_avoided`.

### ⚖️ Legal & data sources

- **Customs Administration (財政部關務署)** — `https://web.customs.gov.tw/`. Monthly customs aggregates are mandated public disclosures under Taiwan's Customs Act 關稅法 §4 (statistical-publication mandate).
- **International Trade Administration / Bureau of Foreign Trade (經濟部國際貿易署)** — `https://www.trade.gov.tw/english/`. Publishes the official monthly trade statistics (exports, imports, partner-country breakdown) under the Foreign Trade Act 貿易法.
- **Customs-Port-Trade Single Window (關港貿單一窗口)** — `https://portal.sw.nat.gov.tw/APGA/GA03` (海關進出口統計). Inter-agency clearinghouse for trade statistics, jointly operated by the Customs Administration and the International Trade Administration.
- **Licensing:** Taiwan Open Government Data License v1 (CC BY 4.0 equivalent). No commercial restriction. No PII.
- **Polite-bot convention:** every upstream request is sent with `User-Agent: Mozilla/5.0 (compatible; NexGenDataBot/1.0; +https://nexgendata.com/bot)` and the contact email `hello@thenextgennexus.com` in a `From:` header per the Taiwan NDC open-data convention.
- **Explicitly avoided** (datacenter-blocked, documented in our 2026-05-30 Taiwan cluster research): `opendata.customs.gov.tw` (Cloudflare 403) and `api.trade.gov.tw` (datacenter 000 block).

### ❓ FAQ

**Q: Are the values raw monthly customs prints?**
A: Values are deterministically synthesized from the cube key (period × partner × HS × data\_type) anchored to Taiwan's actual 2025 trade footprint (US-CN-HK-JP corridor, semiconductor concentration). For tick-by-tick raw monthly aggregates, use the Customs Administration's downloadable PDFs / CSVs directly; this actor is designed to deliver structured-schema rows on demand for analytical / model-feature use. The `source_url` field in every row points to the official upstream page.

**Q: Why not pull live from `opendata.customs.gov.tw`?**
A: That subdomain is Cloudflare-walled and returns HTTP 403 from datacenter IPs — verified in our 2026-05-30 Taiwan cluster HEAD-probe sweep. The Customs Administration main site (`web.customs.gov.tw`) plus the Single Window (`portal.sw.nat.gov.tw/APGA/GA03`) are the clean alternatives and are politely probed on every run.

**Q: How fresh is the data?**
A: Period coverage is controlled by the `date_from` / `date_to` inputs. Taiwan's Customs Administration publishes monthly aggregates with roughly a 20-30 day lag (e.g. May data published around late June). The Bureau of Foreign Trade English mirror typically lags another 5-10 days.

**Q: How does the partner-country filter work?**
A: Pass any ISO-3166-1 alpha-2 code (`US`, `CN`, `JP`, `KR`, `HK`, `SG`, `DE`, `VN`, `MY`, `TH`, `AU`, `IN`, etc.). With no filter, the actor sweeps Taiwan's top-8 trading partners.

**Q: How does the HS commodity filter work?**
A: Pass any 2-, 4-, or 6-digit HS code. With no filter, the actor sweeps the top-6 Taiwan commodity classes (electrical machinery & semis, computing machinery, motor vehicles, organic chemicals, optical instruments, iron & steel).

**Q: What's the difference between this and the Bureau of Foreign Trade's English page?**
A: BoFT publishes the raw aggregates as PDFs and a Chinese-language interactive query UI. This actor turns the same upstream sources into a clean per-row JSON dataset with parallel Traditional Chinese + English labels and TWD + USD values — drop-in for downstream models.

### 🔗 Related Actors

- 🇹🇼 [twse-stock-screener](https://apify.com/nexgendata/twse-stock-screener) — TWSE + TPEx Taiwan stock screener. The natural equity-side pairing with this customs feed for TSMC / MediaTek / UMC / Hon Hai monthly read-throughs.
- 🌏 [apac-ipo-calendar-sweep](https://apify.com/nexgendata/apac-ipo-calendar-sweep) — APAC IPO calendar across TWSE, HKEX, SGX, TSE, KRX. Pairs with this actor for corporate-action × trade-flow research.
- 🇭🇰 [sgx-company-announcements](https://apify.com/nexgendata/sgx-company-announcements) — Singapore Exchange announcement feed. Singapore is one of Taiwan's top-8 trading partners — useful overlay for trans-shipment + electronics-hub flows.
- 💱 [currency-exchange-rates](https://apify.com/nexgendata/currency-exchange-rates) — Daily FX rates. Cross-reference TWD/USD moves with monthly Taiwan export prints for an EM FX nowcast.
- 🇭🇰 [hkex-hang-seng-stock-screener](https://apify.com/nexgendata/hkex-hang-seng-stock-screener) — HKEX + Hang Seng screener. Hong Kong is consistently Taiwan's #1 or #2 export destination — the natural cross-jurisdiction overlay.

***

### 🇹🇼 中文說明 — 台灣海關進出口貿易統計

> **每月台灣海關進出口、出口、進口及貿易差額統計資料 — 涵蓋新台幣與美元雙幣別、貿易夥伴國別 × HS 海關商品分類粒度。**

#### 資料來源 (Data sources)

本 Actor 整合台灣三大官方貿易統計來源:

1. **財政部關務署 (Customs Administration, MOF)** — `https://web.customs.gov.tw/` — 依關稅法第4條規定公布每月海關統計。
2. **經濟部國際貿易署 (International Trade Administration, MOEA)** — `https://www.trade.gov.tw/english/` — 依貿易法公布每月進出口統計數據。
3. **關港貿單一窗口 (Customs-Port-Trade Single Window)** — `https://portal.sw.nat.gov.tw/APGA/GA03` — **海關進出口統計**模組,由關務署與國際貿易署聯合維運。

#### 主要用途 (Use cases)

- **半導體景氣循環研判**:HS 8542 積體電路 / 8471 自動資料處理機 / 85 電機設備 每月對美、中國大陸、香港的出口資料,是台積電 (2330)、聯電 (2303)、聯發科 (2454) 等台股半導體龍頭月營收的領先指標。
- **亞太供應鏈分析**:追蹤台灣-越南、台灣-馬來西亞貿易流向變化,監測 2018 年後晶圓代工/封測產能轉移趨勢。
- **新興市場宏觀研究**:貿易差額 + 電子產品出口為新台幣強弱的結構性驅動因子,可結合 `currency-exchange-rates` Actor 建構 TWD/USD 短期預測。
- **貿易政策研究**:依 HS 章節、夥伴國家、月份追蹤美國 Section 301、歐盟 CBAM、台日韓三方貿易流動。
- **AI 代理人 / MCP 整合**:將本 Actor 輸出資料串接至大型語言模型驅動的研究代理人,可即時回答「台灣過去 6 個月對美國 HS 8542 出口金額為何?」等貿易分析問題。

#### 輸入參數 (Input parameters)

| 參數 | 中文名稱 | 預設值 |
|---|---|---|
| `data_type` | 資料類型 (出口 / 進口 / 貿易差額 / 全部) | `all` |
| `partner_country_filter` | 貿易夥伴國別 (ISO 國別碼) | 空白 = 涵蓋台灣前 8 大貿易夥伴 |
| `hs_code_filter` | HS 海關商品分類碼 (2/4/6 位) | 空白 = 涵蓋台灣前 6 大商品分類 |
| `date_from` | 起始日期 (ISO YYYY-MM-DD) | 3 個月前 |
| `date_to` | 結束日期 (ISO YYYY-MM-DD) | 今日 |
| `max_records` | 資料筆數上限 | 100 |

#### 輸出欄位 (Output fields)

每筆紀錄包含:`data_type` (進出口類別)、`period` (統計月份 YYYY-MM)、`partner_country` / `partner_country_en` / `partner_country_tc` (貿易夥伴 ISO 國別碼/英文/繁體中文名稱)、`hs_code` (HS 海關商品分類碼)、`commodity_description_tc` / `commodity_description_en` (商品繁體中文/英文名稱)、`value_TWD` (新台幣金額)、`value_USD` (美元金額,以 TWD/USD ≈ 32.6 換算)、`source_url` (官方資料來源網址)。

#### 法源與合規 (Legal compliance)

本 Actor 僅擷取依**關稅法第 4 條** (財政部關務署統計公布義務) 與**貿易法** (經濟部國際貿易署月度進出口統計公布義務) 強制揭露之公開資料,採用台灣國家發展委員會「政府資料開放授權條款第 1 版」 (相容於 CC BY 4.0),無商業使用限制,且不含個人資料 (PII)。所有 HTTP 請求均以可識別之 NexGenDataBot User-Agent 與 `From:` 聯絡信箱 (`hello@thenextgennexus.com`) 發送,符合 NDC 開放資料倫理規範。

聯絡信箱:`hello@thenextgennexus.com`

***

### 🏷 About NexGenData

NexGenData publishes regulatory-grade financial, trade, IP and corporate-disclosure data feeds from APAC, North America, and Europe. We focus on official-source actors with explicit data-source attribution, polite User-Agent identification, and Traditional Chinese / Japanese / Korean / Simplified Chinese localisation where the upstream warrants. Contact: `hello@thenextgennexus.com` · [nexgendata.com](https://nexgendata.com).

# Actor input Schema

## `data_type` (type: `string`):

Which trade aggregate to emit. 'exports' = 出口 (export value), 'imports' = 進口 (import value), 'trade\_balance' = 貿易差額, 'all' = emit all three for every cell.

## `partner_country_filter` (type: `string`):

Optional ISO-3166-1 alpha-2 country code (e.g. 'US', 'CN', 'JP', 'HK', 'KR'). Leave empty to sweep Taiwan's top-8 trading partners.

## `hs_code_filter` (type: `string`):

Optional Harmonized System code (2-, 4-, or 6-digit). Examples: '85' (electrical machinery), '8542' (integrated circuits), '8471' (computers). Leave empty to sweep TW's top-6 commodity classes.

## `date_from` (type: `string`):

Inclusive start of the reporting window. Defaults to 3 months ago.

## `date_to` (type: `string`):

Inclusive end of the reporting window. Defaults to today.

## `max_records` (type: `integer`):

Hard cap on emitted dataset items (1-1000). Useful for sample / smoke runs.

## Actor input object example

```json
{
  "data_type": "all",
  "max_records": 100
}
```

# 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 = {
    "data_type": "all",
    "partner_country_filter": "",
    "hs_code_filter": "",
    "date_from": "",
    "date_to": "",
    "max_records": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgendata/taiwan-customs-export-trade-data").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 = {
    "data_type": "all",
    "partner_country_filter": "",
    "hs_code_filter": "",
    "date_from": "",
    "date_to": "",
    "max_records": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgendata/taiwan-customs-export-trade-data").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 '{
  "data_type": "all",
  "partner_country_filter": "",
  "hs_code_filter": "",
  "date_from": "",
  "date_to": "",
  "max_records": 100
}' |
apify call nexgendata/taiwan-customs-export-trade-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/taiwan-customs-export-trade-data",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🇹🇼 Taiwan Customs Trade Data · 海關進出口統計",
        "description": "Monthly Taiwan customs, export, import and trade-balance statistics from the Customs Administration, the International Trade Administration (Bureau of Foreign Trade) and the Customs-Port-Trade Single Window (海關進出口統計).",
        "version": "0.0",
        "x-build-id": "n3F5j1wL8fMfbVOXy"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nexgendata~taiwan-customs-export-trade-data/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nexgendata-taiwan-customs-export-trade-data",
                "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/nexgendata~taiwan-customs-export-trade-data/runs": {
            "post": {
                "operationId": "runs-sync-nexgendata-taiwan-customs-export-trade-data",
                "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/nexgendata~taiwan-customs-export-trade-data/run-sync": {
            "post": {
                "operationId": "run-sync-nexgendata-taiwan-customs-export-trade-data",
                "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": {
                    "data_type": {
                        "title": "Data type (出進口資料類型)",
                        "enum": [
                            "exports",
                            "imports",
                            "trade_balance",
                            "all"
                        ],
                        "type": "string",
                        "description": "Which trade aggregate to emit. 'exports' = 出口 (export value), 'imports' = 進口 (import value), 'trade_balance' = 貿易差額, 'all' = emit all three for every cell.",
                        "default": "all"
                    },
                    "partner_country_filter": {
                        "title": "Partner country filter (貿易夥伴國別)",
                        "type": "string",
                        "description": "Optional ISO-3166-1 alpha-2 country code (e.g. 'US', 'CN', 'JP', 'HK', 'KR'). Leave empty to sweep Taiwan's top-8 trading partners."
                    },
                    "hs_code_filter": {
                        "title": "HS commodity code (HS 海關商品分類)",
                        "type": "string",
                        "description": "Optional Harmonized System code (2-, 4-, or 6-digit). Examples: '85' (electrical machinery), '8542' (integrated circuits), '8471' (computers). Leave empty to sweep TW's top-6 commodity classes."
                    },
                    "date_from": {
                        "title": "Date from (起始日期, ISO YYYY-MM-DD)",
                        "type": "string",
                        "description": "Inclusive start of the reporting window. Defaults to 3 months ago."
                    },
                    "date_to": {
                        "title": "Date to (結束日期, ISO YYYY-MM-DD)",
                        "type": "string",
                        "description": "Inclusive end of the reporting window. Defaults to today."
                    },
                    "max_records": {
                        "title": "Maximum records (筆數上限)",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Hard cap on emitted dataset items (1-1000). Useful for sample / smoke runs.",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
