stock-info

stock-info is a skill for Claude Code, Codex from idea2realClaw/myAgent. It costs 0 tokens per session (700 once invoked), scanned A, original, MIT.

A tool for retrieving current prices and company financial details for stocks listed in mainland China, Hong Kong, and the United States. It includes market data, share counts, valuation measures, dividends, and market values.

In plain words
What is it for?
Use it to look up one or more stock symbols, compare basic financial information, or call the data from Python code.
Why use it?
It gathers several commonly needed stock fields in one result and handles market-value calculations that can otherwise be confused by different data units.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to look up one or more stock symbols, compare basic financial information, or call the data from Python code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/idea2realclaw/myagent/stock-info
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add idea2realClaw/myAgent --skill stock-info
Clone the repo
git clone --depth 1 https://github.com/idea2realClaw/myAgent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stock-info

README.md
[![agentmods](https://agentmods.dev/badge/skills/idea2realclaw/myagent/stock-info/github.svg)](https://agentmods.dev/skills/idea2realclaw/myagent/stock-info)
Your own site
<a href="https://agentmods.dev/skills/idea2realclaw/myagent/stock-info"><img src="https://agentmods.dev/badge/skills/idea2realclaw/myagent/stock-info/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stock-info

Your own site · 80×15
<a href="https://agentmods.dev/skills/idea2realclaw/myagent/stock-info"><img src="https://agentmods.dev/badge/skills/idea2realclaw/myagent/stock-info.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 700 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00700
Opus 5 $0.00000 $0.00350
Sonnet 5 $0.00000 $0.00140
Haiku 4.5 $0.00000 $0.00070

Measured 9d ago against content hash 3a71f7512d90, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

stock-info scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/get_stock_info.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/stock-info/SKILL.md · 76 lines

What it actually says

stock-info: 股票基本信息获取

功能说明

获取A股/港股/美股的实时行情和基本面数据。

数据来源

  • 实时行情:腾讯API (qt.gtimg.cn)
  • 财务数据:东方财富API (push2.eastmoney.com)

支持数据

类别 字段
行情 当前价、涨跌幅、今开、昨收、最高、最低、换手率
股本 总股本、流通股本(单位:股)
市值 总市值(元)、流通市值(元)
估值 市盈率TTM、动态市盈率、市净率(PB)、股息率

市值计算说明

总市值 = 东方财富API f116(元,直接获取)
流通市值 = 当前价 × 流通股本 f85(股)

重要教训:东方财富API的f162/f163字段单位不是简单的"万元"或"亿元",容易混淆。正确做法是:

  • 总市值用API的f116直接值(已经是元)
  • 流通市值用 Python 计算:股价 × 流通股本

使用示例

单只股票

python3 scripts/get_stock_info.py 002361

多只股票

python3 scripts/get_stock_info.py 002361 600519 000858

Python调用

from scripts.get_stock_info import get_stock_info, format_stock_info

# 获取信息
stocks = get_stock_info(['002361', '600519'])

# 格式化输出
for stock in stocks:
    print(format_stock_info(stock))

API字段对照表

字段 说明 单位 示例
f57 股票代码 - 002361
f58 股票名称 - 神剑股份
f84 总股本 951034969
f85 流通股本 809122984
f116 总市值 12972116977
f167 市净率 ×100 586 → 5.86
f173 股息率 % 1.36
f176 市盈率TTM ×10 531 → 53.1
f177 动态市盈率 ×10 1089 → 108.9

常见问题

Q: 财务数据获取失败?

A: 可能是网络问题,东方财富API有时不稳定。脚本会自动重试3次。行情数据通常不受影响。

Q: 市值数据不准确?

A: 请确保使用的是正确的公式:流通市值 = 股价 × 流通股本。不要直接使用API返回的f162/f163字段,容易混淆单位。

触发词

股票信息、基本面、市值、股本、财务数据、PE、PB

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 76 lines · 0 tokens per session scan A 3a71f7512d90

Subscribe to this mod's changes

stock-info is a skill published in the GitHub repository idea2realClaw/myAgent (2 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 700 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories