China market data / Python SDK
PYTHON · PANDAS DATAFRAMES

Python SDK for China Stock Data

Query A-share prices, China ETFs, financial statements, capital flows, factors and realtime data with named Python methods backed by the same public API contract.

pip installpandas DataFramesConsistent symbols
01 · INSTALL

Install from PyPI

Add the SDK to notebooks, scripts and scheduled research jobs with pip.

02 · AUTH

Set one API key

Use QUANTSONAR_TOKEN or call qs.set_token() once.

03 · QUERY

Receive DataFrames

Call named methods with public symbol and date parameters.

QUICKSTART

From install to A-share prices

The SDK keeps authentication and response conversion out of your analysis code. Security codes use the exchange suffix, such as 600519.SH.

pip install quantsonar

import quantsonar as qs
qs.set_token("qs_your_key")

df = qs.daily(
    symbol="600519.SH",
    start_date="20260101"
)
COMMON WORKFLOWS

One SDK across China market data

AUTHENTICATION

Keep credentials outside source code

For repeatable environments, set QUANTSONAR_TOKEN. See the China stock API authentication section for errors and key handling.

OTHER ACCESS

Building an AI agent?

Connect the China stock MCP server for tool-capable agents, or use REST when you need a language-neutral integration.

START WITH FREE

Install the SDK and make your first query

Core daily and reference data are available on FREE. Compare data coverage and throughput on the pricing page.

Create a free account