Eight hundred rows came back from Eastmoney and all of them were green.

The weakest name in the set was up 11.01%. Eighty-three of the 800 sat at +20% or better, which is the daily limit for ChiNext and STAR names. For about ninety seconds I thought I had caught a market-wide melt-up on a Sunday afternoon.

I had asked for the top 800 by change percent. That is the whole explanation.

Sorting is a query, not a filter

po=1 means descending and fid picks the column. Set fid=f3 and the server sorts the entire A-share market by change percent before it pages anything. You are not filtering a list. You are asking for the top of a sorted one.

So the answer to "why is my breadth indicator pinned at 100%" is that the input was never a sample. Every row in that pull cleared +11.01% because I wrote a query that could not return anything else.

Ask for a neutral sort and page through it, or ask for a specific slice. If you want money rather than price, fid=f62 gives the main-capital inflow ranking — 中际旭创 led my fund-flow pull at +3,769,285,632 CNY net main inflow on a 19.98% move.

One number that looks like a bug and is not: 239 of those 800 rows carried a negative dynamic PE. Those are loss-making companies. Filter them only if your model actually wants profitable names.

The two endpoints that matter

Quotes live on push2.eastmoney.com/api/qt/clist/get. K-lines live on push2his.eastmoney.com/api/qt/stock/kline/get. Same field language, different hosts.

import requests UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36") # f-numbers are Eastmoney's internal column ids. This is the mapping that # covers a normal quote row; anything not listed here you don't get. FIELDS = { "f12": "code", "f14": "name", "f2": "price", "f3": "change_pct", "f4": "change", "f5": "volume_lots", "f6": "turnover", "f7": "amplitude_pct", "f8": "turnover_rate_pct", "f9": "pe_dynamic", "f10": "volume_ratio", "f15": "high", "f16": "low", "f17": "open", "f18": "prev_close", "f20": "market_cap", "f21": "float_market_cap", "f23": "pb", "f62": "main_net_inflow", "f184": "main_net_inflow_pct", } def num(v): """Eastmoney writes '-' for missing values instead of null.""" if v in (None, "-", ""): return None try: return float(v) except (TypeError, ValueError): return None def quotes(pages=1, size=100, fid="f3", market="m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23"): rows = [] for pn in range(1, pages + 1): r = requests.get("http://push2.eastmoney.com/api/qt/clist/get", params={ "pn": pn, "pz": size, "po": 1, "np": 1, "fltt": 2, "invt": 2, "fid": fid, "fs": market, "fields": ",".join(FIELDS), }, headers={"User-Agent": UA, "Referer": "https://quote.eastmoney.com/"}, timeout=25) diff = (r.json().get("data") or {}).get("diff") or [] if not diff: break for raw in diff: rec = {"code": raw.get("f12"), "name": raw.get("f14")} for f, label in FIELDS.items(): if label not in ("code", "name"): rec[label] = num(raw.get(f)) rows.append(rec) return rows 

fs takes a comma-joined mini-language, not a market name:

  • m:0+t:6 Shenzhen main board, m:0+t:80 ChiNext
  • m:1+t:2 Shanghai main board, m:1+t:23 STAR market
  • m:0+t:81+s:2048 Beijing Stock Exchange

All four A-share boards together is the 800-row call. Eight pages of 100, 30 fields each, 703,468 bytes of JSON, back in 3.83 seconds.

Note the http in that URL and not https. I run plain HTTP first and fall back to TLS, because the https host gets refused outright on some networks and some Python/OpenSSL combinations. If your scraper returns an empty diff array with no exception, that is usually what happened — not a rate limit. It took me an afternoon to stop blaming the endpoint.

The secid trap

K-lines do not take a stock code. They take secid = <market>.<code>, where 1 is Shanghai and 0 is everything else.

000001 is why that matters:

  • 1.000001 is the Shanghai Composite Index. Last five daily bars closed 3538.95, 3548.37, 3476.47, 3476.88, 3606.49 — that 4.12% amplitude day on 2026-11-27 belongs to the index.
  • 0.000001 is 平安银行, which closed 12.23 the same day.

Six identical digits, two completely different instruments, and the endpoint serves either one without a warning. Get the prefix wrong and your backtest runs on an index level as if it were a bank share price.

def kline(secid, bars=5, klt=101, fqt=1): r = requests.get("https://push2his.eastmoney.com/api/qt/stock/kline/get", params={ "secid": secid, "fields1": "f1,f2,f3,f4,f5,f6", "fields2": "f51,f52,f53,f54,f55,f56,f57,f58", "klt": klt, "fqt": fqt, "end": "20500101", "lmt": bars, }, headers={"User-Agent": UA, "Referer": "https://quote.eastmoney.com/"}, timeout=25) data = r.json()["data"] or {} out = [] for line in data.get("klines") or []: p = line.split(",") out.append({ "date": p[0], "open": num(p[1]), "close": num(p[2]), "high": num(p[3]), "low": num(p[4]), "volume_lots": num(p[5]), "turnover": num(p[6]), "amplitude_pct": num(p[7]), }) return data.get("name"), out # klt: 101 daily, 102 weekly, 103 monthly, 1/5/15/30/60 minutes # fqt: 0 raw, 1 forward-adjusted, 2 backward-adjusted 

Real return from kline("1.600519", bars=2):

2026-11-27,1469.99,1472.36,1481.41,1452.99,39808,5849112431.00,1.93 

Column order is date, open, close, high, low, volume in lots, turnover in CNY, amplitude percent. Close is the third number. A lot of snippets assume OHLC and shift every value by one column — nothing raises, the numbers are simply wrong, and you find out when a chart looks like a different stock.

What a real record looks like

Straight out of the 800-row run (scraped_at 2026-11-29T03:19:53Z):

{ "market": "all_a", "code": "300663", "name": "科蓝软件", "price": 6.64, "change_pct": 20.07, "change": 1.11, "volume_lots": 531838.0, "turnover": 330605108.52, "amplitude_pct": 19.71, "turnover_rate_pct": 11.38, "pe_dynamic": -21.18, "volume_ratio": 3.17, "high": 6.64, "low": 5.55, "open": 5.55, "prev_close": 5.53, "market_cap": 3176980648.0, "float_market_cap": 3103215016.0, "pb": 13.25, "main_net_inflow": 61611874.0, "main_net_inflow_pct": 18.64, "exchange": "SZSE", "secid": "0.300663", "url": "https://quote.eastmoney.com/300663.html" } 

Units, since nobody documents them: volume_lots is 手 (100 shares), turnover is CNY, market_cap is CNY, main_net_inflow is CNY. volume_ratio is a ratio against the 5-day average, not a percentage.

The - sentinel is the other undocumented thing. A suspended ticker comes back as "-" and one of them in a batch of 800 kills the loop unless you wrap the cast. num() above exists for exactly that and nothing else.

The part that is not about Eastmoney

When I first pushed this as an Apify actor, the build died on:

ERROR: Input schema is not valid (Field schema.properties.sortBy.editor is required) 

Nothing to do with the endpoint. sortBy was a free-text string input and free-text strings need an explicit "editor": "textfield"; only strings with an enum get a dropdown for free. Two minutes to fix, one build cycle to find.

The related trap is on the other side: integer inputs cannot carry enum at all. I lost a version of a different actor to that, because the rule is only written down in the build log after it fails.

Field ids drift the same quiet way. f numbers are internal to the portal's front end — stable for years, then a new column appears and f184 starts meaning something else. The pipeline keeps running, keeps writing numbers, and nobody re-checks. Keep the mapping in one dict and re-read it against the website once a month.

If you would rather not own that dict, the logic above is packaged as Eastmoney Stock Scraper on Apify — quote list, K-lines with qfq/hfq, and fund flow, same field names as the JSON above.

Next step: run quotes(pages=2), print len(rows), and compare the shape of row 101 against row 1. If they differ, your pagination is broken and you would not have noticed for a week.