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-sina-stock

v0.0.1

Published

`@xpert-ai/plugin-sina-stock` is a stock quote plugin that enables XpertAI agents to fetch real-time A-share and Hong Kong stock data via the Sina Finance API. It provides free, no-API-key-required access to stock market data including prices, trading vol

Readme

Xpert Plugin: Sina Stock

Overview

@xpert-ai/plugin-sina-stock is a stock quote plugin that enables XpertAI agents to fetch real-time A-share and Hong Kong stock data via the Sina Finance API. It provides free, no-API-key-required access to stock market data including prices, trading volume, and price changes.

Features

  • Fetches real-time stock quotes for A-shares (Shanghai and Shenzhen) and Hong Kong stocks
  • Uses the free Sina Finance API - no API key required
  • Supports multiple stock codes in a single request
  • Returns formatted human-readable results including:
    • Current price
    • Price change and percentage
    • Open, high, low, previous close prices
    • Trading volume and amount
    • Update timestamp
  • Provides two tools:
    • sina_stock_quotes: Get quotes for multiple stocks
    • sina_stock_detail: Get detailed quote for a single stock (JSON format)

Installation

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

Peer dependencies: ensure the host environment already provides @xpert-ai/plugin-sdk, @nestjs/common, @nestjs/config, @langchain/core, chalk, and zod in the versions listed in package.json.

Configuration

This plugin has no runtime configuration. The strategy publishes an empty JSON schema, so you can register the toolset without credentials or additional options.

| Option | Type | Required | Description | | --- | --- | --- | --- | | none | – | – | The sina-stock toolset works out of the box. |

Usage

  1. Add the plugin to the PLUGINS environment variable so that the XpertAI host loads it:

    PLUGINS=@xpert-ai/plugin-sina-stock
  2. Create a toolset instance (via the XpertAI admin UI or API) referencing the sina-stock provider:

    {
      "provider": "sina-stock",
      "options": {}
    }
  3. Once attached to an agent, the tools become available to the LLM.

Stock Code Format

  • Shanghai A-shares: sh + 6-digit code (e.g., sh600519 for Kweichow Moutai)
  • Shenzhen A-shares: sz + 6-digit code (e.g., sz000001 for Ping An Bank)
  • Hong Kong stocks: hk + 5-digit code (e.g., hk00700 for Tencent)

Example Usage

Get multiple stock quotes:

Input: 600519, 000001, 00700
Output:
【贵州茅台(sh600519)】
  当前价: 1688.00 元
  涨跌额: +10.00 元
  涨跌幅: +0.60%
  ...

Get single stock detail:

Input: 600519
Output: (JSON format with all stock details)

Sina Finance API

This plugin uses the free Sina Finance API:

  • Endpoint: https://hq.sinajs.cn/list=sh600519,sz000001,hk00700
  • Rate Limit: Please respect reasonable usage limits
  • Data: Real-time delayed data (15-30 minutes)

Development

From the monorepo root (xpertai/), use Nx to build or test:

npx nx build @xpert-ai/plugin-sina-stock
npx nx test @xpert-ai/plugin-sina-stock

Or directly:

cd tools/sina-stock
corepack pnpm exec tsc -p tsconfig.lib.json
corepack pnpm exec jest -c jest.config.ts

License

MIT – see the repository root LICENSE.