Skip to content
cccskills
FreePublished on GitHub

akshare

Retrieve stock prices, futures quotes, exchange rates, and economic indicators with the free Python library AKShare. The skill explains market-specific functions, symbol formats, and data preparation for analysis and testing strategies against historical data.

OriginalShow the original description

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

Works withYahoo Finance
See how to install

Good for

  • Retrieve historical prices for Chinese, US, and Hong Kong stocks
  • Collect Chinese GDP and consumer price data
  • Check futures quotes and foreign exchange rates
  • Use an alternative when tushare or yfinance is unavailable

Files included (1)

  • SKILL.md3.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

FunctionDescriptionKey Params
stock_zh_a_hist()A-share OHLCVsymbol, period, start_date, end_date, adjust
stock_zh_a_spot_em()Real-time A-share quotes(none)
stock_individual_info_em()Stock basic infosymbol
stock_zh_a_hist_min_em()Intraday barssymbol, period(1/5/15/30/60)

US / HK

FunctionDescriptionKey Params
stock_us_hist()US stock OHLCVsymbol (e.g. "105.AAPL"), period, start_date, end_date
stock_hk_hist()HK stock OHLCVsymbol (e.g. "00700"), period, start_date, end_date

Macro / Forex / Futures

FunctionDescription
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:

ChineseEnglishDescription
日期dateTrade date
开盘openOpen price
最高highHigh price
最低lowLow price
收盘closeClose price
成交量volumeVolume
成交额amountTurnover
涨跌幅pct_change% change
换手率turnover_rateTurnover 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/

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

adr-hshare

FreeSummary

Compare a Chinese company's US depositary receipts, Hong Kong shares, and mainland shares after adjusting for exchange rates and share ratios. Analyze pricing gaps, valuation differences, and delisting risks to support research into its different listings.

  • Compare A-share and H-share pricing gaps
  • Measure ADR premiums against Hong Kong shares
  • Review US delisting risks and Hong Kong listing alternatives
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

alpha-zoo

FreeSummary

Explore bundled libraries of investment factors, signals used to compare securities, and inspect individual formulas and metadata. Evaluate a factor or an entire library across a chosen universe and period, producing aggregate performance statistics and an HTML report.

  • Find bundled momentum or reversal factors
  • Inspect a named factor's formula and metadata
  • Compare a factor library across a chosen universe and period
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

Assess whether a Chinese A-share company may receive ST or *ST risk warnings next financial year. Review financial forecasts, dividends, audit opinions, and regulatory penalties, then report risk severity separately from confidence in the prediction.

  • Reviewing a Chinese A-share company's future ST risk
  • Assessing escalation risk for an existing ST or *ST stock
  • Checking revenue, equity, and dividend warning signs
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

asset-allocation

FreeSummary

Plan portfolio allocations across assets using risk, correlations, return forecasts, and trading costs. Compare five optimization methods, produce settings for config.json, and define rebalancing rules that adjust holdings back toward their target weights.

  • Comparing allocations across stocks, bonds, and gold
  • Choosing an optimizer based on return forecasts and correlations
  • Preparing portfolio settings for config.json
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

Diagnose failed or abnormal backtests, which test trading strategies on historical data. Inspect result files, strategy code, and configuration to identify bugs, make targeted repairs, rerun tests, and verify the updated metrics.

  • Investigating backtest execution errors
  • Finding why a strategy produces no trades
  • Checking delayed trades or low capital usage
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

Use investor psychology to examine trading signals and risk controls, especially in China A-shares. The skill provides sentiment measures, checklists for biased decisions, and frameworks for assessing momentum, which follows trends, and reversal strategies.

  • Reviewing market optimism and fear
  • Examining momentum and reversal strategies
  • Checking investment decisions for cognitive biases
HKUDS/Vibe-Trading36.2KUpdated Oct 21, 2026

See all skills by HKUDS

Report a problem with this skill