npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-tool-market-data

v0.1.0

Published

DSH plugin: multi-market financial data — A-shares, US stocks, crypto. Quotes, K-lines, fundamentals, and screening.

Readme

dsh-tool-market-data

DSH 插件:多市场金融数据 — A 股、美股、加密货币行情/K 线/选股/基本面。

工具清单

| 工具 | 功能 | 数据源 | |------|------|--------| | market_quote | 实时行情(价格、涨跌幅、成交量) | A 股: 新浪 / 美股: Yahoo / 币: Binance | | market_kline | 历史 K 线(OHLCV) | A 股: 东方财富 / 美股: Yahoo / 币: Binance | | market_screen | 条件选股(涨幅、换手、市值) | A 股: 东方财富 | | market_fundamentals | 基本面(PE/PB/ROE/营收/利润) | A 股: 东方财富 / 美股: Yahoo |

安装

dsh plugin add dsh-tool-market-data

配置

- insert:
    - id: market-data
      name: dsh-tool-market-data
      config:
        defaultMarket: cn              # cn | us | crypto
        binanceBaseUrl: https://api.binance.com

市场自动识别

无需手动指定 market,插件根据 symbol 格式自动判断:

| 格式 | 识别为 | 示例 | |------|--------|------| | 6 位数字 | A 股 | 600519(茅台)、000001(平安) | | 英文字母 | 美股 | AAPL、TSLA、NVDA | | 币种名/USDT 后缀 | 加密货币 | BTC、ETHUSDT |

使用示例

实时行情

Agent: → market_quote({ symbol: "600519" })
{
  "symbol": "600519",
  "name": "贵州茅台",
  "price": 1856.00,
  "changePercent": 1.23,
  "volume": 2834500,
  ...
}

K 线数据

Agent: → market_kline({ symbol: "AAPL", period: "1d", limit: 30 })
返回最近 30 根日 K 线,含 summary(最高/最低/均量)+ bars 数组

条件选股

Agent: → market_screen({ conditions: { minChangePercent: 5, minTurnover: 3 }, sortBy: "changePercent", limit: 10 })
返回今日涨幅 > 5% 且换手率 > 3% 的前 10 只 A 股

基本面

Agent: → market_fundamentals({ symbol: "NVDA" })
{
  "pe": 65.3,
  "pb": 42.1,
  "roe": 0.89,
  "revenue": 60922000000,
  "profitMargin": 0.55,
  ...
}

支持的 K 线周期

| 周期 | 参数 | A 股 | 美股 | 加密 | |------|------|------|------|------| | 1 小时 | 1h | ✗ | ✗ | ✓ | | 4 小时 | 4h | ✗ | ✗ | ✓ | | 日线 | 1d | ✓ | ✓ | ✓ | | 周线 | 1w | ✓ | ✓ | ✓ | | 月线 | 1m | ✓ | ✓ | ✗ |

数据延迟说明

| 市场 | 延迟 | 说明 | |------|------|------| | A 股 | 盘中实时(新浪)/ 收盘后无延迟 | 免费接口可能有 3-5 秒延迟 | | 美股 | 15 分钟延迟 | Yahoo Finance 免费版限制 | | 加密 | 实时 | Binance 公开 API 无延迟 |

License

MIT — 数据来源于公开免费 API,使用需遵守各平台服务条款。