SuperAPI AI Directory

cn-stock

General & other

View repository

Updated 10-16 01:26

About this skill

🇨🇳 cn-stock — China A-Share Data (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.

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.

Output Contract

Most functions return:

{"ok": bool, "source": str, "data": <payload>, "error": str|None, "ts": int}

Exception:

  • get_full_report(code) returns a combined dict of sub-results.

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

Function Map

Quote / company / K-line

Function What it returns Tushare 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 book not 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

Financials

Function What it returns Tushare endpoint(s)
get_financial(code, max_periods) key financial indicators by period fina_indicator
get_income_statement(code, max_periods, period) Income statement income
get_balance_sheet(code, max_periods, period) Balance sheet balancesheet
get_cashflow_statement(code, max_periods, period) Cash flow statement cashflow
get_earnings_forecast(code, limit) Earnings forecast forecast
get_earnings_express(code, limit) Earnings flash report express
get_dividends(code, limit) Dividends and bonus shares dividend

Shareholders & ownership

Function What it returns Tushare endpoint(s)
get_holders(code, top) latest top shareholders top10_holders
get_shareholder_count(code, periods) Changes in the number of shareholders stk_holdernumber
get_shareholder_trades(code, days) Increases and decreases in holdings by major shareholders stk_holdertrade
get_block_trades(code, days) Block trades block_trade

Fund flow & northbound

Function What it returns Tushare endpoint(s)
get_fund_flow(code, days) recent fund flow moneyflow
get_margin_detail(code, days) Margin trading and securities lending details margin_detail
get_north_holdings(code, days) Shanghai and Shenzhen Stock Connect holdings details (northbound) hk_hold
get_north_flow(days) Shanghai-Hong Kong and Shenzhen-Hong Kong Stock Connect daily capital flows moneyflow_hsgt

Concept / industry / dragon-tiger / market-wide

Function What it returns Tushare 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) Daily upper and lower price limits stk_limit
get_limit_board(trade_date, limit_type) Stocks hitting the daily limit up/down or failing to hold the limit up on that day limit_list_d
get_suspended(trade_date) Daily trading suspensions and resumptions suspend_d

Index data

Function What it returns Tushare endpoint(s)
get_index_basic(market) Index list (SSE/SZSE/MSCI/CSI/SW/...) index_basic
get_index_kline(index_code, period, start, end, limit) Index K-line (including CSI 300/SSE Composite/ChiNext, etc.) index_daily/weekly/monthly

One-shot bundle

Function What it returns
get_full_report(code) quote + company + holders + fund_flow combo

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.

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,非投资建议.

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).