Skip to content
Skillpedia
Analysis & spreadsheets37k · #7496

akshare

What it does

This skill teaches an agent to use AKShare, a free open-source Python library for financial data. It is for analysts and developers who want market data without signing up for a paid service.

When to use it

  • ✓When you need historical prices for A-shares, US stocks, Hong Kong stocks or futures.
  • ✓When you want free macro or forex data without an API key.
  • ✓When you need a fallback data source if another market data provider is unavailable.

Skill link

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/akshare/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/akshare/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Pull the daily prices for a Hong Kong stock over the last two years and show me the monthly trend.”

5 new skills a week. 1 minute to read.

How it works

The agent installs the AKShare Python library and calls the right function for the market you need, such as daily prices for A-shares or US stocks. It uses adjusted prices where appropriate and returns the data in a table it can analyze.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Overview

AKShare is a completely free, open-source Python financial data library. No registration or API key required. It aggregates data from public sources (Sina, East Money, etc.) covering Chinese and global markets.

Quick Start

import akshare as ak

# A-share daily OHLCV (前复权)
df = ak.stock_zh_a_hist(symbol="000001", period="daily",
                         start_date="20240101", end_date="20260101", adjust="qfq")

# US stock daily
df = ak.stock_us_hist(symbol="105.AAPL", period="daily",
                       start_date="20240101", end_date="20260101", adjust="qfq")

# HK stock daily
df = ak.stock_hk_hist(symbol="00700", period="daily",
                       start_date="20240101", end_date="20260101", adjust="qfq")

Top 10 High-Frequency Interfaces

A-shares

Function Description Key Params
stock_zh_a_hist() A-share OHLCV symbol, period, start_date, end_date, adjust
stock_zh_a_spot_em() Real-time A-share quotes (none)
stock_individual_info_em() Stock basic info symbol
stock_zh_a_hist_min_em() Intraday bars symbol, period(1/5/15/30/60)

US / HK

Function Description Key Params
stock_us_hist() US stock OHLCV symbol (e.g. "105.AAPL"), period, start_date, end_date
stock_hk_hist() HK stock OHLCV symbol (e.g. "00700"), period, start_date, end_date

Macro / Forex / Futures

Function Description
macro_china_gdp() China GDP data
macro_china_cpi() China CPI data
futures_main_sina() Futures main contract quotes
currency_boc_sina() BOC forex rates

Column Names

AKShare returns Chinese column names by default:

Chinese English Description
日期 date Trade date
开盘 open Open price
最高 high High price
最低 low Low price
收盘 close Close price
成交量 volume Volume
成交额 amount Turnover
涨跌幅 pct_change % change
换手率 turnover_rate Turnover rate

Date Format

  • Input: YYYYMMDD string (e.g. "20240101")
  • Output: 日期 column as string, convert with pd.to_datetime()

Symbol Format

  • A-shares: pure digits "000001" (no .SZ suffix)
  • US stocks: "105.AAPL" (NASDAQ prefix 105), "106.BABA" (NYSE prefix 106)
  • HK stocks: "00700" (5-digit zero-padded)

Built-in Loader

The project has a built-in AKShare DataLoader at backtest/loaders/akshare_loader.py. When backtesting, the runner automatically falls back to AKShare when tushare/yfinance are unavailable.

Reference Docs

For less common interfaces, see the references/ subdirectory or the official docs at https://akshare.akfamily.xyz/

FAQ

Does it need a paid account?

No. AKShare is free and needs no registration or API key.

Where does the data come from?

It collects public data from sources such as Sina and East Money.

Can it fill in when other sources fail?

Yes. The skill lists it as a primary fallback when other finance data sources are unavailable.

Details

Original description by the author

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

repo: HKUDS/Vibe-Trading

Popularity

GitHub stars
37k
Ranking position
#7496
License
MIT
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills