Skip to content

Guide · Agent skill

How to use the AKShare Financial Data agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The AKShare Financial Data skill teaches an AI agent how to pull market data from AKShare, a free open-source Python library that aggregates public financial sources such as Sina and East Money. This guide explains what the skill does, how to install it, how to ask for data in plain language, and what to watch out for. By the end you will be able to request daily prices, intraday bars, real-time quotes, macro indicators, futures and forex rates without looking up the AKShare API yourself.

AKShare Financial DataHKUDS/Vibe-Trading · MIT

Quick start

  1. 1Install the package. Run pip install akshare in the Python environment the agent uses, and make sure pandas is available.
  2. 2Download the skill ZIP. Get the ZIP from this page and unzip it so you have an akshare folder containing SKILL.md.
  3. 3Place the skill folder. Copy the folder to ~/.claude/skills/ for personal use or to .claude/skills/ in a project, or upload it under Settings → Capabilities → Skills in the Claude apps.
  4. 4Make a natural request. Describe the market, symbol, date range and whether you want adjusted prices, using YYYYMMDD dates.
  5. 5Check the output. Confirm the Chinese column names and the date conversion, and spot-check a few prices against another source.

What is an agent skill, and what does this one do?

An agent skill is a folder containing a SKILL.md file with instructions that an AI agent reads when a task matches the skill. This one is in the data-source category and is described as a primary fallback for tushare and yfinance.

Once installed, the agent knows the right AKShare function names, symbol formats (for example 000001 for an A-share or 105.AAPL for a US stock), date formats and the Chinese column names AKShare returns. It can then write working Python code to fetch data instead of you looking up the API.

  • A-shares: daily OHLCV, real-time quotes, basic stock info and intraday bars
  • US and HK stocks: daily OHLCV history
  • Macro: China GDP and CPI
  • Futures main contract quotes and BOC forex rates

Install the AKShare skill from a ZIP file

Download the ZIP for the skill from this page and unzip it. The skill is a single file, SKILL.md, inside a folder named akshare. Place that folder in one of these locations: ~/.claude/skills/ for your personal use, or .claude/skills/ inside a project folder if you want it available only in that project.

You can also upload the skill in the Claude apps under Settings → Capabilities → Skills.

The skill only teaches the agent. You still need the akshare Python package and pandas installed in the environment where the agent runs code.

  • Personal install: ~/.claude/skills/akshare/
  • Project install: .claude/skills/akshare/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload the skill
pip install akshare

Ask for data with natural requests

You do not need to name the skill. Describe the data you want, including the market, the symbol, the date range and whether you want adjusted prices. The agent should pick the matching AKShare function and symbol format on its own.

Use the symbol styles the skill documents. A-shares take plain digits with no exchange suffix, US stocks use a market prefix such as 105 for NASDAQ or 106 for NYSE, and HK stocks are five-digit zero-padded codes. Dates should be given as YYYYMMDD strings.

  • "Get daily adjusted prices for 000001 from 1 January 2024 to 1 January 2026."
  • "Pull daily OHLCV for AAPL on NASDAQ using AKShare, forward-adjusted."
  • "Fetch 5-minute bars for A-share 600519."
  • "Show China CPI and GDP series with AKShare."

Example: what the agent's code looks like

The skill's quick-start shows A-share daily data with forward adjustment (前复权, adjust="qfq"), along with US and HK equivalents. Results come back with Chinese column names such as 日期 for date and 收盘 for close. The skill notes that dates come back as strings and should be converted with pd.to_datetime().

  • Column 日期 = date, 开盘 = open, 最高 = high, 最低 = low, 收盘 = close, 成交量 = volume, 成交额 = amount, 涨跌幅 = pct_change, 换手率 = turnover_rate
import akshare as ak df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", end_date="20260101", adjust="qfq")

Safety notes: scripts and network access

This skill runs scripts and uses the network. The agent will fetch data from public financial websites through AKShare, which scrapes those sites. Those sites can change their layout or block requests, so a call that works today may fail later.

AKShare requires no registration or API key, but that also means no service guarantee. Review any code the agent writes before relying on it, and do not use the output as the sole basis for production trading decisions.

  • Requires network access to public financial data sites
  • Scripts run in your Python environment, so check the code before running it
  • Not suitable where guaranteed uptime or licensed exchange data is required

Tips for reliable results

Keep the date range explicit and in YYYYMMDD format. If a request fails, ask the agent to check the function name against the skill's reference docs, or to use the official AKShare documentation at akshare.akfamily.xyz for less common interfaces.

If you use the project's backtesting tools, note that the built-in AKShare loader at backtest/loaders/akshare_loader.py is used as a fallback when tushare or yfinance are unavailable.

  • Always state the symbol format for the market you need
  • Ask for adjusted prices explicitly (qfq) when comparing history
  • Convert the date column with pd.to_datetime() before analysis

What people use it for

  • Pulling several years of adjusted daily prices for A-shares to backtest a moving-average strategy
  • Building a dashboard that shows HK and US stock history without an API key
  • Fetching China CPI and GDP series to compare with market moves
  • Falling back to AKShare when a tushare or yfinance data pull is unavailable

Frequently asked questions

Is the AKShare skill free?

AKShare itself is described as a completely free, open-source Python library with no registration or API key required. The skill is listed under an MIT licence. Check the repository for the full licence terms.

What do I need to use the AKShare skill?

You need Python, pandas, the akshare package installed with pip install akshare, and network access to public financial data sites. The skill also runs scripts, so it works best in an environment you control.

Where do I put the AKShare skill folder?

Place it in ~/.claude/skills/ for personal use or in .claude/skills/ inside a project. In the Claude apps you can upload it under Settings → Capabilities → Skills.

Why does AKShare return Chinese column names?

AKShare returns Chinese column names by default, such as 日期 for date and 收盘 for close. The skill lists the English equivalents so the agent can map them.

How does AKShare compare with tushare or yfinance?

The skill describes AKShare as a primary fallback for tushare and yfinance. It is free and needs no API key, but it scrapes public sites that can change or block requests, so it is not a substitute for licensed, guaranteed data.

Why does my AKShare request fail?

The source notes that public sites can change or block requests, so a working call may stop. Check the function name and symbol format, confirm your network access, and see the official docs at akshare.akfamily.xyz.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

The AKShare skill suits analysts and developers who need free historical prices or macro data for A-shares, HK or US stocks and do not want to manage an API key. It is a poor fit for production trading or any workflow that needs guaranteed uptime, licensed exchange data or an official supported data contract.

Download the skill