---
title: "Stock market API in JavaScript and TypeScript (Node, Bun, Deno) | Tradytics"
description: "Install npm install tradytics (zero dependencies, full TypeScript types) to fetch US quotes, historical bars, options chains, options flow, dealer gamma, dark pools, fundamentals and SEC filings in Node, Bun or Deno."
url: "https://tradytics.com/learn/stock-market-api-javascript"
image: "https://tradytics.com/api/v2/og/learn.png?id=stock-market-api-javascript"
---

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

By [Faizan Ahmad](https://tradytics.com/learn/about-tradytics-research). Updated 2026-11-24.

**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](https://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](https://tradytics.com/docs/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`.

## Get the Tradytics API

Stock data, company research, options flow, dark pools, dealer exposure, prediction markets and more through REST and MCP. Free gets 5 calls a minute and 50 a day. Plus gets 10 a minute and 1,000 a day. Pro gets 300 a minute and 50,000 a day.

[Read the API docs](https://tradytics.com/docs)

Using Claude, ChatGPT or Cursor? [Connect Tradytics MCP free](https://tradytics.com/docs/mcp).

- [Tradytics Learn](https://tradytics.com/learn)
- [Insider trading, 13F institutional holdings and Congress trades API](https://tradytics.com/learn/insider-trading-api)
- [Stock market API in Python: quotes, options flow, dark pools and SEC filings](https://tradytics.com/learn/stock-market-api-python)
- [Pay-per-call stock market data API with x402 (USDC on Base)](https://tradytics.com/learn/x402-market-data-api)
- [Stock fundamentals, revenue segments and earnings transcripts API](https://tradytics.com/learn/stock-fundamentals-api)
- [Options chain, Greeks, open interest and dealer gamma API](https://tradytics.com/learn/options-chain-api)
- [SEC filings API: 10-K, 10-Q, 8-K sections and semantic passage search](https://tradytics.com/learn/sec-filings-api)
- [Read the data without JavaScript](https://tradytics.com/learn/stock-market-api-javascript?snapshot=1)
