Skip to main content

QuantCoda Python SDK

tests PyPI

官网 · API 文档 · 免费注册 · MCP 接入

QuantCoda 官方 Python SDK —— A 股行情、财务、资金流、筹码、龙虎榜,45 个数据接口,一个 API Key 全部拿到。

安装

pip install quantcoda

快速开始

import quantcoda as qc

qc.set_token("qc_live_你的密钥")   # 免费注册: https://quantcoda.com/register

# 贵州茅台 2026 年以来的日线(返回 pandas.DataFrame)
df = qc.daily(symbol="600519.SH", start_date="20260101")

# 每日指标 / 财务 / 资金流 / 龙虎榜……全部同一姿势
qc.fundamentals(symbol="600519.SH", trade_date="20260710")
qc.income(symbol="600519.SH", period="20251231")
qc.moneyflow(trade_date="20260710")
qc.top_list(trade_date="20260710")

# 指数与外汇
qc.index_daily(symbol="000300.SH", start_date="20260101")
qc.fx_daily(start_date="20260101")

# 实时行情与快讯
qc.realtime(symbol="600519.SH,300750.SZ")
qc.news_flash(source="cls")
  • Key 也可以放环境变量 QUANTCODA_TOKEN,省去 set_token
  • 全部接口一览:qc.endpoints()(方法名、路径、套餐、参数与返回字段)
  • 单个接口的完整契约:qc.endpoint_schema("daily")
  • 参数与返回字段和 在线文档 一一对应;日期统一 YYYYMMDD,证券代码带交易所后缀(600519.SH

错误处理

from quantcoda import QuantCodaError, RateLimitError

try:
    df = qc.daily(symbol="600519.SH")
except RateLimitError as e:      # 超出限速(429)
    print(e, "建议等待:", e.retry_after, "秒")
except QuantCodaError as e:     # 其他错误,中文说明
    print(e.status, e)

多账号 / 自定义

from quantcoda import QuantCoda

client = QuantCoda(token="qc_live_另一把密钥", timeout=60)
df = client.daily(symbol="000001.SZ", start_date="20260101")

定价

免费版 100 次/天,无需信用卡。Pro 开放全部现有标准数据;Expert 包含 Pro 全部能力并提供最高 500 次/分钟的请求频率 —— 定价页

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantcoda-0.1.4.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantcoda-0.1.4-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file quantcoda-0.1.4.tar.gz.

File metadata

  • Download URL: quantcoda-0.1.4.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quantcoda-0.1.4.tar.gz
Algorithm Hash digest
SHA256 85fe548b7600f4ea230aefeeb3efc62ee2bb17865769f056ea90a8238b23f9d6
MD5 d4d1ba08038780109b2a2d666d54aa05
BLAKE2b-256 b2358d135f83488ca104b81697e7489f0ff536273b9b36fdb06c27d55220132f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantcoda-0.1.4.tar.gz:

Publisher: publish.yml on ChuYiCui1/quantcoda-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantcoda-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: quantcoda-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quantcoda-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d2cf2459b5899f016f545db0d1f90d5914ebbf493548a8f84628c18ea9b3a6fa
MD5 44d56c387896b10de7a7e8f0a2b9deb0
BLAKE2b-256 ac438d74af5458e755923ced211fbbcf3ebad739cbe3c0e9bf8b49b7b0298da1

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantcoda-0.1.4-py3-none-any.whl:

Publisher: publish.yml on ChuYiCui1/quantcoda-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page