A-Share Quantitative Data Analysis
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 tableprints 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": "..."}withexit code=1; pandasNaNvalues 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.
Related Skills
Reads Excel/CSV files, cleans and analyzes them, then generates a charted Excel summary and interactive HTML dashboard.
Performs local, paragraph-level cross-document similarity checks and produces an HTML report with revision suggestions.
Scrapes JD search results for product titles, prices, sales, and stores, then exports verified data to UTF-8 CSV.
An A-share market monitor using Sina Finance API for real-time quotes, price and percentage alerts, daily logging, and scheduled checks.