How to Trial a China A-Share Market Data API Before Switching Your Intraday Screener
TickDB Research ·
How to Trial a China A-Share Market Data API Before Switching Your Intraday Screener
Before switching an intraday A-share screener to a new feed, start with your own stock list. All 300 CSI 300 constituents matched in our weekend snapshot and carried the expected quote date. Seven stocks outside the list had earlier quotes. Use the worksheet below to take the same check into a parallel intraday trial.
Imagine running the same screen after switching feeds on Monday and getting fewer names. Did those stocks fail the screen, or did the screener lack usable quotes at the time it ran? Start with a snapshot check, then compare what each feed actually made available at each scan.
The API returned 8,211 rows. Why reconcile a list of 300?
The response size tells you how many records came back. Coverage for a screener comes from reconciling the actual stock list, symbol by symbol.
Our baseline was the CSI 300 constituent file from China Securities Index Co., Ltd. It lists 188 Shanghai stocks and 112 Shenzhen stocks as of November 20, 2026 [1]. We used TickDB’s full-market A-share REST snapshot, /v1/market/ticker/cn-stock, on Saturday, November 21 at 21:37 China Standard Time (UTC+8). The request returned 8,211 rows. All 300 constituents appeared exactly once and carried the expected category.

The original reconciliation log [5]. Compare the target and matched counts.
Use the list your team actually screens. Save a dated copy, retain leading zeroes, and keep the exchange suffix on each symbol. If your strategy covers Beijing-listed stocks, include them in the trial. This 300-name sample covers Shanghai and Shenzhen.
All 300 matched. Why check each quote date?
Each of the 300 target quotes was dated November 20. Seven stocks outside the list had earlier quote dates in the same response. Friday, November 20 was the previous trading day on both exchanges when we collected the snapshot on Saturday [2]. Cambricon (688256.SH), for example, had a quote timestamp of 15:00:01 that Friday.

Source: the November 21 snapshot [5]. Dates are in China Standard Time. All seven earlier records were outside the target list. The test did not determine why those timestamps were earlier.
Quotes delivered in one response can carry different dates. The API returns timestamp in Unix milliseconds [4]. Convert it to China Standard Time and compare each quote date with the date set for the trial. If a quote for your own list falls outside it, set it aside and check the trading status and original record.
Verify the instrument type too. A local filter on type=stock left 7,567 rows in this response, including 1,686 ETF rows and 301 bond rows [5]. For example, 510300.SH is the Huatai-PineBridge CSI 300 ETF [3], which this snapshot classified as category=etf [5]. Use the more specific category field [4] to verify the intended instrument type for each name in your own list.
Which quotes were available for the 10:05 scan?
Suppose the screener runs at 10:05. A quote is timestamped 10:04:58, but your system receives it at 10:05:02. Looking back by quote timestamp alone makes it appear available at 10:05. The screener had already run by the time it arrived.
Record both timestamps. Receipt time tells you which quotes were available at the scan. Quote time tells you how old those available quotes were. Apply the receipt cutoff first and the strategy’s quote-age limit second. If the screens produce different candidates, check their actual inputs for missing names, stale or late quotes, and comparable price differences before investigating the screening rule.
These 300 names passed the weekend snapshot check and can move into a parallel trial. Use the same stock list, strategy version, scan times, and price field on both feeds. Scheduled screens can sample through REST. If you need continuous updates, use TickDB’s WebSocket subscription. The documentation calls for resending the subscription after reconnecting [4]. In the trial, record when the connection drops, when you resend the subscription, and when the first valid quote arrives. Measure coverage, freshness, and recovery in trading hours against criteria agreed in advance before switching. The TickDB China A-share Market Data API page explains the connection options and links to the API docs.
Put the snapshot check and parallel trial in one worksheet
Start with one row per symbol. During the parallel trial, use a row per symbol, feed, and scan time. Keep the list version and timing criteria with the worksheet. Record the retrieval time for a snapshot.
| What to record | How to use it |
|---|---|
| Symbol, name, and feed | Keep the exchange suffix. Flag missing names and follow up on the mapping or query the symbol separately. |
| Rows returned, expected and returned categories | Save source rows for duplicate or instrument-type discrepancies. |
| Expected trading date and quote time | Flag any snapshot quote outside the expected date. Check the trading status and source record. |
| Scan time and receipt time | Exclude late quotes, then apply your quote-age limit to those available at the scan. |
| Price and result | Flag missing, unreadable, or nonpositive prices. Retain comparable source prices if the feeds disagree. |
For example, Cambricon (688256.SH) returned one Shanghai common-stock quote timestamped November 20 at 15:00:01 China Standard Time. Mark it as passing this snapshot check. Retain the weekend retrieval time and leave the live scan and receipt fields blank.
Use the worksheet to decide whether to switch
| What the trial showed | What to do next |
|---|---|
| The weekend snapshot passed | Carry the same list into a parallel intraday trial. Our 300 names passed the snapshot check. Live coverage and freshness still need testing. |
| The feeds disagree, or a quote is missing, stale, or late | Record the affected symbols, scan times, and raw values from both feeds. Check symbol mapping, quote time, receipt time, and price definition. Delay the switch if a result breaches a preset threshold or an unresolved discrepancy could change the screen. |
| The parallel trial meets the agreed criteria | Verify required symbols, quote age, and the recovery behavior the workflow needs. Explain any discrepancies that would change the screen before considering a switch. Record the basis for the decision. |
Rerun the snapshot check with Python
Save the code as check_pool.py and give it a CSV with a symbol column, the saved snapshot JSON, and the expected trading date. It flags missing symbols, duplicates, incorrect categories, and unexpected dates. Use the worksheet for price and intraday receipt checks.
Rerunning the check with the original 300-name list and saved snapshot produced this result [5].
python check_pool.py target.csv snapshot.json 2026-11-20
checked=300, pass=300, review=0
import csv
import json
import sys
from collections import Counter, defaultdict
from datetime import date, datetime, timedelta, timezone
list_file, snapshot_file, expected = sys.argv[1:]
expected = date.fromisoformat(expected)
china_time = timezone(timedelta(hours=8))
categories = {"SH": "sh_stock", "SZ": "sz_stock", "BJ": "bj_stock"}
with open(list_file, encoding="utf-8-sig", newline="") as file:
symbols = [row["symbol"].strip().upper() for row in csv.DictReader(file)]
if not symbols or len(symbols) != len(set(symbols)):
raise SystemExit("Use a nonempty list of unique symbols")
with open(snapshot_file, encoding="utf-8") as file:
response = json.load(file)
code = response.get("code")
if type(code) is not int or code != 0:
raise SystemExit("Snapshot request failed")
by_symbol = defaultdict(list)
for row in response["data"]:
by_symbol[row["symbol"]].append(row)
def check(symbol):
category = categories.get(symbol.rsplit(".", 1)[-1])
if not category:
return "unknown_exchange"
records = by_symbol.get(symbol, [])
if not records:
return "missing"
if len(records) > 1:
return "duplicate"
row = records[0]
if row.get("category") != category:
return "wrong_category"
milliseconds = row.get("timestamp")
if type(milliseconds) is not int or milliseconds <= 0:
return "invalid_time"
try:
day = datetime.fromtimestamp(milliseconds / 1000, china_time).date()
except (ValueError, OSError, OverflowError):
return "invalid_time"
return "pass" if day == expected else "different_date"
summary = Counter()
for symbol in symbols:
status = check(symbol)
summary[status] += 1
if status != "pass":
print(symbol, status)
print(f"checked={len(symbols)}, pass={summary['pass']}, review={len(symbols)-summary['pass']}")
Frequently asked questions about testing a new feed
Do I need the CSI 300 if I already have my own watchlist?
Test the list your strategy actually screens. Save a dated copy with each symbol, exchange, and expected instrument type. Mark the names your screener must cover. If the first trial uses a subset, record which names were tested and which are still to be checked.
Do I have to rerun the whole test if a few names are missing or have the wrong quote date?
Start by rechecking the affected names. Flag missing rows, incorrect categories, and unexpected dates separately. Save the original response or missing-row record, then check symbol mapping and trading status. Query the affected symbol separately if needed.
Keep the original and follow-up results in separate entries, and log when you made the follow-up request. If an exception affects a required symbol or breaches a threshold agreed before the trial, mark the run as pending review until you can determine whether it passes.
How old can a quote be before it is unusable intraday?
Set the limit according to the signal lag your strategy can tolerate. Before the trial, set the observation window, scan times, and maximum quote age. Use the same rules for both feeds and log receipt times at the same point in the screener’s data pipeline. At each scan, exclude quotes received afterward, then subtract the quote timestamp from the scan time to check the age of quotes that were available.
Both feeds returned quotes, but the screens picked different stocks. What should I check first?
Compare the inputs each feed made available at the scan. Start with the names that changed the screen result. Match records by symbol with its exchange suffix and by scan time. Check quote and receipt timestamps first, then compare the same price field. This helps separate late delivery, stale inputs, and differences in comparable prices.
If a difference still affects the result and you cannot explain it, save both feeds’ original values and timestamps, mark it as pending, and check an independent source if needed. Record the cause and disposition once the evidence supports them.
If all 300 names pass, when can I consider switching?
Move from the snapshot check to a parallel intraday trial. Use the worksheet above to record the checks and write down whether a switch can be considered or should be delayed, with the reasons and any open items.
References
- China Securities Index Co., Ltd. CSI 300 constituent list (index code 000300, file
000300cons.xls). Data dated November 20, 2026, and saved November 21. Used to establish the test list. - Shanghai Stock Exchange, Trading Rules (2026 Revision), §2.4.1. Shenzhen Stock Exchange, Trading Rules (2026 Revision), §2.3.1. Both effective July 6, 2026. The exchanges’ 2026 market holiday schedules and the Shanghai Stock Exchange’s weekly market report for November 16–20 were used to cross-check the previous trading day.
- Huatai-PineBridge Fund Management Co., Ltd. Notice on the change to the extended exchange short name of the Huatai-PineBridge CSI 300 ETF (510300). Shanghai Stock Exchange disclosure, January 8, 2026, p. 1. Used to verify the fund code and instrument type.
- TickDB official OpenAPI specification, China A-share full-market quotes and
FullMarketTicker. WebSocket Best Practices, Connection Management. Checked November 22, 2026, for the endpoint, timestamp, instrument categories, and resubscription procedure. - This article’s test record. TickDB China A-share full-market REST snapshot retrieved November 21, 2026, at 21:37 China Standard Time (UTC+8), with symbol reconciliation, quote-date and instrument-category counts, and the Python rerun.
7 markets · 42,687 symbols
- US stocks
- 14,386
- Hong Kong market
- 3,353
- China stocks, ETFs & bonds
- 7,576
- Forex & metals
- 1,228
- Indices
- 13,960
- Futures
- 1,172
- Crypto
- 1,012