Jqdatasdk logo

Jqdatasdk

Organization
lzwme
jqdatasdk

聚宽(JoinQuant)本地数据 SDK,提供 A 股行情、历史K线、财务数据、指标数据等,与聚宽官网数据同源。当用户提及 jqdatasdk、聚宽数据、需要获取A股数据,或已注册聚宽账号时使用。与 baostock(免费)和 tushare(数据最全)不同,jqdatasdk 需注册聚宽账号获取 Token,适合已在使用聚宽平台的用户。本地数据获取请用本技能,聚宽官网策略开发请用 joinquant-strategy 技能。

Overview

Publisherlzwme
Repositoryfinance-quant-skills
Skill namejqdatasdk
Stars
461
Forks
85
Bundled files
7
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.

  • 7 bundled files

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

  • Open source

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

Installation

Install the Jqdatasdk 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/lzwme/finance-quant-skills/tree/main/skills/jqdatasdk
  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/lzwme/finance-quant-skills.git /tmp/finance-quant-skills
mkdir -p .claude/skills
cp -r /tmp/finance-quant-skills/skills/jqdatasdk .claude/skills/jqdatasdk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Jqdatasdk 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 Jqdatasdk 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 Jqdatasdk 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.

jqdatasdk 聚宽数据获取

任务目标

  • 本 Skill 用于:通过聚宽数据接口获取A股市场数据、财务指标和因子数据
  • 能力包含:实时行情、历史K线、财务数据、指标数据、股票信息、因子数据
  • 触发条件:用户提及聚宽、jqdata、jqdatasdk或需要获取A股数据、财务信息、因子数据时

与 joinquant-strategy 的区别:本技能是本地 Python 库(import jqdatasdk),用于在本地环境拉取聚宽数据;joinquant-strategy 面向聚宽官网策略环境(回测/模拟/研究,import jqdata),API 略有不同。二者不可混用(jqdatasdk 不能在官网策略中 import)。

前置准备

  • 依赖说明:安装 jqdatasdk 库(已包含在 dependency 中)
  • 凭证配置:需配置聚宽账号 Token(环境变量: JQDATA_TOKEN)或登录用户名及密码(环境变量: JQDATA_USERNAME、JQDATA_PASSWORD)
  • 账号申请:访问 https://www.joinquant.com/ 注册账号并获取 API Token(详见 references/jqdatasdk_quickstart.md)

操作步骤

  • 标准流程:
    1. 确定数据需求 — 智能体理解用户意图(行情/K线/财务/因子等)
    2. 调用对应脚本 — 根据数据类型选择脚本
    3. 解析结果 — 智能体分析返回的 JSON 格式数据
  • 脚本调用映射:
    • 行情/K线/实时数据 → python scripts/market_data.py --type price --code 000001.XSHE --start 2024-01-01 --end 2024-01-31
    • 财务数据/指标/估值 → python scripts/financial_data.py --type fundamentals --code 000001.XSHE --statDate 2024
    • 股票列表/信息 → python scripts/stock_info.py --type all_securities --security_type stock
    • 因子数据 → python scripts/factor_data.py --code 000001.XSHE --factor valuation --start 2024-01-01 --end 2024-01-31
  • 可选分支:
    • 当需要多只股票数据:使用 --code 参数逗号分隔
    • 当需要指定频率:使用 --frequency 参数(1min/5min/15min/30min/60min/120min/daily/weekly/monthly)
    • 当需要调整价格类型:使用 --fq_ref_date 参数或直接指定复权类型

使用示例

  • 示例1:获取股票日K线数据
    • 场景/输入:用户说"查看平安银行最近一个月的K线数据"
    • 预期产出:返回日期、开盘价、最高价、最低价、收盘价、成交量等OHLCV数据
    • 关键要点:调用 python scripts/market_data.py --type price --code 000001.XSHE --start 2024-03-01 --end 2024-03-31 --frequency daily
  • 示例2:查询财务指标
    • 场景/输入:用户说"获取招商银行2023年的财务指标"
    • 预期产出:返回PE、PB、ROE、营业收入、净利润等财务指标
    • 关键要点:调用 python scripts/financial_data.py --type indicators --code 600036.XSHG --statDate 2023
  • 示例3:获取因子数据
    • 场景/输入:用户说"查询贵州茅台的估值因子"
    • 预期产出:返回市盈率、市净率、市值等估值因子数据
    • 关键要点:调用 python scripts/factor_data.py --code 600519.XSHG --factor valuation --start 2024-01-01 --end 2024-03-31

快速参考

常用代码示例

python
import jqdatasdk as jq
import pandas as pd

# 认证(需先设置环境变量 JQDATA_TOKEN 或 JQDATA_USERNAME/JQDATA_PASSWORD)
jq.auth(os.environ.get('JQDATA_USERNAME', ''), os.environ.get('JQDATA_PASSWORD', ''))
# 或使用 Token: jq.auth(token='your_token')

# 获取日K线数据
df = jq.get_price('000001.XSHE', start_date='2024-01-01', end_date='2024-12-31',
                  frequency='daily', fields=['open', 'high', 'low', 'close', 'volume'])

# 获取财务数据
q = jq.query(jq.valuation).filter(jq.valuation.code == '000001.XSHE')
fundamentals = jq.get_fundamentals(q, date='2024-01-01')

资源索引

注意事项

  • 脚本执行需配置聚宽账号 Token 或登录用户名及密码,首次使用需先完成凭证配置
  • 聚宽股票代码格式:上海市场为 XXXXXX.XSHG,深圳市场为 XXXXXX.XSHE
  • 部分数据(如财务数据)可能有延迟,建议在交易日9:30-15:00之外获取
  • 脚本返回 JSON 格式数据,智能体负责解析并转换为用户友好的展示
  • 调用频率有限制,避免短时间内大量请求(详见聚宽官方文档)
  • 首次使用建议先读取 jqdatasdk_quickstart.md 完成认证配置

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 Jqdatasdk AI skill do?

聚宽(JoinQuant)本地数据 SDK,提供 A 股行情、历史K线、财务数据、指标数据等,与聚宽官网数据同源。当用户提及 jqdatasdk、聚宽数据、需要获取A股数据,或已注册聚宽账号时使用。与 baostock(免费)和 tushare(数据最全)不同,jqdatasdk 需注册聚宽账号获取 Token,适合已在使用聚宽平台的用户。本地数据获取请用本技能,聚宽官网策略开发请用 joinquant-strategy 技能。

Why use Jqdatasdk on TypingMind?

Because you install it once and use it with any model. Jqdatasdk 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 Jqdatasdk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lzwme/finance-quant-skills/tree/main/skills/jqdatasdk. 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 Jqdatasdk?

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 Jqdatasdk?

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

Is the Jqdatasdk AI skill free?

It is published on GitHub by lzwme. Check the repository for licensing terms. 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 👇