Taiwan Securities Lending Balance & Borrow Fee API (TWSE+TPEx) avatar

Taiwan Securities Lending Balance & Borrow Fee API (TWSE+TPEx)

Pricing

from $0.50 / 1,000 results

Go to Apify Store
Taiwan Securities Lending Balance & Borrow Fee API (TWSE+TPEx)

Taiwan Securities Lending Balance & Borrow Fee API (TWSE+TPEx)

Shares on loan for every Taiwan listed & OTC stock since 2004 — the exchange SLB system, broker OTC lending and lending-account borrowing — plus every SLB trade with its borrow fee rate and each securities firm's lending book. Official TWSE data, cross-checked report against report.

Pricing

from $0.50 / 1,000 results

Rating

0.0

(0)

Developer

chris

chris

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 hours ago

Last modified

Share

Taiwan Securities Lending Balance & SLB Borrow Fee API (借券餘額・借券成交明細・借券費率)

How many shares of every Taiwan stock are out on loan, through which channel, and at what borrow fee? Daily securities lending balances for every TWSE-listed and TPEx OTC stock back to 2004-11-22, split into the exchange's SLB system, broker OTC lending and lending-account borrowing — plus every trade struck on the SLB system with its fee rate and term, and each securities firm's lending book.

借券餘額 is the short-side number Taiwan's financial press quotes every day ("TSMC securities lending balance hits a new high"). It is not the same as the SBL short-sale balance: a lending balance counts every borrowed share not yet returned, whether it was sold short, used for hedging or held for settlement. This Actor publishes the exchange's own figures, splits them the way the exchange does, and checks them against a separate trade-by-trade report.

Output

Four record types in one dataset, told apart by record_type. Real rows from 2026-10-08:

stock_balance — shares on loan per stock per day (TWT72U 借券餘額表, all four tables merged on one row)

{
"record_type": "stock_balance",
"date": "2026-10-08",
"market": "TWSE",
"stock_code": "2330",
"stock_name": "台積電",
"close_price": 2550.0,
"balance_prev_shares": 185732000,
"borrowed_shares": 2592000,
"returned_shares": 1010000,
"balance_shares": 187314000,
"balance_change_shares": 1582000,
"balance_value_twd": 477650700000,
"slb_balance_shares": 179834000,
"slb_borrowed_shares": 2591000,
"nlb_balance_shares": 7480000,
"nlb_borrowed_shares": 1000,
"lon_balance_shares": 11185000,
"lon_borrowed_shares": 0,
"balance_identity_ok": true,
"value_matches_close": true,
"trade_log_matches": true
}

(Each channel also carries _balance_prev_shares, _returned_shares and _balance_value_twd; trimmed here.)

market_total — the same columns for TWSE, TPEx and the whole market (market: "ALL"). On 2026-10-08 the whole market had 28,287,926,000 shares on loan worth NT$3.70 trillion.

slb_trade — every trade on the TWSE SLB system, with its borrow fee (t13sa710 歷史借券成交明細)

{
"record_type": "slb_trade",
"date": "2026-10-08",
"market": "TWSE",
"stock_code": "2330",
"stock_name": "台積電",
"trade_method": "negotiated",
"trade_method_zh": "議借",
"lots": 591,
"shares": 591000,
"fee_rate_pct": 4.73,
"close_price": 2550.0,
"trade_value_twd": 1507050000.0,
"agreed_return_date": "2027-04-08",
"agreed_days": 182,
"fee_rate_changed": false
}

broker_activity — each securities firm's and finance house's borrowed and lent balances (TWTBBU 證商/證金辦理有價證券借貸業務概況表)

{
"record_type": "broker_activity",
"date": "2026-10-08",
"broker_code": "9800",
"broker_name": "元大",
"borrowed_balance_shares": 4079772000,
"borrowed_balance_value_twd": 248965569920,
"lent_balance_shares": 4502903000,
"lent_balance_value_twd": 305828407620
}

A default daily run returns about 2,070 rows (one per stock with a balance, plus three totals) in five requests.

The three lending channels

The exchange publishes four balance tables. This Actor puts them side by side on one row:

PrefixTableWhat it isHistory
(none)SLBNLB 合計表All lending: SLB system + OTC lending2004-11-22 →
slb_證交所借券系統Borrowed through the exchange's SLB system (excluding lending accounts)2004-11-22 →
nlb_證商/證金營業處所Borrowed from securities firms and finance houses over the counter2008-04-09 →
lon_借貸專戶自證交所借券系統借入Firms' lending accounts borrowing from the SLB system2008-09-09 →

The total is exactly SLB + NLB, column by column, per the report's own footnote. LON is not part of SLB — the SLB table's footnote excludes lending-account borrowing — so it is a separate channel, not a subset. Channel columns are null before that channel's report begins, and null when includeChannelBreakdown is off.

Verification

Every figure below was measured against the live reports before release.

  • The SLB trade log reconciles with the balance table, stock by stock. SLB borrowing plus lending-account borrowing equals the lots traded on the SLB system that session × 1,000 — two separate reports — for every stock on six sessions sampled from 2010 to 2026 (393 of 393 stocks on 2026-10-07). Each row records the result in trade_log_matches.
  • Until 2007-06-29 the balance report booked an SLB trade one session late. 1,200 lots of 2881 traded on 2004-11-22 appear as 2004-11-23's borrowing. Checked week by week through 2007: from 2007-07-02 trades are booked the same session. The cross-check follows the convention of each era, so it holds back to 2004 (41 of 41 stocks on 2004-11-23).
  • Totals add up. Every column of each market's 合計 row equals the sum of its stocks, TWSE + TPEx equals 整體市場, and the total table equals SLB + NLB — exact on every session sampled from 2004 to 2026. A failure stops the run.
  • The trade log's own footnote (trade count, lots, value at the close) is recomputed from the rows on every request.
  • Firm lending books add up to the report's 合計 row in all four columns.
  • The balance identity (4) = (1) + (2) − (3), printed in the column header, is checked on every row of every channel.

Traps in the source that this Actor handles

  • The exchange's own slips are flagged, not hidden. On 2011-01-03 the NLB row for 2377 微星 reads 1,079,000 − 1,187,000 = 108,000 — the sign is lost. The figure is published as printed with balance_identity_ok: false. A whole column read out of place would break nearly every row, so a session with more than a handful of breaks stops the run instead.
  • A trade is occasionally booked a session late even now. In September 2026, 2409 友達 showed 12,109 lots more in the trade log than in the balance on 09-23 and the same 12,109 lots more in the balance on 09-24; every other stock matched on all 20 sessions. Such rows carry trade_log_matches: false and the run logs a warning; only a mismatch across many stocks stops it.
  • Value is not always balance × close. On 2010-01-04 four OTC-lending rows (including 2014, 2344 and 5346) were valued at some other price. The published value is kept and value_matches_close is false.
  • The first session prints no prices. 2004-11-22 shows 0.00 for every close; close_price is null that day, not zero.
  • The firm table changes meaning in 2016. Before 2016-05-26 the same request answers a monthly-average table with different columns. Only the daily table is read; earlier dates return no broker_activity rows.
  • Firm names are padded inside the characters (合  庫, 宏 遠); the padding is removed.
  • One report covers both markets. TPEx publishes no lending balance of its own and links to this TWSE report; market comes from its 市場別 column.
  • Codes are not always four digits (00400A, 00631L).

Input

  • recordTypes — stock_balance and market_total by default; add slb_trade and broker_activity.
  • startDate / endDate — leave both empty for the latest session. Fill them in for history back to 2004-11-22.
  • market — both, twse or tpex.
  • stockCodes — keep only these.
  • includeChannelBreakdown — the SLB / NLB / LON split (four requests a session). Off gives totals only, one request a session.
  • crossCheckTradeLog — reconcile against the SLB trade log (one request a month).
  • maxRequests — a cap for long backfills (default 400).
  • useApifyProxy — for multi-year backfills; TWSE's firewall blocks an address that asks too often.

Use cases

  • Short-side positioning: rising lending balances ahead of earnings, and how much of a stock's float is on loan.
  • Borrow cost: actual negotiated and auction fee rates per trade, by stock and term.
  • Squeeze screening: combine balance_shares with the short-sale balance in taiwan-sbl-short-sale-balance and shortable shares in taiwan-short-sale-eligibility.
  • Market structure: which firms lend and borrow the most, and how the SLB system and OTC lending split the market.

Limitations, stated plainly

  • The SBL short-sale balance is not always below the lending balance. It usually is — on 2026-10-08, 2,051 of 2,055 stocks — but three ETFs (00711B, 00852L, 00875) and one stock (3694) showed a larger short-sale balance than lending balance. The two reports measure different things and neither is adjusted.
  • OTC lending (NLB) has no trade-by-trade report, so only the SLB and LON channels can be reconciled against trades.
  • slb_trade.market is looked up from the same session's balance table and is null when balances were not requested.

Source

Taiwan Stock Exchange (臺灣證券交易所): TWT72U 借券餘額表 (selectType SLBNLB, SLB, NLB, LON, TWTBBU) and t13sa710 歷史借券成交明細. The TWT72U report covers both TWSE-listed and TPEx OTC stocks.

Taiwan Market Data Suite

This Actor is part of a suite of 44 Taiwan market data APIs by chamarix — official sources only, cross-validated against independent official endpoints, clean JSON out. Code samples for the whole suite: GitHub.

Market data:

Property market:

Government & civic data: