ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

akshare

AKShare 开源金融数据接口库 - 支持A股、港股、美股、期货、期权、基金、债券、外汇、宏观数据,免费无需API Key。

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/coderwpf/aakshare
Or

AKShare(开源金融数据API库)

AKShare 是一个全面的免费Python金融数据API库,覆盖A股、港股、美股、期货、期权、基金、债券、外汇和宏观经济数据。无需注册或API Key,所有函数返回 pandas.DataFrame

文档:https://akshare.akfamily.xyz/

安装

pip install akshare --upgrade

需要 Python 3.9+(64位)。

基本用法

import akshare as ak

# 获取平安银行日K线数据
df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", end_date="20240630")
print(df)

函数命名规则

{asset_type}_{market}_{data_type}_{data_source}
  • Asset type: stock (stocks), futures (futures), fund (funds), bond (bonds), forex (foreign exchange), option (options), macro (macroeconomics), index (indices)
  • Market: zh (China), us (United States), hk (Hong Kong), or exchange codes
  • Data type: spot (real-time), hist (historical), daily (daily bars), minute (minute bars)
  • Data source: em (East Money), sina (Sina Finance), exchange abbreviations

股票数据(A股)

实时行情 — 全部A股

import akshare as ak

# 获取全部A股实时行情
df = ak.stock_zh_a_spot_em()
# 返回字段: 序号、代码、名称、最新价、涨跌幅、涨跌额、成交量、成交额、振幅、最高、最低、今开、昨收、量比、换手率、市盈率、市净率 ...

历史K线数据

# 获取指定股票历史日K线数据
df = ak.stock_zh_a_hist(
    symbol="000001",       # 股票代码(不带前缀)
    period="daily",        # 周期: "daily"(日), "weekly"(周), "monthly"(月)
    start_date="20240101", # 开始日期,格式YYYYMMDD
    end_date="20240630",   # 结束日期
    adjust=""              # 复权: ""(不复权), "qfq"(前复权), "hfq"(后复权)
)
# 返回字段: 日期、开盘、收盘、最高、最低、成交量、成交额、振幅、涨跌幅、涨跌额、换手率

分钟级K线数据

# 获取分钟级K线数据
df = ak.stock_zh_a_hist_min_em(
    symbol="000001",
    period="5",            # 分钟间隔: "1", "5", "15", "30", "60"
    start_date="2024-01-02 09:30:00",
    end_date="2024-01-02 15:00:00",
    adjust=""              # 复权类型
)

个股基本信息

# 获取个股基本信息
df = ak.stock_individual_info_em(symbol="000001")
# 返回字段: 总市值、流通市值、行业、上市时间、股票代码、股票简称、总股本、流通股 ...

港股数据

# 港股实时行情
df = ak.stock_hk_spot_em()

# 港股历史K线数据
df = ak.stock_hk_hist(
    symbol="00700",        # 腾讯控股
    period="daily",        # 日线
    start_date="20240101",
    end_date="20240630",
    adjust="qfq"           # 前复权
)

美股数据

# 美股日线数据
df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")

# 美股实时行情
df = ak.stock_us_spot_em()

指数数据

# A股指数历史数据 (e.g., Shanghai Composite Index 000001)
df = ak.stock_zh_index_daily_em(symbol="sh000001")

# 指数成分股 (e.g., CSI 300)
df = ak.index_stock_cons_csindex(symbol="000300")

基金数据

# ETF实时行情
df = ak.fund_etf_spot_em()

# ETF历史K线数据
df = ak.fund_etf_hist_em(
    symbol="510300",       # 沪深300ETF
    period="daily",
    start_date="20240101",
    end_date="20240630",
    adjust="qfq"
)

# 开放式基金每日净值
df = ak.fund_open_fund_daily_em(symbol="000001")

# 基金评级
df = ak.fund_rating_all()

期货数据

Metadata

Author@coderwpf
Stars3409
Views0
Updated2026-03-25
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-coderwpf-aakshare": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.