twmarketdata-com Capital Flow API
The Capital Flow API from twmarketdata-com — 1 operation(s) for capital flow.
The Capital Flow API from twmarketdata-com — 1 operation(s) for capital flow.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/twmarketdata-com:twmarketdata-com-capital-flow-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: TW Market Data Capital Flow API
description: 台股資料 API,為 AI agent、量化研究與金融產品開發設計。此文件提供 machine-readable 的公開資料端點摘要,詳細欄位請以對應 docs endpoint 頁面為準。
version: 0.1.0
x-spec-version: 1.0.0
x-generated-at: '2026-08-10T15:44:43.277Z'
servers:
- url: https://api.twmarketdata.com
description: The customer API. sk_live_ keys authenticate here, in the X-API-Key header. This is the host that issues those keys and the host that validates them.
security:
- ApiKeyAuth: []
tags:
- name: Capital Flow
paths:
/v2/datasets/institutional-flow:
get:
summary: 三大法人買賣超 / Institutional flow
description: 三大法人買賣超資料,用於籌碼與資金流向分析。
parameters:
- $ref: '#/components/parameters/TickerParam'
- $ref: '#/components/parameters/StartDateParam'
- $ref: '#/components/parameters/EndDateParam'
- $ref: '#/components/parameters/LimitParam'
responses:
'200':
description: Institutional flow rows returned successfully.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/DatasetResponseEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/InstitutionalFlowRow'
examples:
standard:
value:
data:
- ticker: '2330'
market: TWSE
trade_date: '2026-04-30'
foreign_net_buy: 1250000
investment_trust_net_buy: -82000
dealer_net_buy: 43000
institutional_net_buy_total: 1211000
unit_semantics: shares
provider: twse
source_role: official_twse_t86
meta:
dataset: institutional-flow
request_id: req_flow_001
generated_at: '2026-05-23T00:00:00Z'
ticker: '2330'
market: TWSE
date_from: '2026-04-01'
date_to: '2026-04-30'
source_policy: official/public-first
freshness: daily
currency: null
unit_semantics: shares
pagination:
limit: 50
next_cursor: null
has_more: false
data_gaps:
- code: coverage_rollout_gap
message: 部分標的或日期仍在 coverage 補齊中。
severity: warning
scope: dataset
field: null
source: official source rollout
observed_at: '2026-05-23T00:00:00Z'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/TooManyRequests'
description: Payment required — plan does not include this dataset. See payment.credits_url in the body to upgrade.
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalServerError'
x-data-status: coverage-limited
x-data-gaps: Response may include data_gaps and coverage/freshness caveats.
operationId: get_institutional_flow
tags:
- Capital Flow
externalDocs:
description: 對應 API 文件
url: https://twmarketdata.com/docs/api/capital-flow/institutional-flow
x-source-policy: official/public-first with explicit lineage and data_gaps.
x-coverage-note: Coverage is being expanded and may be limited for some dates/tickers.
x-data-gaps-policy: Keep coverage rollout gaps explicit; do not substitute missing flow with zeros.
x-dataset-page: https://twmarketdata.com/datasets/institutional-flow
x-docs-page: https://twmarketdata.com/docs/api/capital-flow/institutional-flow
x-freshness-note: Daily update cadence varies by source availability; check freshness and data_gaps.
x-stability: coverage_limited
security:
- ApiKeyAuth: []
components:
schemas:
PaginationMeta:
type: object
properties:
limit:
type:
- integer
- 'null'
minimum: 1
maximum: 1000
next_cursor:
type:
- string
- 'null'
has_more:
type:
- boolean
- 'null'
example:
limit: 50
next_cursor: null
has_more: false
additionalProperties: true
DataGap:
type: object
properties:
code:
type: string
message:
type: string
severity:
type: string
enum:
- info
- warning
- error
scope:
type:
- string
- 'null'
field:
type:
- string
- 'null'
source:
type:
- string
- 'null'
observed_at:
type:
- string
- 'null'
format: date-time
additionalProperties: true
example:
code: coverage_rollout_gap
message: 部分日期尚未完成來源補齊。
severity: warning
scope: dataset
field: null
source: official source rollout
observed_at: '2026-05-23T00:00:00Z'
DatasetMeta:
type: object
properties:
dataset:
type:
- string
- 'null'
request_id:
type:
- string
- 'null'
generated_at:
type:
- string
- 'null'
format: date-time
ticker:
type:
- string
- 'null'
market:
type:
- string
- 'null'
date_from:
type:
- string
- 'null'
format: date
date_to:
type:
- string
- 'null'
format: date
source_policy:
type:
- string
- 'null'
freshness:
type:
- string
- 'null'
currency:
type:
- string
- 'null'
unit_semantics:
type:
- string
- 'null'
additionalProperties: true
DatasetResponseEnvelope:
type: object
required:
- data
properties:
data:
type: array
items:
type: object
additionalProperties: true
meta:
$ref: '#/components/schemas/DatasetMeta'
pagination:
$ref: '#/components/schemas/PaginationMeta'
data_gaps:
type: array
items:
$ref: '#/components/schemas/DataGap'
example:
data: []
meta:
dataset: twse-daily-price
request_id: req_example_001
generated_at: '2026-05-23T00:00:00Z'
ticker: '2330'
market: TWSE
date_from: '2026-01-01'
date_to: '2026-01-31'
source_policy: official/public-first
freshness: daily-close
currency: TWD
unit_semantics: shares
pagination:
limit: 50
next_cursor: null
has_more: false
data_gaps: []
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
request_id:
type:
- string
- 'null'
additionalProperties: true
examples:
invalid_query:
value:
error:
code: INVALID_QUERY
message: 查詢參數格式錯誤。
request_id: req_invalid_001
unauthorized:
value:
error:
code: UNAUTHORIZED
message: 缺少或無效的 API key。
request_id: req_auth_001
rate_limited:
value:
error:
code: RATE_LIMIT_EXCEEDED
message: 請求過於頻繁,請稍後重試。
request_id: req_rate_001
internal_error:
value:
error:
code: INTERNAL_ERROR
message: 伺服器暫時無法處理請求。
request_id: req_internal_001
InstitutionalFlowRow:
type: object
properties:
ticker:
type: string
market:
type:
- string
- 'null'
date:
type: string
format: date
foreign_net_buy:
type:
- number
- 'null'
investment_trust_net_buy:
type:
- number
- 'null'
dealer_net_buy:
type:
- number
- 'null'
institutional_net_buy_total:
type:
- number
- 'null'
unit_semantics:
type:
- string
- 'null'
description: Typically shares.
provider:
type:
- string
- 'null'
source_role:
type:
- string
- 'null'
additionalProperties: true
parameters:
LimitParam:
name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 1000
description: 回傳筆數上限。
StartDateParam:
name: start_date
in: query
required: false
schema:
type: string
format: date
description: 查詢起始日期(YYYY-MM-DD)。
EndDateParam:
name: end_date
in: query
required: false
schema:
type: string
format: date
description: 查詢結束日期(YYYY-MM-DD)。
TickerParam:
name: symbol
in: query
required: true
schema:
type: string
description: 股票代碼(對應 ticker),例如 2330。
responses:
InternalServerError:
description: Unexpected server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
internal_error:
value:
error:
code: INTERNAL_ERROR
message: 伺服器暫時無法處理請求。
request_id: req_internal_001
TooManyRequests:
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
rate_limited:
value:
error:
code: RATE_LIMIT_EXCEEDED
message: 請求過於頻繁,請稍後重試。
request_id: req_rate_001
BadRequest:
description: Invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalid_query:
value:
error:
code: INVALID_QUERY
message: 查詢參數格式錯誤。
request_id: req_invalid_001
Unauthorized:
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
unauthorized:
value:
error:
code: UNAUTHORIZED
message: 缺少或無效的 API key。
request_id: req_auth_001
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: Use X-API-Key header with your dashboard-issued API key.
externalDocs:
description: TW Market Data developer docs
url: https://twmarketdata.com/docs