Akshare logo

Akshare

Organization
lzwme
akshare

AKShare 开源金融数据接口库,提供股票、期货、期权、基金、外汇、债券、指数、加密货币等全品类金融数据;当用户需要获取各类金融市场数据时使用

Overview

Publisherlzwme
Repositoryfinance-quant-skills
Skill nameakshare
Stars
461
Forks
85
Bundled files
15
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lzwme on GitHub. Read the source before you install it.

Installation

Install the Akshare AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lzwme/finance-quant-skills/tree/main/skills/akshare
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lzwme/finance-quant-skills.git /tmp/finance-quant-skills
mkdir -p .claude/skills
cp -r /tmp/finance-quant-skills/skills/akshare .claude/skills/akshare
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Akshare in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Akshare on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Akshare is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AKShare 金融数据获取

任务目标

  • 本 Skill 用于:通过 AKShare 接口获取全品类金融市场数据
  • 能力包含:股票、期货、期权、基金、外汇、债券、指数、加密货币、宏观经济等数据
  • 触发条件:用户提及 AKShare 或需要获取各类金融数据时

前置准备

  • 依赖说明:安装 akshare 库(已包含在 dependency 中)
  • 凭证配置:AKShare 无需注册或 API Key,直接调用即可使用
  • 环境要求:Python 3.9+,建议定期更新 pip install akshare --upgrade

操作步骤

  • 标准流程:
    1. 确定数据需求 — 智能体理解用户意图(股票/期货/基金/外汇等)
    2. 调用对应脚本 — 根据数据类型选择脚本
    3. 解析结果 — 智能体分析返回的 JSON 格式数据
  • 脚本调用映射:
    • 股票数据 → python scripts/stock_data.py --type hist --symbol 000001 --start 20240101 --end 20240131
    • 期货数据 → python scripts/futures_data.py --type daily --exchange CFFEX --start 20240101 --end 20240131
    • 基金数据 → python scripts/fund_data.py --type etf --symbol 510300
    • 外汇数据 → python scripts/forex_data.py --type spot --symbol usd
    • 宏观经济 → python scripts/macro_data.py --type gdp
    • 加密货币 → python scripts/crypto_data.py --type price --symbol BTC/USDT
  • 可选分支:
    • 当需要多只标的:使用逗号分隔多个代码
    • 当需要指定周期:使用 --period 参数(daily/weekly/monthly)
    • 当需要复权数据:使用 --adjust 参数(qfq/hfq/空值)

使用示例

  • 示例1:获取股票历史K线
    • 场景/输入:用户说"获取贵州茅台2024年的日K线数据"
    • 预期产出:返回日期、开盘价、最高价、最低价、收盘价、成交量等OHLCV数据
    • 关键要点:调用 python scripts/stock_data.py --type hist --symbol 600519 --start 20240101 --end 20241231 --period daily --adjust qfq
  • 示例2:获取期货数据
    • 场景/输入:用户说"查看沪深300股指期货数据"
    • 预期产出:返回期货合约的K线数据、持仓量、成交量等信息
    • 关键要点:调用 python scripts/futures_data.py --type daily --symbol IF2406 --start 20240101 --end 20240131
  • 示例3:获取基金数据
    • 场景/输入:用户说"查询沪深300ETF的行情"
    • 预期产出:返回ETF的实时行情或历史净值数据
    • 关键要点:调用 python scripts/fund_data.py --type etf --symbol 510300
  • 示例4:获取宏观经济数据
    • 场景/输入:用户说"查看中国GDP数据"
    • 预期产出:返回GDP历史数据和最新值
    • 关键要点:调用 python scripts/macro_data.py --type gdp

数据分类详解

完整的 API 函数清单(70+ 个接口,覆盖股票/期货/基金/期权/债券/外汇/指数/加密货币/宏观经济/特色数据)见 references/api-catalog.md。

快速索引:

  • 股票 → ak.stock_zh_a_hist(), ak.stock_zh_a_spot_em()
  • 期货 → ak.futures_zh_spot(), ak.get_futures_daily()
  • 基金 → ak.fund_etf_spot_em(), ak.fund_etf_hist_em()
  • 宏观 → ak.macro_china_gdp(), ak.macro_usa_cpi_monthly()
  • 特色 → ak.stock_lhb_detail_em()(龙虎榜), ak.stock_hsgt_hist_em()(北向资金)

资源索引

脚本:

  • scripts/stock_data.py(用途与参数:获取股票K线/行情/财务数据,支持 --type/--symbol/--start/--end/--period/--adjust)
  • scripts/futures_data.py(用途与参数:获取期货数据,支持 --type/--symbol/--exchange/--start/--end)
  • scripts/fund_data.py(用途与参数:获取基金数据,支持 --type/--symbol/--start/--end)
  • scripts/forex_data.py(用途与参数:获取外汇贵金属数据,支持 --type/--symbol)
  • scripts/macro_data.py(用途与参数:获取宏观经济数据,支持 --type)
  • scripts/crypto_data.py(用途与参数:获取加密货币数据,支持 --type/--symbol/--period)
  • scripts/index_data.py(用途与参数:获取指数数据,支持 --type/--symbol/--start/--end)
  • scripts/option_data.py(用途与参数:获取期权数据,支持 --type/--symbol)
  • scripts/bond_data.py(用途与参数:获取债券数据,支持 --type/--symbol)
  • scripts/special_data.py(用途与参数:获取龙虎榜/融资融券/北向资金等特色数据,支持 --type/--symbol/--start/--end)

参考文档:

注意事项

  • AKShare 无需注册或 API Key,直接调用即可使用
  • A股股票代码格式:纯数字代码(如 000001、600519),不带市场前缀
  • 港股股票代码格式:纯数字代码(如 00700)
  • 美股股票代码格式:英文代码(如 AAPL、TSLA)
  • 数据列名:A股数据为中文列名,美股/港股数据为英文列名
  • 建议定期更新AKShare版本:pip install akshare --upgrade
  • 由于上游数据源变化,接口更新频繁,遇到错误时可先尝试更新版本
  • 脚本返回 JSON 格式数据,智能体负责解析并转换为用户友好的展示
  • 非Python用户可使用 AKTools HTTP API封装
  • 数据仅供学术研究使用,不构成投资建议

快速参考

函数命名规则

{asset_type}_{market}_{data_type}_{data_source}
  • Asset type: stock(股票), futures(期货), fund(基金), bond(债券), forex(外汇), option(期权), macro(宏观), index(指数)
  • Market: zh(中国), us(美国), hk(香港), 或交易所代码
  • Data type: spot(实时), hist(历史), daily(日线), minute(分钟)
  • Data source: em(东方财富), sina(新浪财经), 交易所缩写

复权类型

  • "" - 不复权
  • "qfq" - 前复权
  • "hfq" - 后复权

周期类型

  • "daily" - 日线
  • "weekly" - 周线
  • "monthly" - 月线
  • "1", "5", "15", "30", "60" - 分钟线

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Akshare AI skill do?

AKShare 开源金融数据接口库,提供股票、期货、期权、基金、外汇、债券、指数、加密货币等全品类金融数据;当用户需要获取各类金融市场数据时使用

Why use Akshare on TypingMind?

Because you install it once and use it with any model. Akshare is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Akshare in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lzwme/finance-quant-skills/tree/main/skills/akshare. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Akshare?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Akshare?

As many as you like. As long as a model supports skills, you can use Akshare with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Akshare AI skill free?

It is published on GitHub by lzwme. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇