BaoStock 免费开源 A 股数据平台,无需注册、无需 API Key,支持股票行情、K线、财务数据、行业分类、指数成分股查询。当用户提及 baostock、需要获取A股历史行情、财务报表、交易日历,或需要**免费、免注册**的A股数据时使用。与 tushare(数据更全但需注册)和 jqdatasdk(聚宽数据)不同,baostock 完全免费无限制,适合快速入门和低成本数据需求。
npx skills add https://github.com/lzwme/finance-quant-skills --skill baostock
BAOSTOCK_SERVER_IP:自定义服务器 IP(用于 nginx 代理等场景)BAOSTOCK_SERVER_PORT:服务器端口,默认 10030python scripts/market_data.py --type kline --code sh.600000 --start 2024-01-01 --end 2024-01-31python scripts/financial_data.py --type profit --code sh.600000 --year 2023 --quarter 4python scripts/stock_info.py --type all_stocks --date 2024-01-02python scripts/stock_info.py --type index_stocks --index hs300python scripts/stock_info.py --type industrypython scripts/stock_info.py --type trade_dates --start 2024-01-01 --end 2024-12-31--file 指定代码列表文件--frequency 参数(d/w/m/5/15/30/60)--adjust 参数(1=后复权,2=前复权,3=不复权)python scripts/market_data.py --type kline --code sh.600519 --start 2024-03-01 --end 2024-03-31 --frequency d --adjust 2python scripts/financial_data.py --type profit --code sh.601398 --year 2023 --quarter 4python scripts/stock_info.py --type index_stocks --index hs300python scripts/market_data.py --type kline --code sh.600519,sz.000001,sh.600036 --start 2024-01-01 --end 2024-12-31 --output stocks.csvimport baostock as bs
import pandas as pd
# 登录系统
lg = bs.login()
# 获取日K线数据
rs = bs.query_history_k_data_plus(
"sh.600519",
"date,code,open,high,low,close,volume,amount",
start_date='2024-01-01', end_date='2024-12-31',
frequency="d", adjustflag="2"
)
# 转换为 DataFrame
data_list = []
while (rs.error_code == '0') & rs.next():
data_list.append(rs.get_row_data())
df = pd.DataFrame(data_list, columns=rs.fields)
# 登出系统
bs.logout()
| 特性 | baostock | tushare | jqdatasdk | akshare |
|------|----------|---------|-----------|---------|
| 费用 | 免费 | 免费/付费 | 需注册积分 | 免费 |
| 注册要求 | ❌ 不需要 | ✅ 需要 | ✅ 需要 | ❌ 不需要 |
| 数据范围 | A股为主 | 全面(含宏观) | A股+因子 | 全面(含加密货币) |
| K线数据 | ✅ | ✅ | ✅ | ✅ |
| 财务数据 | ✅ | ✅ | ✅ | ✅ |
| 分钟线 | ✅ | ✅ | ✅ | ✅ |
| 实时行情 | ❌ | ❌ | ❌ | ✅ |
| 特色数据 | 交易日历 | 宏观/Shibor | 因子数据 | 龙虎榜/北向/加密货币 |
bs.login() 即可使用sh.600000(上海)、sz.000001(深圳)、bj.430047(北京)bs.login() 开始、bs.logout() 结束.astype(float) 转换Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions
This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. Use this when the user requests earnings calendar data, wants to know which companies are reporting earnings in the upcoming week, or needs a weekly earnings review. The skill focuses on mid-cap and above companies (over $2B market cap) that have significant market impact, organizing the data by date and timing in a clean markdown table format. Supports multiple environments (CLI, Desktop, Web) with flexible API key management.
Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.
Access real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the Alpha Vantage API. Use when fetching stock prices (OHLCV), company fundamentals (income statement, balance sheet, cash flow), earnings, options data, market news/sentiment, insider transactions, GDP, CPI, treasury yields, gold/silver/oil prices, Bitcoin/crypto prices, forex exchange rates, or calculating technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands). Requires a free API key from alphavantage.co.
Braintree Automation: manage payment processing via Stripe-compatible tools for customers, subscriptions, payment methods, and transactions
Take lzwme/baostock from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.