AI Agent Hub
Back to skills
📊

A-Share Quantitative Data Analysis

Data Analysis Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_9e3b7930/akshare-stock-cn according to https://skillhub.cn/install/skillhub.md

About this skill

Problem

A-share data is split across quote, financial, fund-flow, and dragon-tiger-list APIs. Manual calls often run into network instability, NaN serialization failures, and mixed JSON/table output needs. This skill wraps AkShare queries as a CLI for scripts or agents to consume.

How It Works

  • Query entry: run commands through the CLI scripts in the skill directory; default output is JSON, and --format table prints a readable table.
  • Coverage: real-time quotes, historical K-lines, financial data, sector/industry views, fund flows, dragon-tiger lists, new/IPO data, and margin trading.
  • Robustness: retries failed network requests twice with exponential backoff; errors return {"error": "..."} with exit code=1; pandas NaN values are handled for safe JSON output.
  • Market detection: identifies Shanghai or Shenzhen from the stock-code prefix.

Boundaries

The data is intended for academic analysis and is not investment advice. AkShare depends on third-party endpoints and may break when source sites change. Timeouts are still possible under extreme network conditions. If AkShare installation fails, a lighter Baostock setup can be used as an alternative.

Use Cases

  • Before writing a screener, pull real-time quotes for selected stocks as JSON for rule filtering.
  • During sector comparison, batch-query industry data and inspect key metrics as a table.
  • Before backtesting, fetch historical K-lines and check API failures via error JSON.
  • When drafting research notes, query company financials and fund flows, then format them as a table.

Best For

  • Quant analysts: need stable access to A-share quotes, K-lines, and fund flows.
  • Research engineers: embed financial, dragon-tiger, and margin APIs into scripts or agent workflows.
  • Data engineers: handle AkShare errors, NaN values, and safe JSON serialization.
  • Academic researchers: batch-query sector, industry, and IPO-related data by stock code.