# Taiwan Stocks Post-Market: Institutional Flows, Margin, Ranks (`o19750120/taiwan-stock-post-market-flows`) Actor

Every TWSE and TPEx common stock after the close: price, turnover, margin and short balances, institutional flows for both markets, attention flags, sector indexes and top-20 rankings. Descriptive official exchange data, 1-2 days late. Pay per row.

- **URL**: https://apify.com/o19750120/taiwan-stock-post-market-flows.md
- **Developed by:** [Oliver Liu](https://apify.com/o19750120) (community)
- **Categories:** Business, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 rows delivered

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/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

## Taiwan Stocks Post-Market: Institutional Flows, Margin, Ranks

**Every TWSE and TPEx common stock after the close, in one schema:** price, turnover, margin and short balances, the exchange's attention-list flag and net shares by foreign investors, investment trusts and dealers for both markets. Ready top-20 rankings mean you can pay for 20 rows instead of the whole market. Official exchange data, 1 to 2 trading days late. Numbers only, with no opinions or recommendations.

**Who it's for:** analysts and developers outside Taiwan who want after-close TWSE and TPEx figures in English field names, quant hobbyists who keep their own daily history, and anyone who would rather pay for a 20-row ranking than parse two exchanges' files. **Price:** US$0.003 per row. The prefilled input (two stocks, 2330 and 6488) returns 2 rows for US$0.006 in a few seconds; one top-20 ranking is US$0.06. Descriptive data, not investment advice.

Use it as a **Taiwan stock data API** instead of maintaining a **TWSE scraper** or **TPEx scraper**: after-close prices and turnover, **margin trading and short selling balances**, **institutional investors' net buying and selling for TWSE and TPEx stocks (foreign investors, investment trusts and dealers)**, and ready gainers, losers, turnover and net-buy rankings, as JSON, CSV or Excel. Also searched as **TWSE API**, **TPEx API**, **Taiwan margin trading data**, **Taiwan foreign investor net buying** and **Taiwan stock market data in English**.

![Real rows from a run: TPEx institutional net buying, top 8](https://twmarket.ayskilllab.com/shots/listing-p05-flows.png)

*Real rows from a run on 4 November 2026 with `kind: ranking`, `market: TPEX`, `ranking: net_buy`. Descriptive data, not a recommendation.*

### Sample output

The top five rows of `kind: ranking`, `market: TPEX`, `ranking: net_buy` from a run on 23 November 2026. The trade date is 20 November 2026: the open data was one trading day behind. Each row has 23 more fields, listed further down.

| Rank | Code | Name | Close (TWD) | Change % | Foreign net shares | Trust net shares | Dealer net shares | Margin change (lots) |
|---:|---|---|---:|---:|---:|---:|---:|---:|
| 1 | 5314 | Myson | 19.75 | 1.28 | 4,119,450 | 0 | 297,550 | 679 |
| 2 | 5351 | Etron | 71.6 | -8.79 | 2,454,634 | 2,000 | -27,979 | -1,733 |
| 3 | 3260 | ADATA | 235.5 | -7.28 | 2,405,851 | 10,795 | -92,159 | -2,214 |
| 4 | 6182 | WAFER WORKS | 56.8 | -9.98 | 2,216,700 | -314,000 | 22,666 | -2,461 |
| 5 | 8932 | Wiselink | 51.4 | -9.98 | 1,932,945 | 0 | -368,517 | -2,976 |

The same ranking for `market: TWSE` from the same run (trade date 20 November 2026):

| Rank | Code | Name | Close (TWD) | Change % | Foreign net shares | Trust net shares | Dealer net shares | Margin change (lots) |
|---:|---|---|---:|---:|---:|---:|---:|---:|
| 1 | 3481 | INX | 29.95 | -9.1 | 46,944,616 | -450,532 | 2,854,959 | -33,646 |
| 2 | 2303 | UMC | 80.3 | -8.96 | 80,321,612 | -35,359,857 | 3,897,277 | -12,886 |
| 3 | 2409 | AUO | 23.25 | -7.37 | 28,849,616 | 25,757 | -1,722,976 | -19,662 |
| 4 | 2887 | TS Holdings | 33.95 | -4.9 | 17,205,205 | -1,016,545 | 8,747,518 | -566 |
| 5 | 6770 | PSMC | 44.1 | -9.82 | 18,282,239 | 17,130 | 2,180,449 | -12,535 |

Net buying is ranked by `total_net_shares`, the sum of the three groups. A high rank says what happened that day, not what comes next.

### What one run returns

| `kind` | One row is | Rows on 23 Nov 2026 | What you read it for |
|---|---|---:|---|
| `stock` | One common stock | 1,969 | Close, change, shares, value, trades, margin and short balances, attention flag, institutional flows |
| `ranking` | One place in a top-20 list | 200 | Gainers, losers, turnover, net buy and net sell per market |
| `market` | One market's day | 2 | Index close, advancers and decliners, turnover, market-wide margin and flows |
| `sector` | One TWSE sector index | 37 | Index level and change, with an English name |

### How to use it

1. Click **Try for free** and open the **Input** tab.
2. Choose what to get. For one or a few stocks, choose *stock* and list `codes`.
3. For a **ranking**, you must also choose a **market** and a **ranking**.
4. Set **Maximum results** and click **Start**.
5. Download JSON, CSV or Excel, or read the dataset through the Apify API. Add a daily Schedule and keep your own history.

```json
{ "kind": "ranking", "market": "TPEX", "ranking": "net_buy", "maxResults": 20 }
```

```json
{ "kind": "stock", "codes": ["2330", "6488"], "maxResults": 2 }
```

### Coverage

| | TWSE (listed) | TPEx (over the counter) |
|---|---|---|
| Common stocks | about 1,090 | about 870 |
| Price, value, trades | Yes | Yes |
| Margin and short balances | Yes, list carries no date | Yes |
| Institutional flows per stock | Yes, from TWSE's daily T86 report on its website | Yes, from TPEx open data |
| Attention-list flag | Yes | Yes |
| Sector indexes | Yes, 37 | No |
| Rankings | Gainers, losers, turnover, net buy, net sell | Gainers, losers, turnover, net buy, net sell |

Not covered: ETFs, warrants, depositary receipts and history.

![Real rows from runs with kind market and kind stock](https://twmarket.ayskilllab.com/shots/listing-p05-market.png)

### Output example: a TPEx stock

A real row, unedited.

```json
{
  "kind": "stock",
  "market": "TPEX",
  "source_id": "tpex_openapi",
  "code": "6488",
  "name": "GWC",
  "ranking": "",
  "rank": null,
  "trade_date": "2026-11-03",
  "close": 685,
  "change": -75,
  "change_percent": -9.87,
  "shares": 11326427,
  "value_twd": 8013367310,
  "trades": 39962,
  "flows_date": "2026-11-03",
  "foreign_net_shares": -1312963,
  "trust_net_shares": -9964,
  "dealer_net_shares": -225527,
  "total_net_shares": -1548454,
  "margin_date": "2026-11-03",
  "margin_balance_lots": 11042,
  "margin_change_lots": -551,
  "short_balance_lots": 337,
  "short_change_lots": 119,
  "on_attention_list": false,
  "advancers": null,
  "decliners": null,
  "unchanged": null,
  "attribution": "Source: Taipei Exchange (Open Government Data License, version 1.0)",
  "license_url": "https://data.gov.tw/license",
  "data_date": "2026-11-04",
  "data_is_stale": false
}
```

### Output example: a TWSE stock

Selected fields from the 23 November 2026 data. The flow figures come from TWSE's T86 report, and the attribution says so.

```json
{
  "kind": "stock",
  "market": "TWSE",
  "source_id": "twse_openapi",
  "code": "2330",
  "name": "TSMC",
  "trade_date": "2026-11-20",
  "close": 2000,
  "change": -100,
  "change_percent": -4.76,
  "flows_date": "2026-11-20",
  "foreign_net_shares": -11862512,
  "trust_net_shares": -3848355,
  "dealer_net_shares": 4809638,
  "total_net_shares": -10901229,
  "margin_date": "",
  "margin_balance_lots": 29764,
  "on_attention_list": false,
  "attribution": "Source: Taiwan Stock Exchange (Open Government Data License, version 1.0). Institutional net shares: Taiwan Stock Exchange website, daily report T86, figures as published (https://www.twse.com.tw/zh/trading/foreign/t86.html); not part of TWSE's open data."
}
```

### Fields

| Field | What it is | Example |
|---|---|---|
| `kind` | stock, market, sector or ranking. | `stock` |
| `market` | TWSE or TPEX. | `TPEX` |
| `source_id` | Official source of this row. | `tpex_openapi` |
| `code` | Stock code. | `6488` |
| `name` | The exchange's own English short name, or the stock code if it gives none. For an index or sector, its English name. | `GWC` |
| `trade_date` | Session the prices are from. The two markets can differ. | `2026-11-03` |
| `close` | Close, or index level. | `685` |
| `change` | Change in points. | `-75` |
| `change_percent` | Change in percent, worked out from close and change. | `-9.87` |
| `shares` | Shares traded. | `11326427` |
| `value_twd` | Value traded in TWD. Market rows add up common stocks only. | `8013367310` |
| `trades` | Number of trades. | `39962` |
| `flows_date` | Session of the institutional figures. Empty when the stock is missing from its report. | `2026-11-03` |
| `foreign_net_shares` | Foreign and mainland investors, including foreign dealers, net shares. Same scope in both markets. | `-1312963` |
| `trust_net_shares` | Investment trusts, net shares. | `-9964` |
| `dealer_net_shares` | Dealers, net shares. | `-225527` |
| `total_net_shares` | All three, net shares. The four flow fields are null when the stock is missing from its report. | `-1548454` |
| `margin_date` | Session of the margin figures. Empty for TWSE, whose list carries no date. | `2026-11-03` |
| `margin_balance_lots` | Margin purchase balance, in lots of 1,000 shares. | `11042` |
| `margin_change_lots` | Change from the previous day. | `-551` |
| `short_balance_lots` | Short sale balance, in lots. | `337` |
| `short_change_lots` | Change from the previous day. | `119` |
| `on_attention_list` | On the exchange's attention list. | `false` |
| `attribution` | Credit line for the source. TWSE rows with flow figures also name the T86 report. Keep it when you republish. | `Source: Taipei Exchange (Open Government Data License, version 1.0)` |
| `license_url` | The source's licence or terms. | `https://data.gov.tw/license` |
| `data_date` | Date of the dataset this row came from. | `2026-11-04` |
| `data_is_stale` | True when the dataset is older than it should be. | `false` |

Ranking rows add `ranking` and `rank`. Market rows add `advancers`, `decliners` and `unchanged`.

### Use cases

- **Data pipelines:** one daily table across both markets, in one schema, from official files.
- **Flow studies:** per-stock foreign, trust and dealer net shares for both markets, ready to join with price.
- **Margin research:** daily margin and short balances with their change.
- **Screens on a budget:** read a 20-row ranking instead of paying for 2,000 rows.
- **AI agents:** official Taiwan market figures where each row carries its source.

### Pricing

**US$0.003 per row**, plus Apify's standard start fee of US$0.00005 per run.

| What you ask for | Rows | Cost |
|---|---:|---:|
| Two stocks | 2 | US$0.006 |
| One top-20 ranking | 20 | US$0.06 |
| All TPEx stocks | about 870 | about US$2.61 |
| The 1,000-row maximum of one run | 1,000 | US$3.00 |

Set **Maximum cost per run** to cap your spend. A run that delivers no rows charges for no rows.

### Limits to know

- **Not same-day.** The exchanges' open data arrives 1 to 2 trading days after the session, and the two markets can show different dates. On 4 November 2026, TWSE rows were from 2 November and TPEx rows from 3 November; on the morning of 2 December 2026 both markets already had 1 December, the previous session. Always read `trade_date`.
- **TWSE-listed flows come from TWSE's website, not its open data.** TWSE publishes per-stock institutional figures only in its daily T86 report. We copy the figures as published and name T86 in each row's attribution. TWSE's site terms ask for its consent to automated downloads, which we do not have; if TWSE asks us to stop, these fields go back to `null`. On 20 November 2026, 10 of 1,086 listed common stocks were missing from T86 and have `null` flows.
- **TWSE's margin list has no date.** We treat it as the same batch as the quotes and leave `margin_date` empty.
- **At most 1,000 rows a run.** TPEx fits in one run. TWSE has about 1,090, so its last stocks by code need a run with `codes`.
- **Latest day only.** There is no history: run it daily and keep your own dataset if you need a series.
- **Common stocks only.**
- **`name` is a short label, not a legal name.** It comes from the exchange's own company list, untranslated by us. Some are abbreviations (`TSMC`, `TCC`) and two stocks can share one, so use `code` as the key.
- **Change percent is worked out** from close and change. After a dividend or a capital reduction the exchange's reference price is what counts.
- **The attention-list flag is only a flag.** It is the exchange's own list and says nothing about the stock's quality.

### FAQ

**Where do the TWSE flow figures come from?**
From TWSE's daily report T86, which lists institutional investors' trading per stock. TPEx figures come from TPEx's open data. Both count foreign dealers inside `foreign_net_shares`, so the two markets compare directly.

**Why do the two markets show different dates?**
Each exchange updates its open data on its own schedule. Compare `trade_date`, not `data_date`.

**Is `net_buy` a buy signal?**
No. It is a sort order of what already happened. This Actor gives no opinions.

**Are stock names in English?**
Yes. `name` is the English short name each exchange publishes in its company list. We do not translate company names, so a stock the exchange gives no English name shows its code instead. Sector names are our own English labels.

**Can I get only stocks on the attention list?**
Yes. Choose `kind: stock` and tick **Attention list only**. The flag is the exchange's own list.

**How do I get a time series?**
Schedule a daily run and append each dataset to your own storage. We only serve the latest day.

**Is this investment advice?**
No. It is descriptive information, not investment advice and not an offer of securities analysis.

### Related Actors and free pages

More datasets from the same publisher, all pay per row with no credentials needed:

- [Taiwan & Global Macro Indicators](https://apify.com/o19750120/taiwan-global-macro-indicators): Taiwan's official GDP, CPI, PMI, money and rates in English, next to the US, the euro area and Japan.
- [Football Match Predictions, Backtested](https://apify.com/o19750120/football-prematch-report-backtested): pre-match home, draw and away probabilities for seven European leagues, with the model's backtest as data.
- [MLB Season Stats 2025](https://apify.com/o19750120/mlb-season-pitching-bullpen-data): the finished 2025 MLB season per club and per starting pitcher, from Retrosheet open data.
- [Stock Opinion Extractor](https://apify.com/o19750120/stock-opinion-extractor-own-posts): bring your own posts or X archive and get each ticker, a rule-based bullish, bearish or unclear stance and the evidence sentence.
- **Our own site:** [twmarket.ayskilllab.com](https://twmarket.ayskilllab.com/), in Traditional Chinese, has free [Taiwan stock ranking pages](https://twmarket.ayskilllab.com/rank). The site has its own lists and is not the same dataset as this Actor.

### Data sources and licences

Prices, margin, sectors and TPEx flows come from the exchanges' open data. TWSE-listed institutional flows come from TWSE's T86 report on its website, which is not open data. Each row carries its own `attribution` and `license_url`; keep the attribution when you republish.

- Source: Taiwan Stock Exchange (Open Government Data License, version 1.0) (https://data.gov.tw/license)
- Source: Taipei Exchange (Open Government Data License, version 1.0) (https://data.gov.tw/license)
- Institutional net shares of TWSE-listed stocks: Taiwan Stock Exchange website, daily report T86, figures as published (https://www.twse.com.tw/zh/trading/foreign/t86.html)

We organised this data; the exchanges own theirs and do not endorse this Actor.

# Actor input Schema

## `kind` (type: `string`):

Stocks are one row per common stock. Market is the two market totals. Sectors are TWSE sector indexes. Ranking is a ready top 20, so you pay for 20 rows.

## `market` (type: `string`):

TWSE (listed) or TPEX (over the counter). Required for a ranking. Leave empty for both otherwise.

## `codes` (type: `array`):

Four-digit codes such as 2330. Leave empty for all. Stocks only.

## `ranking` (type: `string`):

Used when What to get is Ranking. Net buy and net sell rank by total_net_shares in the market you choose.

## `attentionOnly` (type: `boolean`):

Only stocks on the exchange's attention list that day. Being listed is not a judgement of the stock.

## `maxResults` (type: `integer`):

Stop after this many rows. You pay per row. At most 1000 per run.

## Actor input object example

```json
{
  "kind": "stock",
  "codes": [
    "2330",
    "6488"
  ],
  "attentionOnly": false,
  "maxResults": 25
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "codes": [
        "2330",
        "6488"
    ],
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("o19750120/taiwan-stock-post-market-flows").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 = {
    "codes": [
        "2330",
        "6488",
    ],
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("o19750120/taiwan-stock-post-market-flows").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 '{
  "codes": [
    "2330",
    "6488"
  ],
  "maxResults": 25
}' |
apify call o19750120/taiwan-stock-post-market-flows --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,o19750120/taiwan-stock-post-market-flows"
        }
    }
}
```

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/8cxUTYXglhK8Dx1Bd/builds/4Mqq4ydcnpxrP9NvG/openapi.json
