Reading main capital flow in A-shares
Money flow is not a price predictor — it is a thermometer for participation and the direction of chips. One `/v1/fund` request returns main-capital inflow (today / 5 / 10 / 20-day) + market rank + top-trader detail. The hard part is reading it; code and four common misreadings below.
What one request gives you
import requests
KEY = "ct-your-key"
r = requests.get("https://api.ashareapi.com/v1/fund",
headers={"Authorization": "Bearer " + KEY},
params={"code": "sh600667"}, timeout=30)
d = r.json()["data"]
print(d["date"], d["close"]) # 2026-09-24 19.41
print("today ", d["main_net"]) # -528559730.00
print("5-day ", d["main_net_5d"]) # -571025057.00
print("10-day ", d["main_net_10d"]) # 531599448.00
print("20-day ", d["main_net_20d"]) # -82259566.00
print("market rank", d["main_rank"]) # 5532- The payload is an object (not an array): `main_net*` / `main_rank` / `lhb` / `lhb_details` / `block_trades` / `margin`
- Amounts are in CNY and arrive as strings (`"-528559730.00"`) — cast to float before comparing
- `main_rank` is the market-wide net-inflow rank (larger = further toward net outflow)
- The same call also returns top-trader boards, block trades and margin data — no extra endpoints needed
Read the four horizons together
One day lies. A single session is noise; the four horizons together carry the signal:
- Rank beats absolute value: 100M of inflow ranked #10 is nothing like ranked #3000
- `industry_rank` is the within-industry rank; in our measurement it returned `0`, meaning the figure was unavailable that day — not "ranked 0"
| Pattern | How to read it | Watch out |
|---|---|---|
| today −, 5/10/20-day + | Short-term pullback, medium-term inflow intact | Worth watching, not a reason to buy |
| today +, 5/10/20-day − | A bounce pulse while the medium term bleeds | Caution: looks like distribution into strength |
| all four + | Sustained inflow | Strongest shape — but check price keeps up |
| all four − | Sustained outflow | Weak; "it has fallen a lot" is not a reason |
| today + but rank low | Inflow, yet many names are stronger | Relative strength is weak — do not read absolute numbers alone |
Top-trader boards: institutions or hot money?
`lhb` is the summary (reason / total buy / total sell / net buy); `lhb_details` is the seat-level detail (up to 10 rows) — the key to "who is trading".
for x in d["lhb"]:
print(x["Reason"], "| buy", x["TotalBuy"], "| sell", x["TotalSell"], "| net", x["NetBuy"])
# measured: cumulative 20% deviation over 3 sessions | buy 2.177B | sell 2.570B | net -393M
for x in d["lhb_details"]:
side = "buy" if x["Buy"] else "sell"
print(f'{x["RankType"][:6]} #{x["Rank"]} {x["Name"]} {side} {x["Buy"] or x["Sell"]}')
# measured (sh600667, 2026-09-24):
# sell seat #5 UBS Shanghai Huayuanshiqiao Rd sell 279M
# sell seat #3 Goldman Sachs Shanghai Century Ave sell 487M
# sell seat #2 Guotai Haitong HQ sell 565M- The seat name is the signal: known hot-money seats are short-term money; "institution" seats are funds
- Look at the net direction: when both sides appear, compare net buy, not "on the board = bullish"
- `HotMoneyTags` flags hot-money tags (empty string in our measurement = none)
- Being on the board is an outcome, not a cause: it means the stock already moved sharply; chasing then often means buying the top
Block trades and margin, in the same call
print("block trades", len(d["block_trades"]))
print("margin", len(d["margin"]))
# measured on sh600667: both are empty arrays [] -> no such data that day
# NOTE: an empty array is not a failure — just nothing on file for this stock- Block-trade discount = someone sold below market (bearish short term); premium = someone paid up to buy
- Rising margin balance = leveraged longs (and a bigger stampede risk on a pullback)
- For dedicated views use `/v1/block-trade` and `/v1/margin-trade` (the latter supports batched codes)
Four common misreadings
- "Inflow means it will rise" — wrong. Flow is coincident or lagging: inflow with a flat price (accumulation) and outflow with a rising price (distribution) both happen
- Reading one day only — single-session noise is huge; look at least at the 5-day
- Treating rank as a verdict — rank is relative; in a bear market even #100 can be net selling
- Ignoring how "main" is defined — it usually means large/block orders, and thresholds differ by platform. We give a consistent multi-horizon series, so comparing across time and names is safer than raw absolutes
Boundaries (stated so you do not misuse it)
- No northbound flow intraday — there is no market-wide northbound endpoint
- No minute-level flow (we do not do minute data)
- No market-wide flow ranking table — `main_rank` is one stock’s rank among all stocks, not a list you can dump
- Key required — `/v1/fund` is a paid endpoint; the top-trader split `/v1/lhb` is paid too (type=institution/hotmoney/activeseat)
- Not investment advice — how to fetch and how to read, not what to buy
FAQ
No. Flow is coincident or lagging: "inflow with a flat price" (accumulation) and "outflow with a rising price" (distribution) are both common. Its value is cross-validation alongside price, top-trader boards and volume — not standalone prediction.
`main_rank` is the market-wide net-inflow rank (5532 for sh600667 in our measurement, i.e. toward the outflow side); `industry_rank` is the within-industry rank. Note that `industry_rank` returned `0` in our measurement, meaning the figure was unavailable that day — not "ranked 0".
No. An empty array means there was no block-trade or margin data for that stock on that date. For market-wide or date-specific views, use `/v1/block-trade` and `/v1/margin-trade`.
Main-capital flow and top-trader boards update per trading day (after the close). The `date` field tells you which session the data belongs to (2026-09-24 in our measurement) — check it before interpreting; intraday you are still looking at the previous session.
No. `/v1/fund` is per code (it returns that stock’s market rank), not a market-wide list endpoint. To rank a basket, prepare your own code list and loop (mind the rate limits).
Last updated: 2026-09-25
Fields and values come from live responses (measured 2026-09-25 on sh600667: main_net -528559730.00 · 5-day -571025057.00 · 10-day 531599448.00 · 20-day -82259566.00 · main_rank 5532 · industry_rank 0 · lhb 1 row · lhb_details 10 rows · block_trades and margin both empty arrays). The "main capital" definition (large/block order thresholds) is set by each data platform; this service provides a consistent multi-horizon series.