Skip to content

Stock SDKStock Market SDK for Browser and Node.js

Zero dependencies, Lightweight distribution, and a single API for quotes, K-line, indicators, futures, options, and AI / MCP workflows

v1.10.1MITZero deps
CONNECTINGLive Market--:--:--
上证指数3,421.55+0.82%
深证成指10,876.40-0.34%
创业板指2,215.18+1.15%
贵州茅台1,689.50+0.45%
五粮液147.23-1.04%
中国平安54.30+0.61%
via stock-sdk · Tencent

Get Quotes in 10 Lines

ts
import { StockSDK } from 'stock-sdk';

const sdk = new StockSDK();
const quotes = await sdk.getSimpleQuotes(['sh000001', 'sz000858', 'sh600519']);

quotes.forEach((item) => {
  console.log(`${item.name}: ${item.price} (${item.changePercent}%)`);
});

Apply Provider-level Governance

ts
const sdk = new StockSDK({
  timeout: 8000,
  providerPolicies: {
    eastmoney: {
      timeout: 12000,
      rateLimit: {
        requestsPerSecond: 3,
        maxBurst: 3,
      },
    },
    tencent: {
      rateLimit: {
        requestsPerSecond: 8,
        maxBurst: 16,
      },
    },
  },
});

Good Fits

  • Frontend quote dashboards and charting
  • Node.js scheduled jobs and trading-day workflows
  • Quant prototypes and indicator analysis
  • Futures, options, and dividend event dashboards
  • AI agents that need live market data through MCP

Continue Reading

Released under the ISC License.