Building an AI agent? Start with /llms.txt for the full site index.
Capital Flows
Market-level daily margin/short-sale system stats: total margin-purchase balance, total short-sale balance, short-to-margin ratio, net flows, and turnover intensity. Derived from the total margin/short family. Not a forecast, not a recommendation.
← Margin System Statistics overview
GET /v2/datasets/margin-system-statsMargin System Statistics is a Taiwan market dataset sourced from TWSE, served by TW Market Data as GET /v2/datasets/margin-system-stats, with data as of 2026-07-09.
| Field | Type | Description |
|---|---|---|
market | string | |
trade_date | string | |
margin_purchase_balance_total | number | |
short_sale_balance_total | number | |
short_to_margin_balance_ratio | number | |
margin_net_flow | number | |
short_net_flow | number | |
margin_turnover_intensity | number | |
maintenance_ratio | null | NULL — not loaded (honest gap) |
maintenance_ratio_note | string | |
derivation_method | string | |
rule_version | string |
| Rows | 9,971 |
| Window | 2000-11-28 – 2026-08-28 |
| Grade | Derived |
| Measured | 2026-09-01from the dataset registry |
A real response from this endpoint. Rows are returned under "data", and provenance is carried in the shape shown below — it is not identical across datasets, so read this page's rather than assuming another's.
{
"dataset_id": "margin_system_stats",
"request_context": {
"scope": "market_level_margin_short_aggregates",
"coverage_type": "daily_derived",
"filters": {
"market": null,
"trade_date": null,
"date_from": null,
"date_to": null,
"limit": 50
},
"min_trade_date": "2026-05-26",
"max_trade_date": "2026-08-03"
},
"quality": {
"row_count": 50,
"markets_present": [
"TPEx",
"TWSE"
],
"rows_without_maintenance_ratio": 50,
"sensitive_fields_exposed": false
},
"lineage": {
"derivation_methods": [
"derived_system_stats_over_total_margin_short_daily_items"
],
"rule_versions": [
"derived_v1_system_ratios"
],
"semantics": "Market-level margin and short-sale aggregates per trading day: balances, net flows, the short-to-margin ratio and turnover intensity. Every column is DERIVED from the per-ticker margin/short feeds."
},
"error": null,
"data": [
{
"market": "TWSE",
"trade_date": "2026-08-03",
"margin_purchase_balance_total": 9120700,
"short_sale_balance_total": 185322,
"short_to_margin_balance_ratio": 0.020319,
"margin_net_flow": -19345,
"short_net_flow": -3071,
"margin_turnover_intensity": 0.109743,
"maintenance_ratio": null,
"maintenance_ratio_note": "official_system_margin_maintenance_ratio_not_loaded_see_ticket",
"derivation_method": "derived_system_stats_over_total_margin_short_daily_items",
"rule_version": "derived_v1_system_ratios"
},
{
"market": "TWSE",
"trade_date": "2026-07-30",
"margin_purchase_balance_total": 8701432,
"short_sale_balance_total": 204214,
"short_to_margin_balance_ratio": 0.023469,
"margin_net_flow": -50887,
"short_net_flow": 12639,
"margin_turnover_intensity": 0.100179,
"maintenance_ratio": null,
"maintenance_ratio_note": "official_system_margin_maintenance_ratio_not_loaded_see_ticket",
"derivation_method": "derived_system_stats_over_total_margin_short_daily_items",
"rule_version": "derived_v1_system_ratios"
}
],
"data_count": 50,
"known_gaps": [
"every_column_is_DERIVED_not_an_officially_published_aggregate",
"maintenance_ratio_is_not_derivable_from_public_feeds_see_maintenance_ratio_note",
"aggregates_inherit_any_gap_in_the_underlying_per_ticker_feeds"
],
"warnings": [
"not_investment_advice"
],
"envelope": {
"dataset_id": "margin_system_stats",
"scope": "market_level_margin_short_aggregates",
"row_count": 50
}
}Captured from the live API on 2026-07-20.
Part of the data in this service is obtained from the Government Open Data Platform (data.gov.tw) and used under the Open Government Data License, version 1.0. Providing agencies: Taiwan Stock Exchange, Taipei Exchange, Taiwan Futures Exchange, Taiwan Depository & Clearing Corporation, National Development Council, Central Bank of the Republic of China (Taiwan), Department of Statistics of the Ministry of Economic Affairs, and Customs Administration of the Ministry of Finance. The value-added processing, derived calculations and presentation in this service are the responsibility of TWMD and are not associated with the providing agencies.
TW Market Data. (2026). Margin System Statistics (Version 2026-07-09) [Data set]. TW Market Data. Retrieved 2026-09-05, from https://twmarketdata.com/en/docs/api/capital-flows/margin-system-stats
The version is the dataset's own as_of, not the date this page was built. Where we have no as_of the field is left out rather than filled in. Check a signature
Datasets that join with this one. The key each pair aligns on is shown, so you can plan a multi-table query without guessing.
Joins on market + trade_date
Joins on market + trade_date
Joins on market + trade_date
Joins on market + trade_date
Joins on market + trade_date
curl "https://api.twmarketdata.com/v2/datasets/margin-system-stats" \
-H "X-API-Key: sk_live_..."| Parameter | Required | Type | Description |
|---|---|---|---|
symbol | Yes | string | Ticker, e.g. 2330. |
start_date | No | string (YYYY-MM-DD) | Start of the query range. |
end_date | No | string (YYYY-MM-DD) | End of the query range. |
limit | No | integer | Maximum rows to return. |
import requests
resp = requests.get(
"https://api.twmarketdata.com/v2/datasets/margin-system-stats",
params={},
headers={"X-API-Key": "sk_live_..."},
)
resp.raise_for_status()
print(resp.json()["data"])This endpoint is GET /v2/datasets/margin-system-stats. The full machine-readable schema (parameters, security, response envelope) lives in the OpenAPI spec.