cn-stock

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

🇨🇳 cn-stock — China A-Share Data (Tushare via sc-proxy)

🇨🇳 cn-stock — 中国A股数据(基于Tushare via sc-proxy)

Comprehensive A-share skill that uses Tushare Pro as the single upstream source. All API calls are routed through sc-proxy (transparent-proxy
tushare
plugin), which injects the real API token server-side and bills the request per call. No local
TUSHARE_TOKEN
env var needed
— the skill sends a fake token and sc-proxy replaces it before the request reaches Tushare.
一款全面的A股技能,以Tushare Pro作为唯一上游数据源。 所有API请求均通过sc-proxy(透明代理
tushare
插件)路由,该插件会在服务端注入真实的API令牌,并按请求次数计费。 无需本地设置
TUSHARE_TOKEN
环境变量
——该技能会发送一个假令牌,sc-proxy会在请求到达Tushare之前将其替换为真实令牌。

Source Strategy

数据源策略

your call → exports.py (cn-stock)
            └─ proxied_post → sc-proxy (tushare plugin) → http://api.tushare.pro/
  • No Sina / Eastmoney / akshare scraping fallback.
  • No local API key needed.
  • Charging is per-request via sc-proxy.
your call → exports.py (cn-stock)
            └─ proxied_post → sc-proxy (tushare plugin) → http://api.tushare.pro/
  • 不支持新浪/东方财富/akshare数据爬取作为备用方案。
  • 无需本地API密钥。
  • 通过sc-proxy按请求次数收费。

Output Contract

输出约定

Most functions return:
python
{"ok": bool, "source": str, "data": <payload>, "error": str|None, "ts": int}
Exception:
  • get_full_report(code)
    returns a combined dict of sub-results.
大多数函数返回:
python
{"ok": bool, "source": str, "data": <payload>, "error": str|None, "ts": int}
例外情况:
  • get_full_report(code)
    返回子结果的组合字典。

Code Format

代码格式

Accepts:
  • 000001
    /
    603186
    /
    300476
    (preferred)
  • 000001.SZ
    /
    600000.SH
    /
    830799.BJ
    (also accepted)
Auto mapping for 6-digit code:
  • 60/68/90
    → SH
  • 00/20/30
    → SZ
  • 4/8
    → BJ
支持的格式:
  • 000001
    /
    603186
    /
    300476
    (推荐格式)
  • 000001.SZ
    /
    600000.SH
    /
    830799.BJ
    (同样支持)
6位代码自动映射规则:
  • 60/68/90
    → SH(上海证券交易所)
  • 00/20/30
    → SZ(深圳证券交易所)
  • 4/8
    → BJ(北京证券交易所)

Function Map

函数映射

Quote / company / K-line

行情/公司信息/K线

FunctionWhat it returnsTushare endpoint(s)
get_realtime_quote(code)
latest quote-like snapshot + valuation
daily
+
daily_basic
get_company_info(code)
listed company profile
stock_company
get_kline(code, period, start, end, adjust, limit)
daily/weekly/monthly K-line (unadjusted)
daily/weekly/monthly
get_adj_factor(code, days)
adjust-factor series (for computing qfq/hfq manually)
adj_factor
get_bid_ask(code)
L1-L5 order booknot available in baseline permissions
get_stock_list(market, industry, list_status, limit)
listed stock universe with optional filters
stock_basic
get_trade_calendar(start, end, exchange, open_only)
trading day calendar
trade_cal
函数返回内容Tushare 接口
get_realtime_quote(code)
最新行情快照及估值数据
daily
+
daily_basic
get_company_info(code)
上市公司基本信息
stock_company
get_kline(code, period, start, end, adjust, limit)
日/周/月K线(不复权)
daily/weekly/monthly
get_adj_factor(code, days)
复权因子序列(用于手动计算前复权/后复权价格)
adj_factor
get_bid_ask(code)
L1-L5买卖盘数据基础权限不支持
get_stock_list(market, industry, list_status, limit)
可选过滤条件的上市公司列表
stock_basic
get_trade_calendar(start, end, exchange, open_only)
交易日历
trade_cal

Financials

财务数据

FunctionWhat it returnsTushare endpoint(s)
get_financial(code, max_periods)
key financial indicators by period
fina_indicator
get_income_statement(code, max_periods, period)
利润表
income
get_balance_sheet(code, max_periods, period)
资产负债表
balancesheet
get_cashflow_statement(code, max_periods, period)
现金流量表
cashflow
get_earnings_forecast(code, limit)
业绩预告
forecast
get_earnings_express(code, limit)
业绩快报
express
get_dividends(code, limit)
分红送股
dividend
函数返回内容Tushare 接口
get_financial(code, max_periods)
各期关键财务指标
fina_indicator
get_income_statement(code, max_periods, period)
利润表
income
get_balance_sheet(code, max_periods, period)
资产负债表
balancesheet
get_cashflow_statement(code, max_periods, period)
现金流量表
cashflow
get_earnings_forecast(code, limit)
业绩预告
forecast
get_earnings_express(code, limit)
业绩快报
express
get_dividends(code, limit)
分红送股
dividend

Shareholders & ownership

股东与持股

FunctionWhat it returnsTushare endpoint(s)
get_holders(code, top)
latest top shareholders
top10_holders
get_shareholder_count(code, periods)
股东户数变化
stk_holdernumber
get_shareholder_trades(code, days)
重要股东增减持
stk_holdertrade
get_block_trades(code, days)
大宗交易
block_trade
函数返回内容Tushare 接口
get_holders(code, top)
最新前十大股东
top10_holders
get_shareholder_count(code, periods)
股东户数变化
stk_holdernumber
get_shareholder_trades(code, days)
重要股东增减持
stk_holdertrade
get_block_trades(code, days)
大宗交易
block_trade

Fund flow & northbound

资金流向与北向资金

FunctionWhat it returnsTushare endpoint(s)
get_fund_flow(code, days)
recent fund flow
moneyflow
get_margin_detail(code, days)
融资融券明细
margin_detail
get_north_holdings(code, days)
沪深股通持股明细 (northbound)
hk_hold
get_north_flow(days)
沪深港通每日资金流向
moneyflow_hsgt
函数返回内容Tushare 接口
get_fund_flow(code, days)
近期资金流向
moneyflow
get_margin_detail(code, days)
融资融券明细
margin_detail
get_north_holdings(code, days)
沪深股通持股明细(北向资金)
hk_hold
get_north_flow(days)
沪深港通每日资金流向
moneyflow_hsgt

Concept / industry / dragon-tiger / market-wide

概念/行业/龙虎榜/市场全景

FunctionWhat it returnsTushare endpoint(s)
get_concept_boards(top, sort_by)
concept board list
ths_index
get_stock_concepts(code)
stock concept membership
ths_member
get_lhb(code, days)
dragon-tiger records for stock
top_list
(recent dates scan)
get_top_movers(direction, limit)
market-wide top movers
daily
(+
daily_basic
)
get_limit_prices(code, trade_date, days)
每日涨跌停价
stk_limit
get_limit_board(trade_date, limit_type)
当日涨停/跌停/炸板股
limit_list_d
get_suspended(trade_date)
每日停复牌
suspend_d
函数返回内容Tushare 接口
get_concept_boards(top, sort_by)
概念板块列表
ths_index
get_stock_concepts(code)
个股所属概念板块
ths_member
get_lhb(code, days)
个股龙虎榜记录
top_list
(扫描近期日期)
get_top_movers(direction, limit)
市场涨跌排名个股
daily
(+
daily_basic
)
get_limit_prices(code, trade_date, days)
每日涨跌停价
stk_limit
get_limit_board(trade_date, limit_type)
当日涨停/跌停/炸板股
limit_list_d
get_suspended(trade_date)
每日停复牌
suspend_d

Index data

指数数据

FunctionWhat it returnsTushare endpoint(s)
get_index_basic(market)
指数列表 (SSE/SZSE/MSCI/CSI/SW/...)
index_basic
get_index_kline(index_code, period, start, end, limit)
指数 K-line(含沪深300/上证/创业板等)
index_daily/weekly/monthly
函数返回内容Tushare 接口
get_index_basic(market)
指数列表(上证/深证/MSCI/CSI/SW/...)
index_basic
get_index_kline(index_code, period, start, end, limit)
指数K线(含沪深300/上证/创业板等)
index_daily/weekly/monthly

One-shot bundle

一站式汇总

FunctionWhat it returns
get_full_report(code)
quote + company + holders + fund_flowcombo
函数返回内容
get_full_report(code)
行情+公司信息+股东+资金流向组合接口

What this skill intentionally does NOT cover

本技能明确不涵盖的内容

  • News. Use normal web search (e.g.
    web_search
    ) for stock-related news, announcements, and articles. Tushare news has heavy rate limits and overlaps with general web coverage; running it through the paid proxy adds no value.
  • Adjusted K-line (qfq/hfq). The HTTP path only returns unadjusted bars. Use
    get_adj_factor
    + the unadjusted bars from
    get_kline
    if you need adjusted prices.
  • Intraday tick / bid-ask L1-L5. Requires upstream independent realtime permission that is not in baseline.
  • Minute bars. Requires upstream independent permission; not exposed here. Use
    get_kline
    for end-of-day.
  • 新闻资讯:如需股票相关新闻、公告及文章,请使用常规网页搜索(如
    web_search
    )。Tushare的新闻接口有严格的调用限制,且内容与通用网页覆盖范围重叠,通过付费代理调用无额外价值。
  • 复权K线(前复权/后复权):HTTP接口仅返回不复权K线数据。如需复权价格,请使用
    get_adj_factor
    获取复权因子,结合
    get_kline
    返回的不复权K线数据自行计算。
  • 日内逐笔成交/买卖盘L1-L5数据:需要上游独立的实时数据权限,不在基础权限范围内。
  • 分钟K线:需要上游独立权限,此处未开放。请使用
    get_kline
    获取日线数据。

User-facing reply guidance

面向用户的回复指南

When answering users:
  • Show values in readable Chinese market units (
    亿
    ,
    %
    ).
  • Clearly label data as end-of-day, not intraday tick.
  • If a capability is unavailable, say it directly.
  • Add source note:
    数据来源:Tushare Pro,非投资建议
    .
回复用户时:
  • 使用符合中国市场习惯的易读单位(
    亿
    %
    )展示数值。
  • 明确标注数据为日线收盘数据,而非日内逐笔成交数据。
  • 若某项功能不可用,请直接告知用户。
  • 添加来源说明:
    数据来源:Tushare Pro,非投资建议

Maintenance notes

维护说明

  • All requests POST
    http://api.tushare.pro/
    with body
    {api_name, token, params, fields}
    .
  • token
    field is set to a fake key; sc-proxy
    tushare
    plugin replaces it before the upstream call.
  • To change pricing or rate limit, edit the proxy
    tushare
    plugin (see
    transparent-proxy-maintenance
    skill), not this skill.
  • Adding a new Tushare endpoint = adding one thin wrapper around
    _call(api_name, **params)
    .
  • 所有请求均以POST方式发送至
    http://api.tushare.pro/
    ,请求体为
    {api_name, token, params, fields}
  • token
    字段设置为假密钥;sc-proxy的
    tushare
    插件会在请求发送至上游前将其替换为真实密钥。
  • 如需调整定价或调用限制,请修改代理的
    tushare
    插件(详见
    transparent-proxy-maintenance
    技能),而非本技能。
  • 添加新的Tushare接口只需围绕
    _call(api_name, **params)
    添加一个轻量包装函数即可。