# Taiwan Index History — TAIEX & TPEx 指數歷史 API (`chamarix/taiwan-index-history`) Actor

Daily history for Taiwan's stock indices: the TAIEX back to 1990-01-04 with market turnover, its total-return twin, the TPEx OTC index back to 1999-09-01, and one row per session for every one of the ~273 indices TWSE publishes, each with its official English name.

- **URL**: https://apify.com/chamarix/taiwan-index-history.md
- **Developed by:** [chris](https://apify.com/chamarix) (community)
- **Categories:** AI, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Index History (TAIEX & TPEx 指數歷史) API

Structured JSON for **every stock index Taiwan publishes**, day by day. The **TAIEX back to 1990-01-04** with the whole market's turnover beside it, its dividends-reinvested twin, the **TPEx OTC index back to 1999-09-01**, and one row per session for all **~273 indices** the Taiwan Stock Exchange compiles — sector, thematic, ESG, corporate-governance, leveraged and inverse — each carrying the exchange's **own official English name**.

Nine separate official feeds go in — five dated reports and four open-data mirrors. One consistent record shape comes out, with every figure the exchanges publish twice reconciled before it is written.

### Why this data matters

- **Thirty-six years of TAIEX in one series.** The daily close and the market's turnover genuinely start at 1990-01-04 — the session before it is refused outright rather than returned empty — so the February 1990 bubble top, the crash that followed, the 2000 dot-com unwind and 2008 all sit in the same table. A run over Q1 1990 comes back with 67 sessions peaking at a **12,495.34 close on 1990-02-10**. The intraday high and low only start at 1999-01-05, and every row says which it is via `has_intraday_range` rather than quietly serving nulls — so the 12,682 everyone quotes, an intraday print, is correctly absent rather than faked.
- **Four separately compiled reports, cross-checked against each other on every row.** TWSE publishes the closing index inside its turnover report, inside its historical-bar report, a third time inside the all-indices book, and a fourth time on its open-data host — a different domain, a different date format, different column names, a different publishing pipeline. None is derived from the others. The Actor requires all of them to agree wherever they overlap and fails the run if they do not.
- **Every change reconciles against the previous session, across month and year boundaries.** The reports are served a month at a time, so a naive parser never notices that the change printed on the 1st of a month should equal that day's close minus the last close of the previous month. Here the whole range is chained and checked end to end.
- **The exchange's own percentage rule, reverse-engineered and proved.** The daily series print a point change but no percentage. The all-indices report prints both — so the rule was recovered from it: half-up to two decimals, off the recovered previous close. Measured against **1,413 printed percentages** spread over 2009-2026 it reproduces **1,413 of them**, while rounding down reproduces only 683. That is the rule the Actor then applies to the series that do not print one.
- **Official English names, matched on the numbers rather than by position.** TWSE serves the same index book in English. Pairing it row for row is the obvious approach and it is wrong: on 2026-08-10 the English edition carries an index the Chinese one omits, which shifts every name after it. The Actor diffs the numeric columns instead and only names the stretches that match exactly — and then drops any name two sessions disagree on. Across seven sessions from 2009 to 2026, **1,209 of 1,209** indices were named this way.
- **The oldest row in the archive is marked, not quietly trusted.** On 1990-01-04 the turnover report prints a change of `0.00`, and there is no earlier session published anywhere to measure that against — a genuinely flat day and a placeholder look identical from the data. That row carries the official figures plus `is_archive_start: true`, so it can be dropped before computing returns. Nothing is invented in either direction.
- **A dash is never a zero.** An index suspended for the session, or one that has not launched yet, prints `--` in all four numeric columns. And on an index's inaugural session the report repeats the index *level* in the change column while leaving the percentage a dash — publishing that as written would show a brand-new index up several thousand percent. Those rows are flagged `is_series_start` and their change left null.

### Output

One record per session for the headline series. A real TAIEX session, as published:

```json
{
  "record_type": "TAIEX_DAILY",
  "date": "2026-08-10",
  "market": "TWSE",
  "index_code": "TAIEX",
  "index_name": "發行量加權股價指數",
  "index_name_en": "TAIEX",
  "open": 44540.71,
  "high": 45219.4,
  "low": 44540.71,
  "close": 44928.76,
  "change_points": 702.85,
  "change_pct": 1.59,
  "previous_close": 44225.91,
  "total_return_index": 103618.12,
  "trade_volume_shares": 10238975923,
  "trade_value": 880440723750,
  "transaction_count": 4441614,
  "change_matches_previous_close": true,
  "has_intraday_range": true,
  "source_reports": ["FMTQIK", "MI_5MINS_HIST", "MFI94U"]
}
```

Three reports merged into one row: the turnover report brought the volume, value, trade count and the change; the historical-bar report brought the open, high and low; the total-return report brought its own series. All three agreed on the close, and `702.85 / 44225.91 × 100 = 1.5892…`, which rounds to the 1.59 the exchange prints for the same session in its index book.

And one row per index per session from `ALL_INDICES`:

```json
{
  "record_type": "INDEX_QUOTE",
  "date": "2026-08-10",
  "market": "TWSE",
  "index_code": null,
  "index_name": "臺灣50指數",
  "index_name_en": "FTSE TWSE Taiwan 50 Index",
  "index_type": "PRICE",
  "compiler": "TWSE",
  "section": "TWSE price indices",
  "close": 41642.8,
  "change_points": 544.48,
  "change_pct": 1.32,
  "previous_close": 41098.32,
  "is_series_start": false,
  "official_note": null,
  "source_reports": ["MI_INDEX type=IND"]
}
```

### What you can ask for

| Dataset | One row is | Archive starts | Cost |
|---|---|---|---|
| `TAIEX_DAILY` | a TWSE session — TAIEX bar, turnover, total-return index | **1990-01-04** (bar from 1999-01-05, total return from 2003-01-02) | 3 requests per month of range |
| `TPEX_DAILY` | an OTC session — TPEx index bar | **1999-09-01** | 1 request per month of range |
| `ALL_INDICES` | one index on one session (~273 indices) | **2009-01-05** | 1-2 requests **per session** |
| `TPEX_SUB_INDICES` | one TPEx open-data series on one session | rolling window of recent sessions only | 4 requests total |

The daily series are served a month at a time, so **a decade of TAIEX costs about 360 requests no matter how many sessions it holds**. `ALL_INDICES` is the expensive one — it is a per-day report — which is why it carries a `maxSessions` cap, set to 250 by default.

`TPEX_SUB_INDICES` covers the TPEx total-return index, TPEx 50 and its total-return twin, the corporate-governance pair and the high-dividend pair. The OTC board serves these through open-data endpoints with **no date parameter at all**, so they carry a rolling window of recent sessions and nothing more. Schedule the Actor daily to accumulate them; there is no backfill to be had, and this README will not pretend otherwise.

### Archive floors, as measured

Each was probed rather than read off a documentation page, because the documentation and the data disagree.

| Series | First session | What comes back before it |
|---|---|---|
| TWSE turnover + TAIEX close | 1990-01-04 | `查詢日期小於79年1月4日` |
| TAIEX open/high/low | 1999-01-05 | `查詢日期小於88年1月5日` |
| TAIEX total return index | 2003-01-02 | `查詢日期小於92年1月` |
| TPEx index | 1999-09-01 | an empty table, no message |
| All-indices book | 2009-01-05 | **`stat: OK` with zero rows** |

That last one is the trap. Between 2004-02-11 and 2009-01-04 the all-indices endpoint answers `OK` and serves nothing, which looks exactly like a public holiday. Ask it about 2008-01-02 and you get a clean, empty, entirely misleading success. The Actor knows the floor and does not go below it.

### Things the official reports do that will break a naive parser

- **Two calendars, one shape.** TWSE prints Republic-of-China years, TPEx prints Gregorian ones, both as `y/m/d`. Worse, TWSE pads two-digit ROC years with a leading space — the 1999 archive returns `' 88/01/05'` — so splitting on `/` hands you an empty first field.
- **The total-return report's date column is named `日　期`,** with an ideographic space in the middle of the word. A column check that compares strings literally fails on it.
- **The direction of a move lives in a separate column, shipped as HTML.** `<p style ='color:red'>+</p>` means up, green means down, and the change column itself is always unsigned. Read the number without the arrow and every decline becomes a rally.
- **The English edition of the TPEx table labels its last column `Change(%)` while serving a point change.** The Chinese `漲/跌` is the honest label. The values are identical; only the header is wrong.
- **The all-indices report always returns ten tables, four of them nameless and empty.** The six real ones are identified by their titles — and the first one's title carries a date prefix while the rest do not.
- **The OTC board republished one session's row verbatim, once, in 2002.** In the exchange's own September 2002 table, `2002/09/20` carries `2002/09/19`'s open, high, low, close and change unchanged — five figures to two decimals, all identical. It is visible as corruption rather than coincidence because the next session, 09/23, prints a change of `-2.56` against a close of `103.32`, which measures from `105.88` — a close the exchange never published. Both rows are served exactly as the exchange serves them and flagged (`republished_previous_session`, `previous_session_republished`) rather than dropped, patched or quietly reconciled. Every OTC session ever published was swept to find out how common this is: **6,684 sessions from 1999-09-01 to 2026-09-10, exactly one repeated row, and the only two change-identity violations in twenty-seven years are the two that row causes.**
- **The index book grows.** 74 indices on 2009-01-05, 150 on 2020-03-02, 273 today. New sections appeared along the way, so the Actor matches sections by name and raises rather than guessing if an unknown one turns up.
- **The exchange's firewall answers a fast caller with an HTTP 307 and no `Location`.** The body is the exchange's "FOR SECURITY REASONS" page. It was measured to trip at a sustained four requests a second and — this is the part that catches people — once tripped it refuses *every* uncached report for that address, not just the one that tripped it, for several minutes. Anything the CDN happens to have cached still comes back 200, so a naive backfill appears to half-work. The Actor paces well under the threshold, slows the whole run down the moment a refusal lands, waits minutes rather than seconds before retrying, and names the firewall in its log instead of blaming the network.

The firewall refuses by address, so the way through a long backfill is to stop using the address it objected to: turn `useApifyProxy` on and TWSE requests go out through Apify Proxy, taking a different exit node each time they are refused. It is off by default because a direct run is faster and cleaner for any ordinary range. Only TWSE requests are proxied — the OTC board resets proxied connections (measured: six consecutive `ECONNRESET`s through a datacentre pool against one clean direct request), so it always goes direct.

When a refusal outlasts the retries anyway, the Actor falls back to the open-data host for the sessions that host carries — which is the current month, so a run over recent sessions survives it. For anything older there is no fallback, and rather than publish a run whose missing total-return column would read as history, **it fails and says so**. It also fails *immediately* in that case instead of working through the rest of the range first: once a month older than the current one has been refused for good, no later request can rescue it, and a run that is already going to fail should not spend ten minutes a month proving it.

### Verification

Every run reports what it reconciled. These checks are not optional switches — a failure fails the run.

- `twse_close_agrees_across_reports` — the turnover report and the historical-bar report, independently compiled, must print the same closing index for the same session.
- `taiex_agrees_across_three_reports` / `total_return_agrees_across_reports` — and so must the all-indices book, when that dataset is also requested.
- `twse_change_matches_previous_close` / `tpex_change_matches_previous_close` — the printed change must equal this close minus the previous session's, chained across the whole requested range including month boundaries.
- `twse_bar_within_high_low` / `tpex_bar_within_high_low` — open and close inside the session's own range.
- `index_percent_reproduces` — the printed percentage must reproduce from the recovered previous close under the half-up rule.
- `tpex_agrees_with_open_data` — where the OTC board's rolling open-data mirror overlaps the dated table, every value must match.
- `tpex_session_republished_by_exchange` — counts the rows above, which are excluded from the change identity because the figure they would be measured against was overwritten at the source. Everything either side of them is still checked.
- `twse_agrees_with_open_data` — same again on the TWSE side: the open, high, low, close and total-return index from the dated reports against the ones published on `openapi.twse.com.tw`.
- `english_name_stable_across_sessions` — an index whose English name comes out differently on two sessions is published with no English name at all rather than a possibly-shifted one.

Measured results behind the claims above: the OTC dated table against its open-data mirror, **8 sessions × 5 values, zero disagreements**; the change identity over **every OTC session ever published — 6,684 of them, 1999-09-01 to 2026-09-10 — with two violations, both caused by the single repeated 2002 row described above**; a 43-month TWSE backfill of 1999-08 to 2003-02, **911 sessions, close agreeing across two independently compiled reports 911 of 911, change identity 910 of 910**; the printed percentage across ten sessions from 2009 to 2026, **1,413 of 1,413**; the English pairing across seven sessions, **1,209 of 1,209**.

### Limitations, stated plainly

- **No intraday data.** These are daily closes. The five-minute series behind the exchange's own charts is not published with a date parameter.
- **`ALL_INDICES` is closes only.** The index book prints a close, a change and a percentage for each index — no open, high or low. Only the TAIEX and the TPEx index have a published daily bar.
- **`index_code` is null on `INDEX_QUOTE` rows.** The exchange names its 273 indices and never codes them. Inventing codes would be guesswork, so the Chinese and English names are the key.
- **The TPEx sub-indices do not backfill.** See above. This is a property of the source, not of the Actor.
- **Taiwan 50, Formosa and the rest have no standalone historical endpoint** — their `openapi` feeds return a single latest row and the dated paths redirect. They are covered here only through the all-indices book, which is why that dataset matters despite being a per-day report.

### Taiwan Market Data Suite

This Actor is part of a suite of 29 Taiwan market data APIs by [chamarix](https://apify.com/chamarix) — official sources only, cross-validated against independent official endpoints, clean JSON out. Code samples for the whole suite: [GitHub](https://github.com/cc77556/taiwan-market-data-actors).

**Market data:**

- [taiwan-stock-daily-quotes](https://apify.com/chamarix/taiwan-stock-daily-quotes) — Daily OHLCV, VWAP, P/E, price-to-book & dividend yield for every listed/OTC stock since 2004
- [taiwan-index-history](https://apify.com/chamarix/taiwan-index-history) — Daily TAIEX & TPEx index history since 1990 with market turnover, the total-return index & all 273 TWSE indices
- [twse-institutional-trades](https://apify.com/chamarix/twse-institutional-trades) — Daily institutional buy/sell (foreign, investment trust, dealer) per stock — TWSE listed
- [tpex-institutional-trades](https://apify.com/chamarix/tpex-institutional-trades) — Daily institutional buy/sell per stock — TPEx OTC market
- [taiwan-monthly-revenue](https://apify.com/chamarix/taiwan-monthly-revenue) — Monthly revenue of 1,900+ listed & OTC companies, MoM/YoY
- [taiwan-financial-statements](https://apify.com/chamarix/taiwan-financial-statements) — Quarterly income statement, balance sheet & cash flow back to 2013
- [taiwan-esg-disclosures](https://apify.com/chamarix/taiwan-esg-disclosures) — 21 ESG topics for 1,950+ companies — Scope 1/2/3 emissions, energy, water, waste, pay, board & climate risk
- [taiwan-dividend-calendar](https://apify.com/chamarix/taiwan-dividend-calendar) — Ex-dividend / ex-rights dates, reference prices & payouts back to 2003
- [taiwan-margin-trading](https://apify.com/chamarix/taiwan-margin-trading) — Daily margin trading & short sale balances per stock
- [taiwan-sbl-short-sale-balance](https://apify.com/chamarix/taiwan-sbl-short-sale-balance) — Securities-lending short sale balances per stock
- [taiwan-day-trading-stats](https://apify.com/chamarix/taiwan-day-trading-stats) — Day-trading volume, value & ratio per stock since 2014
- [tdcc-shareholding-dispersion](https://apify.com/chamarix/tdcc-shareholding-dispersion) — Weekly TDCC shareholding dispersion (retail vs whale structure)
- [taiwan-foreign-shareholding](https://apify.com/chamarix/taiwan-foreign-shareholding) — Foreign ownership percentage & remaining quota per stock
- [taiwan-futures-daily](https://apify.com/chamarix/taiwan-futures-daily) — Daily bars, settlement price & open interest for all 384 TAIFEX futures contracts since 1998, with the large-trader report
- [taifex-institutional-derivatives](https://apify.com/chamarix/taifex-institutional-derivatives) — Institutional futures & options positions (TAIFEX), incl. put/call ratio
- [taifex-options-chain](https://apify.com/chamarix/taifex-options-chain) — Full options chain by strike & expiry, both sessions, with the exchange's own Delta, since 2001
- [taiwan-warrants-daily](https://apify.com/chamarix/taiwan-warrants-daily) — Daily quotes, strike, expiry & moneyness for every listed/OTC warrant since 2004
- [taiwan-government-bonds](https://apify.com/chamarix/taiwan-government-bonds) — Central government bond benchmark yields, the full yield curve & issuance master, with staleness stated
- [taiwan-stock-alerts](https://apify.com/chamarix/taiwan-stock-alerts) — Watch-list, disposition & short-sale suspension alerts
- [taiwan-insider-share-transfers](https://apify.com/chamarix/taiwan-insider-share-transfers) — Insider share-transfer filings (directors, officers, 10% holders) since 2002
- [taiwan-director-shareholdings](https://apify.com/chamarix/taiwan-director-shareholdings) — Monthly director/officer shareholdings & share-pledge ratio since 1999
- [taiwan-block-trades](https://apify.com/chamarix/taiwan-block-trades) — Every block trade (鉅額交易) with price, size & basket constituents since 2005
- [taiwan-shareholder-meetings](https://apify.com/chamarix/taiwan-shareholder-meetings) — Shareholder meeting dates, book closure periods & e-voting since 2005
- [taiwan-emerging-stock-quotes](https://apify.com/chamarix/taiwan-emerging-stock-quotes) — Emerging (興櫃) board quotes, pre-IPO register & history since 2003
- [taiwan-etf-regular-investment](https://apify.com/chamarix/taiwan-etf-regular-investment) — Monthly regular savings plan (定期定額) rankings for stocks & ETFs since 2020
- [taiwan-treasury-stock-buybacks](https://apify.com/chamarix/taiwan-treasury-stock-buybacks) — Every treasury-stock buyback (庫藏股) filing, plan vs execution, since 2000

**Property market:**

- [taiwan-real-estate-transactions](https://apify.com/chamarix/taiwan-real-estate-transactions) — Actual registered sale, presale & lease prices (實價登錄) for all 22 cities since 2012

**Government & civic data:**

- [taiwan-legislator-monitor](https://apify.com/chamarix/taiwan-legislator-monitor) — Legislative Yuan bills, legislators & meetings
- [taiwan-tender-monitor](https://apify.com/chamarix/taiwan-tender-monitor) — Government e-procurement tenders (open calls, awards, failures)

### Data source

Taiwan Stock Exchange 市場成交資訊 (FMTQIK), 發行量加權股價指數歷史資料 (MI\_5MINS\_HIST), 發行量加權股價報酬指數 (MFI94U) and 每日收盤行情-指數 (MI\_INDEX `type=IND`), in both their Chinese and English editions; Taipei Exchange 櫃買指數(月查詢) (indexInfo/inx) and the 櫃買指數 / 富櫃50 / 公司治理 / 高股息 open-data feeds used for verification and for the OTC sub-indices. Public data, no login required.

# Actor input Schema

## `datasets` (type: `array`):

TAIEX\_DAILY is one row per TWSE session — the weighted index open, high, low and close plus the market's turnover, share volume and trade count. TPEX\_DAILY is the same shape for the OTC board's TPEx index. ALL\_INDICES is one row per index per session, covering all ~273 indices the exchange publishes (sector, thematic, ESG, leveraged and inverse, and their total-return twins) and costs one request per session, or two with English names on. TPEX\_SUB\_INDICES adds the TPEx total-return, TPEx 50, corporate-governance and high-dividend series, which the OTC board serves only for a rolling window of recent sessions.

## `startDate` (type: `string`):

First session to fetch. Leave both dates empty for the latest session. Each dataset has its own archive floor and a range that starts before it simply begins where the data does: turnover and the TAIEX close reach 1990-01-04, the intraday high and low 1999-01-05, the total-return index 2003-01-02, the TPEx index 1999-09-01 and the all-indices report 2009-01-05.

## `endDate` (type: `string`):

Last session to fetch, inclusive. Defaults to today. The daily series are served a month at a time, so a decade of TAIEX costs about 360 requests and a decade of the TPEx index about 120, no matter how many sessions they hold.

## `includeEnglishNames` (type: `boolean`):

Only affects ALL\_INDICES. The exchange publishes the same report in English, so this fetches both editions and carries the official English name onto every row. It is not a row-for-row copy — some sessions carry an index in one language and not the other — so the two are matched on their numbers and an index that cannot be placed is left without an English name rather than given a wrong one. Doubles the request count for this dataset.

## `crossCheck` (type: `boolean`):

Both exchanges publish their recent sessions a second time through open-data hosts built separately from the dated reports — different domains, different date formats, different column names. With this on, every overlap is compared value by value and the result written to the log. It is also the fallback the run uses if the exchange's firewall refuses a report mid-way. Costs up to four extra requests.

## `useApifyProxy` (type: `boolean`):

Turn this on for a backfill longer than about two years. TWSE's firewall refuses by address, so a long range gets cut off part-way and stays refused for minutes; with this on, TWSE requests go out through Apify Proxy and take a different exit address each time they are refused. It is off by default because a direct run is faster and cleaner for any ordinary range — through a datacentre proxy even TWSE drops a connection now and then. The OTC board always goes direct either way: it resets proxied connections outright, so proxying it would only break it.

## `maxSessions` (type: `integer`):

A safety cap on the per-session dataset, since a decade of it is about 2,400 sessions and twice that many requests. When a range exceeds the cap the most recent sessions are kept and the rest skipped, with a warning. Set to 0 to lift the cap. Does not affect the daily series, which are fetched a month at a time.

## Actor input object example

```json
{
  "datasets": [
    "TAIEX_DAILY",
    "TPEX_DAILY"
  ],
  "startDate": "",
  "endDate": "",
  "includeEnglishNames": true,
  "crossCheck": true,
  "useApifyProxy": false,
  "maxSessions": 250
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

One record per session for the TAIEX and the TPEx index — open, high, low, close, change, the total-return twin and the market's turnover — plus one record per index per session for all ~273 indices the exchange publishes, each carrying its official English name.

# 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 = {
    "datasets": [
        "TAIEX_DAILY",
        "TPEX_DAILY"
    ],
    "startDate": "",
    "endDate": "",
    "includeEnglishNames": true,
    "crossCheck": true,
    "useApifyProxy": false,
    "maxSessions": 250
};

// Run the Actor and wait for it to finish
const run = await client.actor("chamarix/taiwan-index-history").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 = {
    "datasets": [
        "TAIEX_DAILY",
        "TPEX_DAILY",
    ],
    "startDate": "",
    "endDate": "",
    "includeEnglishNames": True,
    "crossCheck": True,
    "useApifyProxy": False,
    "maxSessions": 250,
}

# Run the Actor and wait for it to finish
run = client.actor("chamarix/taiwan-index-history").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 '{
  "datasets": [
    "TAIEX_DAILY",
    "TPEX_DAILY"
  ],
  "startDate": "",
  "endDate": "",
  "includeEnglishNames": true,
  "crossCheck": true,
  "useApifyProxy": false,
  "maxSessions": 250
}' |
apify call chamarix/taiwan-index-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chamarix/taiwan-index-history"
        }
    }
}

```

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/UVcv4Na6jhzrAbNTL/builds/kIq9LvH0WEBe6cuos/openapi.json
