Stock market API in JavaScript and TypeScript (Node, Bun, Deno)

By Faizan Ahmad. Updated .

The official Tradytics JavaScript and TypeScript SDK (npm install tradytics) runs with zero dependencies on Node 18+, Bun, Deno and edge runtimes using native fetch. One typed client covers US quotes and bars, options chains, stitched OPRA options flow, dealer gamma/vanna/charm, ranked dark pool prints, company fundamentals, SEC semantic search, earnings transcripts and Kalshi/Polymarket probabilities, starting on the Free tier (50 calls a day, no credit card).

Install and authenticate

npm install tradytics
export TRADYTICS_API_KEY="tdy_..."

Create a free key at tradytics.com/developer/keys.

Core TypeScript / JavaScript recipes

import Tradytics from 'tradytics'

const client = new Tradytics() // reads TRADYTICS_API_KEY

// 1. Stock quotes and OHLCV bars
const quotes = await client.stocks.quotes({ symbol: 'NVDA,AAPL,SPY' })
const bars = await client.stocks.bars({ symbol: 'SPY', timeframe: '5m', limit: 100 })

// 2. Options flow, chains and dealer gamma
const flow = await client.options.flow({ symbol: 'NVDA', min_premium: 1000000, opening: true })
const chain = await client.options.chain({ symbol: 'SPY', max_dte: 7 })
const gamma = await client.options.exposure({ symbol: 'SPY', greek: 'gamma', dte: 0 })

// 3. Ranked dark pools, fundamentals and semantic SEC filing search
const darkpool = await client.darkpool.prints({ symbol: 'AAPL', max_rank: 10 })
const income = await client.fundamentals.incomeStatement({ symbol: 'AAPL', period: 'quarter', limit: 8 })
const filings = await client.filings.search({ q: 'supply chain risks', symbol: 'AAPL', form: '10-K' })

Async pagination and live flow streaming

for await (const row of client.paginate(client.options.flow, { symbol: 'TSLA', min_premium: 500000 })) {
  console.log(row.time, row.type, row.strike, row.premium_usd)
}

for await (const row of client.stream(client.options.flow, { min_premium: 250000 })) {
  console.log(row.symbol, row.side, row.premium_usd)
}

Node.js MCP server (`npx -y tradytics-mcp`)

For Claude Desktop, Cursor, Cline, Windsurf or Node AI agents, run the zero-dependency stdio MCP bridge directly with TRADYTICS_API_KEY="tdy_..." npx -y tradytics-mcp, or connect via Streamable HTTP + OAuth at https://tradytics.com/mcp. Full docs at SDK libraries.

Common questions

Does the JavaScript SDK ship with TypeScript definitions?

Yes. Full .d.ts definitions are bundled in tradytics with typed methods for every endpoint resource.

Does it work in Cloudflare Workers, Vercel Edge, Bun and Deno?

Yes. The package is pure ESM with zero Node-specific dependencies, relying only on standard Web fetch.