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

@helloxiaohu/plugin-stock-sector

v0.0.2

Published

行业板块插件 - 提供A股行业板块、概念板块、地域板块的行情数据、成分股和排名功能

Readme

@xpert-ai/plugin-stock-sector

行业板块插件 - 提供A股行业板块、概念板块、地域板块的行情数据、成分股和排名功能

功能特性

  • ✅ 板块行情查询(行业/概念/地域)
  • ✅ 板块成分股列表
  • ✅ 板块涨跌幅排名
  • ✅ 支持A股市场

安装

npm install @xpert-ai/plugin-stock-sector

配置

{
  source: 'eastmoney' | 'sina',  // 数据源(默认:eastmoney)
  timeout: 5000                   // 请求超时时间(毫秒,默认:5000)
}

工具说明

1. sector_quotes

获取板块实时行情数据

参数:

  • type: 板块类型
    • industry: 行业板块
    • concept: 概念板块
    • region: 地域板块
  • market: 市场筛选(可选)
    • SH: 上海
    • SZ: 深圳
    • HK: 香港

示例:

{
  type: 'industry'
}

返回:

[
  {
    "code": "BK0001",
    "name": "钢铁行业",
    "type": "industry",
    "change": 0.5,
    "changePercent": 1.23,
    "volume": 1234567,
    "amount": 9876543,
    "leadingStock": {
      "code": "600019",
      "name": "宝钢股份",
      "changePercent": 5.2
    }
  }
]

2. sector_constituents

获取板块成分股列表

参数:

  • sectorCode: 板块代码
  • limit: 返回数量限制(默认:20,最大:100)

示例:

{
  sectorCode: 'BK0001',
  limit: 30
}

返回:

[
  {
    "code": "600019",
    "name": "宝钢股份",
    "market": "SH",
    "weight": 0.15,
    "changePercent": 5.2
  }
]

3. sector_ranking

获取板块涨跌幅排名

参数:

  • type: 板块类型
  • sortBy: 排序字段(默认:changePercent)
    • changePercent: 按涨跌幅排序
    • turnover: 按成交额排序
  • limit: 返回数量(默认:10,最大:50)

示例:

{
  type: 'concept',
  sortBy: 'changePercent',
  limit: 10
}

返回:

[
  {
    "rank": 1,
    "code": "BK0051",
    "name": "新能源",
    "type": "concept",
    "changePercent": 5.8,
    "turnover": 123456789
  }
]

数据源

  • 东方财富: 提供完整的板块数据(默认)
  • 新浪财经: 备用数据源

开发

# 编译
pnpm exec tsc -p tsconfig.lib.json

# 测试
pnpm exec jest -c jest.config.ts --runInBand

许可证

MIT