AkShare Stock Data for Openclaw

An AI-ready financial data skill that uses Python's AkShare library to fetch real-time quotes, historical market data, financial statements, and valuation metrics for global stocks.

zhengr
v1.0.0
May 22, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install akshare-stock-pro

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install akshare-stock-pro using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is AkShare Stock Data?

The AkShare Stock Data skill is a high-performance integration designed to fetch comprehensive market data for A-shares, Hong Kong stocks (HK), and US equities directly within your AI workflow. By combining the power of the Python AkShare library with the extensibility of Openclaw Skills, developers and AI agents can seamlessly retrieve real-time quotes, historical trends, financial statements, shareholder details, and conceptual sectors.

Built for quantitative analysts, developers, and autonomous agents, this skill abstracts complex data fetching into clean CLI executions and custom Python scripts. It converts financial data pipelines into a highly accessible format (CSV or JSON), allowing downstream AI models to perform real-time stock analysis, portfolio valuation, and market sentiment evaluations without leaving their terminal environment.

AkShare Stock Data Use Cases

  • Real-time Market Monitoring: Query live quotes for SH/SZ A-shares, ChiNext, STAR Market, HKEX, and US stocks during trading hours.
  • Algorithmic Backtesting: Extract historical candlestick data (daily, weekly, monthly) with custom adjustments (forward/backward split-adjusted) to run quant models.
  • Fundamental Stock Analysis: Pull core financial statements (balance sheets, profit statements, cash flow statements) and key valuation indicators (PE, PB, dividend yields).
  • Market Sentiment & Flow Analysis: Track investor flow, concept sector rotations, limit-up pools, block trades, margin trading data, and ESG ratings.

How AkShare Stock Data Works

  1. Agent Request: The AI agent or developer initiates a command requesting specific stock data (e.g., historical price or financial indicators).
  2. Execution Hook: The system runs a Python execution wrapper calling the helper script at skills/akshare-stock/scripts/stock_data.py or executing Python dynamically.
  3. API Querying: The AkShare library retrieves structural market data from public endpoints (preferring stable sources like Eastmoney to prevent IP limitations).
  4. Data Formatting: The raw response is parsed, filtered, and serialized into developer-friendly formats like CSV or JSON.
  5. Downstream Consumption: The structured dataset is fed back to the AI model or saved locally for immediate quantitative analysis.

AkShare Stock Data Setup

Prerequisites

Make sure your environment meets the minimum version requirements:

  • Python 3.11+
  • Installed dependency: akshare library

Installation

Install the required Python package using pip:

pip install akshare --upgrade

Quick Start with Helper Script

You can use the predefined helper script to easily query multiple categories of financial data:

# Get real-time spot quotes for Shanghai and Shenzhen A-Shares
python3 skills/akshare-stock/scripts/stock_data.py spot

# Fetch historical data (Symbol, Start, End, Period, Adjustment)
python3 skills/akshare-stock/scripts/stock_data.py hist 600519 20250101 20250522 daily qfq

# Query balance sheet, profit, or cashflow statements
python3 skills/akshare-stock/scripts/stock_data.py financial 600519 balance report

# Pull concept board data and sectors
python3 skills/akshare-stock/scripts/stock_data.py board-concept

AkShare Stock Data Data Schema & Taxonomy

Data Identifiers & Parameters

When interacting with this skill, ensure you structure parameters according to the following schemas:

Stock Code Formats

Market Format Example Description
A-Shares 600519 Standard 6-digit numeric code
Xueqiu (Snowball) SH600519 Prefixed market code
HK Stocks 00700 Standard HKEX 5-digit code
US Stocks AAPL Standard US ticker symbol

Parameter Enumerations

  • Adjustment Options (adjust): "" (unadjusted), "qfq" (forward split-adjusted - recommended), "hfq" (backward split-adjusted)
  • Period Options (period): "daily", "weekly", "monthly"
  • Date Format: Standard YYYYMMDD (highly recommended for compatibility) or YYYY-MM-DD depending on the specific API endpoint.

AkShare Stock Data Advanced Features

  • Dynamic Code Execution: Execute raw Python blocks calling akshare directly to bypass helper limits and access any of the 372 detailed API endpoints.
  • IP Anti-Blocking Design: Preconfigured to prefer stable Eastmoney (EM) endpoints over Sina endpoints (which frequently trigger IP rate limits/bans) for robust automation.
  • Multi-market Interoperability: Seamlessly aggregate data across A-Shares, Hong Kong stock connect, and US capital markets using a unified command-line interface.
  • Comprehensive Macro and Micro Metrics: Access advanced market indicators including ESG ratings (MSCI, RepRisk, etc.), margin trading details, new IPO schedules, and block trade statistics.
  • Ready for Automation: Easily build automated quantitative triggers and notification pipelines by integrating with other Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*