Skip to content

Akshare

AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库

Install: claude mcp add aktools -- uvx --from aktools aktools-mcp

Works with Claude Code · 23,270 GitHub stars

Install

$claude mcp add aktools -- uvx --from aktools aktools-mcp

Install command taken from the project's README or registry entry. Always review code before running it.

资源分享:对于想了解更多财经数据与量化投研的小伙伴,推荐一个专注于财经数据和量化研究的知识社区。 该社区提供相关文档和视频学习资源,汇集了各类财经数据源和量化投研工具的使用经验。 有兴趣深入学习的朋友可点此了解更多,也推荐大家关注微信公众号【数据科学实战】。

重磅推荐:AKQuant 是一款专为 量化投研 (Quantitative Research) 打造的高性能量化回测框架。它以 Rust 铸造极速撮合内核, 以 Python 链接数据与 AI 生态,旨在为量化投资者提供可靠高效的量化投研解决方案。参见AKQuant

工具推荐:期魔方是一款本地化期货量化分析工具,适合数据分析爱好者使用。无需复杂部署,支持数据分析和机器学习功能,研究功能免费开放。 如需了解更多信息可访问期魔方。

Overview

AKShare requires Python(64 bit) 3.11 or higher and aims to simplify the process of fetching financial data.

Write less, get more!

  • Documentation: 中文文档
  • MCP server for AI assistants: AKTools lets Claude, Cursor and other MCP clients fetch AKShare data in natural language — see AI Assistants (MCP)
  • HTTP API: AKTools also serves AKShare over HTTP for other programming languages

AI Assistants (MCP)

AKShare is a Python library and does not run an MCP server itself. Its companion project AKTools ships one — registered in the official MCP Registry as io.github.akfamily/aktools — so AI assistants such as Claude Code, Claude Desktop and Cursor can look up and call every AKShare interface from a natural-language question, e.g. "贵州茅台 2024 年 10 月 8 日到 11 日的前复权日线行情".

No separate install is needed beyond uv:

claude mcp add aktools -- uvx --from aktools aktools-mcp

Claude Desktop, Cursor and other clients:

{
  "mcpServers": {
    "aktools": {
      "command": "uvx",
      "args": ["--from", "aktools", "aktools-mcp"]
    }
  }
}

Instead of registering 1000+ tools, it exposes three generic ones that the assistant chains together:

Tool Purpose
search_interfaces Find interface names by keyword
describe_interface Show an interface's parameters, defaults and description
get_data Call an interface and return up to max_rows rows (default 100, max 1000)

A running python -m aktools server also exposes the same tools over Streamable HTTP at http://127.0.0.1:8080/mcp. See the MCP guide (中文) for HTTP mode, proxies, access tokens and LAN access.

Installation

uv (Recommended)

uv pip install akshare --upgrade

See the uv environment guide for installing uv and creating a virtual environment.

pip

pip install akshare --upgrade

China

uv pip install akshare --upgrade --default-index https://pypi.tuna.tsinghua.edu.cn/simple
# or
pip install akshare --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple

Usage

Data

Code:

import akshare as ak

stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date="20231022", adjust="")
print(stock_zh_a_hist_df)

Output:

Similar plugs

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here…

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

Open-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key.

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts. 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI…

MCP serverDev tools+182 this week

Explore related