Astock Data Source logo

Astock Data Source

Community
ZICXR
astock-data-source

A 股多源数据源统一管理 (v2.0 - 多源 fallback)。当用户需要获取股票行情/K线/财务数据/新闻/公告/资金流等任何 A 股数据,或需要稳定的 API 封装 (含自动重试/限流/降级/缓存) 时,Claude 应优先使用此 Skill。这是其他所有 Skill 的基础数据源。**v2.0 已修复住宅 IP 数据源问题**。

Overview

PublisherZICXR
RepositoryA-Stock-Skills
Skill nameastock-data-source
Stars
32
Forks
6
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ZICXR on GitHub. Read the source before you install it.

Installation

Install the Astock Data Source AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ZICXR/A-Stock-Skills/tree/main/skills/01-infra/astock-data-source
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ZICXR/A-Stock-Skills.git /tmp/A-Stock-Skills
mkdir -p .claude/skills
cp -r /tmp/A-Stock-Skills/skills/01-infra/astock-data-source .claude/skills/astock-data-source
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Astock Data Source in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Astock Data Source on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Astock Data Source is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

A 股多源数据源管理 Skill (v2.0)

何时使用

  • 用户需要获取股票数据
  • 用户需要稳定的 API 封装
  • 用户在住宅网络环境下使用
  • 任何需要 A 股数据的 Skill

⚠️ 重要更新 (v2.0)

修复了住宅 IP 数据源被封问题:

优先级数据源实测可用备注
1️⃣ifzq gtimg (腾讯)✅ 90%+住宅 IP 首选
2️⃣新浪 hq.sinajs.cn✅ 80%+全市场列表也用这个
3️⃣东财 push2.eastmoney❌ 30%经常被封, 仅作备用
4️⃣akshare✅ 85%聚合源, fallback

自动 fallback 机制:

  • 每个数据源连续失败 3 次自动跳过
  • 支持多源切换, 不再硬抛"所有数据源失败"
  • 修复了 Windows GBK 编码问题
  • 修复了 akshare 内部代理问题

🏃 快速验证 (网络环境测试)

bash
# 测试你的网络环境
python main.py healthcheck

# 输出示例:
# === 数据源健康检查 ===
#   ✅ ifzq_gtimg
#   ✅ sina_hq
#   ❌ eastmoney_push2 (被风控, 已自动跳过)
#   ✅ sina 全市场: 5028 只

提供能力

行情

  • get-realtime --code X - 单股实时 (多源)
  • get-realtime-all - 全 A 股实时 (用新浪)
  • get-kline --code X --days N - K 线 (用 ifzq)

指数

  • get-index-realtime - 主要指数
  • get-index-kline --symbol X - 指数 K 线

其他

  • get-stock-info --code X - 股票信息
  • get-news --code X - 个股新闻
  • healthcheck - 数据源健康检查

使用方式

命令行 (新规范)

bash
# ✅ 正确: 用 --code 命名参数
python main.py get-realtime --code 601991
python main.py get-kline --code 601991 --days 60

# ✅ 正确: --list 列出方法
python main.py --list

# ❌ 旧版 (已废弃): 位置参数
python main.py get-realtime 601991

Python API

python
from skills.01-infra.astock-data-source.main import (
    get_realtime, get_realtime_all, get_kline
)

# 单股 (自动多源 fallback)
quote = get_realtime("601991")

# 全 A 股
all_stocks = get_realtime_all()

# K 线
df = get_kline("601991", days=60)

故障速查

现象原因解决
ProxyError: 7890代理挡住外网切到 ifzq/sina
RemoteDisconnected东财被封等待 3 次后自动切
UnicodeEncodeError (Win)GBK 编码已自动修复
所有数据源失败网络隔离运行 healthcheck 检查

依赖

requests>=2.28.0
akshare>=1.12.0
pandas>=1.5.0

实测状态

  • 2026-06-21: 住宅 IP 验证通过, ifzq + sina 稳定可用
  • 2026-05-03: 旧版在住宅 IP 100% 失败 (已修复)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Astock Data Source AI skill do?

A 股多源数据源统一管理 (v2.0 - 多源 fallback)。当用户需要获取股票行情/K线/财务数据/新闻/公告/资金流等任何 A 股数据,或需要稳定的 API 封装 (含自动重试/限流/降级/缓存) 时,Claude 应优先使用此 Skill。这是其他所有 Skill 的基础数据源。**v2.0 已修复住宅 IP 数据源问题**。

Why use Astock Data Source on TypingMind?

Because you install it once and use it with any model. Astock Data Source is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Astock Data Source in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ZICXR/A-Stock-Skills/tree/main/skills/01-infra/astock-data-source. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Astock Data Source?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Astock Data Source?

As many as you like. As long as a model supports skills, you can use Astock Data Source with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Astock Data Source AI skill free?

Yes. It is published on GitHub by ZICXR under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇