MCPInstall
lzwme avatar

akshare

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

Installs
280
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/lzwme/finance-quant-skills --skill akshare
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads akshare automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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)

参考文档:

  • API 函数速查表(何时读取:需要查看完整 AKShare API 函数清单时)
  • 股票数据文档(何时读取:需要查看股票相关API参数说明时)
  • 期货数据文档(何时读取:需要查看期货相关API参数说明时)
  • 基金数据文档(何时读取:需要查看基金相关API参数说明时)
  • 宏观经济文档(何时读取:需要查看宏观数据API参数说明时)
  • AKShare官方文档(何时读取:需要查看最新API文档时)

注意事项

  • 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" - 分钟线

FAQ

What does the akshare skill do?

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

How do I install akshare?

Run npx skills add https://github.com/lzwme/finance-quant-skills --skill akshare in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/akshare/ (personal) or .claude/skills/akshare/ (project).

Which AI agents can use akshare?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is akshare safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains akshare?

It is published by lzwme in lzwme/finance-quant-skills. It has 280 recorded installs.

More from lzwme/finance-quant-skills

View all →
lzwme avatar

pywencai

lzwme/finance-quant-skills

同花顺问财数据查询:使用中文自然语言查询A股、指数、基金、港美股、可转债等市场数据;当用户需要通过自然语言从问财获取选股、财务、资金流、技术指标等数据时使用。

Business & Finance299 installs
lzwme avatar

baostock

lzwme/finance-quant-skills

BaoStock 免费开源 A 股数据平台,无需注册、无需 API Key,支持股票行情、K线、财务数据、行业分类、指数成分股查询。当用户提及 baostock、需要获取A股历史行情、财务报表、交易日历,或需要免费、免注册的A股数据时使用。与 tushare(数据更全但需注册)和 jqdatasdk(聚宽数据)不同,baostock 完全免费无限制,适合快速入门和低成本数据需求。

Backend & APIs278 installs
lzwme avatar

tdxquant

lzwme/finance-quant-skills

通达信量化数据获取技能。当用户提及 tdxquant、通达信、TdxQuant、tqcenter,并且需要获取A股数据(行情快照、K线、财务、板块、可转债、新股、交易数据等)、查询交易日历、执行通达信公式、订阅行情、交易下单时使用

Business & Finance238 installs
lzwme avatar

backtrader

lzwme/finance-quant-skills

Backtrader 开源量化回测框架,支持多数据源、多策略、多周期回测与实盘交易,纯Python实现。当用户需要开发量化策略、进行回测分析、编写交易逻辑、回测参数优化,或提及 backtrader、量化回测框架时使用。若用户仅需数据获取而无回测需求,引导使用 baostock/akshare/tushare 等数据 Skill。

Business & Finance229 installs
lzwme avatar

miniqmt

lzwme/finance-quant-skills

MiniQMT 迅投量化交易接口,基于 XtQuant Python 库(xtdata 行情 / xttrader 交易),供外部 Python 程序连接 MiniQMT 客户端,支持 A 股/期货/期权的行情获取(K线、分笔、财务数据等)和交易下单(报单、撤单、查询资产/委托/持仓)。当用户提及 miniqmt、xtquant、获取实时行情、量化交易下单、回测数据获取,或需要用外部 Python 程序连接 MiniQMT 客户端进行程序化交易时使用。若需在 QMT 客户端内编写/回测内置策略(ContextInfo/passorder),请用 qmt-strategy 技能。

Business & Finance226 installs
lzwme avatar

rqalpha

lzwme/finance-quant-skills

RQAlpha 米筐开源事件驱动回测框架。支持A股和期货,模块化架构,可自由扩展;当用户需要快速回测A股/期货策略、使用内置数据(download-bundle)、开发Mod插件,或提及 rqalpha、米筐时使用。与 backtrader 相比,rqalpha 内置A股日线数据、安装更简便,适合快速验证;backtrader 更灵活、社区更大。若用户仅需数据获取而无回测需求,引导使用 baostock/akshare/tushare 等数据 Skill。

Business & Finance209 installs

Popular business & finance skills

View category →
flowkit-labs avatar

website-builder

flowkit-labs/skills

Build and preview a hosted website for a business from a plain-language brief. Use for a new business homepage, landing page, service showcase, portfolio, online store, or customer portal, and for updates to sites hosted by this builder. Add bookings, checkout, or member accounts as needed and automate reminders, customer follow-ups, and reports after launch. Follow the user's choice when they specify another host or ask to edit an existing codebase.

Business & Finance160.9K installs
autonnel avatar

sales-funnel-blueprint

autonnel/autonnel-skills

Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.

Business & Finance134.8K installs
coreyhaines31 avatar

sales-enablement

coreyhaines31/marketingskills

When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),

Business & Finance134.2K installs
coreyhaines31 avatar

revops

coreyhaines31/marketingskills

When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.

Business & Finance127.9K installs
coreyhaines31 avatar

pricing

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.

Business & Finance96.4K installs
coreyhaines31 avatar

offers

coreyhaines31/marketingskills

When the user wants to design, construct, or improve an offer — the thing they actually sell — including value framing, bonus stacking, guarantee design, scarcity/urgency, naming, and payment structure. Also use when the user mentions 'offer,' 'offer design,' 'build an offer,' 'grand slam offer,' 'irresistible offer,' 'value stack,' 'bonus stack,' 'guarantee,' 'risk reversal,' 'money-back guarantee,' 'scarcity,' 'urgency,' 'high-ticket offer,' 'productize a service,' 'naming an offer,' 'payment plan,' 'down-sell,' 'upsell offer,' or 'why isn't my offer converting.' Best for services, agencies, courses, coaching, info products, high-ticket B2B, and direct-response. If you run pure self-serve SaaS, read pricing first — tiers and packaging do more work there. For price level itself (tiers, freemium, value metric), see pricing. For the page that presents the offer, see copywriting. For the launch moment, see launch. For sales collateral, see sales-enablement.

Business & Finance74.2K installs