tradytics 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +167 -16
  2. package/package.json +1 -1
  3. package/version.js +1 -1
package/README.md CHANGED
@@ -1,19 +1,38 @@
1
+ <p align="center">
2
+ <a href="https://tradytics.com/docs"><img src="https://tradytics.com/api/v2/og/sdk.png" alt="Tradytics: one API for options flow, dark pools and the market" width="100%"></a>
3
+ </p>
4
+
1
5
  # Tradytics for JavaScript
2
6
 
3
- The official JavaScript and TypeScript client for the [Tradytics API](https://tradytics.com/docs): live and historical options flow, dark pool prints ranked against a year, dealer gamma, delta, vanna and charm, the options market, research on every symbol, the scanner, Signals, Kalshi and Polymarket, and the AI Fund. One method per endpoint, typed, no dependencies. Node 18+, Bun, Deno and edge runtimes.
7
+ The official JavaScript and TypeScript client for the [Tradytics API](https://tradytics.com/docs): options flow from the full OPRA tape, dark pool prints ranked against a year, dealer gamma, delta, vanna and charm, and the whole market around them. <!-- sdk:count -->78<!-- /sdk:count --> endpoints, one typed method each, no dependencies.
8
+
9
+ [![npm](https://img.shields.io/npm/v/tradytics?color=168eff&label=npm)](https://www.npmjs.com/package/tradytics)
10
+ [![types](https://img.shields.io/badge/types-included-16171a)](https://www.npmjs.com/package/tradytics)
11
+ [![PyPI](https://img.shields.io/pypi/v/tradytics?color=168eff&label=pypi)](https://pypi.org/project/tradytics/)
12
+ [![Endpoints](https://img.shields.io/badge/endpoints-78-16171a)](https://tradytics.com/docs)
13
+ [![Docs](https://img.shields.io/badge/docs-tradytics.com-16171a)](https://tradytics.com/docs)
14
+ [![License](https://img.shields.io/badge/license-MIT-16171a)](https://opensource.org/license/mit)
4
15
 
5
16
  ```bash
6
17
  npm install tradytics
7
18
  ```
8
19
 
9
- The API is part of Tradytics Pro. Make a key at [tradytics.com/developer/keys](https://tradytics.com/developer/keys) and export it:
20
+ ## What you get
21
+
22
+ - **Options flow**: every print of $25K+ from the full OPRA tape (every US options exchange), live and back to March 2025, with side, sweep or block, and whether it opened a position.
23
+ - **Dark pool**: block and off-exchange prints as they happen, each ranked against a year of its kind, and the levels where size traded.
24
+ - **Dealer exposure**: gamma, delta, vanna and charm by strike for about 2,500 symbols, every five minutes, with the change since yesterday, a week and two weeks.
25
+ - **The market**: quotes and bars from 1 second to 1 month, breadth, sectors, movers, the options market, research, the full-market scanner, Signals, Kalshi and Polymarket odds and the AI Fund.
26
+ - **Runs anywhere `fetch` does**: Node 18+, Bun, Deno and edge runtimes. ESM, typed parameters, retries on rate limits, paging and live streaming built in.
27
+
28
+ ## Quickstart
29
+
30
+ The API is part of Tradytics Pro. Make a key at [tradytics.com/developer/keys](https://tradytics.com/developer/keys), then:
10
31
 
11
32
  ```bash
12
33
  export TRADYTICS_API_KEY="tdy_..."
13
34
  ```
14
35
 
15
- ## Quickstart
16
-
17
36
  ```js
18
37
  import Tradytics from 'tradytics'
19
38
 
@@ -21,23 +40,38 @@ const client = new Tradytics() // reads TRADYTICS_API_KEY
21
40
 
22
41
  const flow = await client.options.flow({ symbol: 'NVDA', min_premium: 1_000_000, opening: true })
23
42
  for (const p of flow.data) console.log(p.time, p.symbol, p.type, p.strike, p.expiry, p.premium)
24
-
25
- const bars = await client.symbols.bars('SPY', { timeframe: '5m', limit: 500 })
26
- const gamma = await client.options.exposure('SPY', { greek: 'gamma' })
27
- const prints = await client.darkpool.prints({ symbol: 'AAPL', min_value: 5_000_000 })
28
43
  ```
29
44
 
30
- Objects come back as `{ data, as_of }`, lists as `{ data, count, next_cursor }`, the same JSON the API returns.
45
+ Objects come back as `{ data, as_of }` and lists as `{ data, count, next_cursor }`, the same JSON as the [REST API](https://tradytics.com/docs). Keep the key on a server: anyone holding it uses your quota.
31
46
 
32
- ## Resources
47
+ ## Examples
33
48
 
34
- `client.symbols`, `client.market`, `client.options`, `client.darkpool`, `client.research`, `client.scanner`, `client.signals`, `client.probabilities`, `client.fund` and `client.account`, one method per endpoint, with every parameter typed and described. [The docs](https://tradytics.com/docs) have every field.
49
+ ```js
50
+ // Biggest dark pool prints today, and the year's largest for one stock
51
+ await client.darkpool.prints({ min_value: 10_000_000 })
52
+ await client.darkpool.ranked('AAPL', { kind: 'trade', sort: 'big' })
53
+
54
+ // Dealer gamma by strike, and the SPX call wall, put wall and gamma flip
55
+ await client.options.exposure('SPY', { greek: 'gamma' })
56
+ await client.options.index_gamma({ symbol: 'SPX' })
57
+
58
+ // Five-minute bars, a year of daily bars
59
+ await client.symbols.bars('TSLA', { timeframe: '5m', limit: 500 })
60
+ await client.symbols.bars('SPY', { timeframe: '1d', limit: 252 })
61
+
62
+ // Scan the market on any field
63
+ await client.scanner.scan({ min_rvol: 2, max_rsi: 30, sort: 'oprem', limit: 25 })
64
+
65
+ // Live signals, and the market's options read today
66
+ await client.signals.list({ status: 'open' })
67
+ await client.options.read()
68
+ ```
35
69
 
36
70
  ## Every page
37
71
 
38
72
  ```js
39
73
  for await (const p of client.paginate(client.options.flow_history, { symbol: 'TSLA', min_premium: 500_000 })) {
40
- // ...
74
+ console.log(p.time, p.premium)
41
75
  }
42
76
  ```
43
77
 
@@ -49,10 +83,127 @@ for await (const p of client.stream(client.options.flow, { min_premium: 250_000
49
83
  }
50
84
  ```
51
85
 
52
- `client.stream` works with `client.options.flow` and `client.darkpool.prints`, and yields each print once.
86
+ `stream` works with `client.options.flow` and `client.darkpool.prints`, polls every two seconds and yields each print once, oldest first.
53
87
 
54
- ## Errors and limits
88
+ ## Errors, retries and limits
55
89
 
56
- Calls that fail throw `TradyticsError` with `status`, `code` (e.g. `missing_scope`, `invalid_parameter`), `message` and `requestId`. Rate limits (300 calls a minute, 50,000 a day per key) and brief outages are retried for you, honoring `Retry-After`. `new Tradytics({ apiKey, timeout: 30_000, maxRetries: 3 })` changes the defaults. Keep the key on a server: anyone holding it uses your quota.
90
+ ```js
91
+ import Tradytics, { TradyticsError } from 'tradytics'
92
+
93
+ try {
94
+ await client.options.flow({ symbol: 'NVDA', limit: 5000 })
95
+ } catch (e) {
96
+ if (e instanceof TradyticsError) console.log(e.status, e.code, e.message, e.requestId) // 400 invalid_parameter ...
97
+ }
98
+ ```
57
99
 
58
- Docs: [tradytics.com/docs](https://tradytics.com/docs). MCP server for Claude, ChatGPT and Cursor: [tradytics.com/docs/mcp](https://tradytics.com/docs/mcp).
100
+ Each key gets 300 calls a minute and 50,000 a day. A `429` or `5xx` answer is retried up to three times, waiting as `Retry-After` says; the daily quota isn't retried. `new Tradytics({ apiKey, timeout: 30_000, maxRetries: 3 })` changes the defaults, and `client.get('/any/path', params)` calls any endpoint by path.
101
+
102
+ ## Reference
103
+
104
+ <details>
105
+ <summary>Every method, by resource</summary>
106
+
107
+ <!-- sdk:reference -->
108
+ | Method | Request | Name |
109
+ | --- | --- | --- |
110
+ | **symbols** | | |
111
+ | `symbols.list(params)` | `GET /symbols` | List symbols |
112
+ | `symbols.get(symbol)` | `GET /symbols/{symbol}` | Symbol |
113
+ | `symbols.quotes(params)` | `GET /quotes` | Quotes |
114
+ | `symbols.bars(symbol, params)` | `GET /symbols/{symbol}/bars` | Bars |
115
+ | `symbols.news(symbol)` | `GET /symbols/{symbol}/news` | Symbol news |
116
+ | **market** | | |
117
+ | `market.assets()` | `GET /market/assets` | Major assets |
118
+ | `market.breadth()` | `GET /market/breadth` | Market breadth |
119
+ | `market.sectors()` | `GET /market/sectors` | Sectors |
120
+ | `market.heatmap()` | `GET /market/heatmap` | Heatmap |
121
+ | `market.themes()` | `GET /market/themes` | Themes |
122
+ | `market.movers()` | `GET /market/movers` | Movers |
123
+ | `market.crypto()` | `GET /market/crypto` | Crypto |
124
+ | `market.crypto_sectors()` | `GET /market/crypto/sectors` | Crypto sectors |
125
+ | `market.digest()` | `GET /market/digest` | Market digest |
126
+ | `market.news()` | `GET /news` | Market news |
127
+ | `market.earnings_calendar()` | `GET /calendar/earnings` | Earnings calendar |
128
+ | `market.insiders()` | `GET /insiders` | Insider trades |
129
+ | `market.congress()` | `GET /congress` | Congress trades |
130
+ | **options** | | |
131
+ | `options.flow(params)` | `GET /options/flow` | Options flow |
132
+ | `options.flow_history(params)` | `GET /options/flow/history` | Options flow history |
133
+ | `options.sentiment(params)` | `GET /market/options/sentiment` | Options sentiment |
134
+ | `options.pressure()` | `GET /market/options/pressure` | Buying pressure |
135
+ | `options.index_gamma(params)` | `GET /market/options/gamma` | Index dealer gamma |
136
+ | `options.put_call()` | `GET /market/options/put-call` | Put/call premium |
137
+ | `options.leaders()` | `GET /market/options/leaders` | Flow leaders |
138
+ | `options.sectors()` | `GET /market/options/sectors` | Flow by sector |
139
+ | `options.top_prints()` | `GET /market/options/top-prints` | Top prints |
140
+ | `options.contracts()` | `GET /market/options/contracts` | Most traded contracts |
141
+ | `options.iv()` | `GET /market/options/iv` | Implied volatility movers |
142
+ | `options.zero_dte(params)` | `GET /market/options/zero-dte` | 0DTE flow |
143
+ | `options.zero_dte_gamma(params)` | `GET /market/options/zero-dte/gamma` | 0DTE dealer gamma |
144
+ | `options.read()` | `GET /market/options/read` | Options market read |
145
+ | `options.bets()` | `GET /market/options/bets` | Big bets |
146
+ | `options.unusual()` | `GET /market/options/unusual` | Unusual opening bets |
147
+ | `options.chains()` | `GET /market/options/chains` | Contract lists |
148
+ | `options.evidence()` | `GET /market/options/evidence` | Tested market facts |
149
+ | `options.overview(symbol)` | `GET /symbols/{symbol}/options` | Options overview |
150
+ | `options.net_flow(symbol)` | `GET /symbols/{symbol}/options/flow` | Net flow today |
151
+ | `options.gamma(symbol)` | `GET /symbols/{symbol}/options/gamma` | Dealer gamma |
152
+ | `options.volatility(symbol)` | `GET /symbols/{symbol}/options/volatility` | Volatility |
153
+ | `options.open_interest(symbol, params)` | `GET /symbols/{symbol}/options/open-interest` | Open interest |
154
+ | `options.expiries(symbol)` | `GET /symbols/{symbol}/options/expiries` | Premiums heatmap |
155
+ | `options.orders(symbol)` | `GET /symbols/{symbol}/options/orders` | Largest and unusual orders |
156
+ | `options.history(symbol)` | `GET /symbols/{symbol}/options/history` | Daily flow history |
157
+ | `options.exposure(symbol, params)` | `GET /symbols/{symbol}/options/exposure` | Dealer exposure |
158
+ | `options.exposure_history(symbol, params)` | `GET /symbols/{symbol}/options/exposure/history` | Dealer exposure history |
159
+ | **darkpool** | | |
160
+ | `darkpool.prints(params)` | `GET /darkpool/prints` | Dark pool prints |
161
+ | `darkpool.history(params)` | `GET /darkpool/history` | Dark pool history |
162
+ | `darkpool.levels(symbol)` | `GET /symbols/{symbol}/darkpool` | Dark pool levels |
163
+ | `darkpool.ranked(symbol, params)` | `GET /symbols/{symbol}/darkpool/ranked` | Ranked dark pool prints |
164
+ | **research** | | |
165
+ | `research.summary(symbol)` | `GET /symbols/{symbol}/summary` | Summary |
166
+ | `research.analysts(symbol)` | `GET /symbols/{symbol}/analysts` | Analysts |
167
+ | `research.earnings(symbol)` | `GET /symbols/{symbol}/earnings` | Earnings |
168
+ | `research.financials(symbol)` | `GET /symbols/{symbol}/financials` | Financials |
169
+ | `research.technicals(symbol)` | `GET /symbols/{symbol}/technicals` | Technicals |
170
+ | `research.ownership(symbol)` | `GET /symbols/{symbol}/ownership` | Ownership |
171
+ | `research.holdings(symbol)` | `GET /symbols/{symbol}/holdings` | Fund holdings |
172
+ | **scanner** | | |
173
+ | `scanner.scan(params)` | `GET /scanner` | Scan the market |
174
+ | `scanner.fields()` | `GET /scanner/fields` | Scanner fields and labels |
175
+ | `scanner.symbol(symbol)` | `GET /symbols/{symbol}/scan` | Symbol scan |
176
+ | **signals** | | |
177
+ | `signals.list(params)` | `GET /signals` | List signals |
178
+ | `signals.get(id)` | `GET /signals/{id}` | Signal |
179
+ | **probabilities** | | |
180
+ | `probabilities.list(params)` | `GET /probabilities` | List questions |
181
+ | `probabilities.get(id)` | `GET /probabilities/{id}` | Question |
182
+ | `probabilities.history(market, params)` | `GET /probabilities/markets/{market}/history` | Outcome history |
183
+ | `probabilities.outlook()` | `GET /probabilities/outlook` | S&P 500 outlook |
184
+ | `probabilities.track()` | `GET /probabilities/track` | Index closes scored |
185
+ | `probabilities.settled(params)` | `GET /probabilities/settled` | Settled markets |
186
+ | **fund** | | |
187
+ | `fund.summary()` | `GET /fund` | The fund now |
188
+ | `fund.trades(params)` | `GET /fund/trades` | Fund trades |
189
+ | `fund.posts(params)` | `GET /fund/posts` | Fund posts |
190
+ | **account** | | |
191
+ | `account.backtests(params)` | `GET /backtests` | Your backtests |
192
+ | `account.backtest(id)` | `GET /backtests/{id}` | A backtest |
193
+ | `account.portfolio()` | `GET /portfolio` | Your portfolio |
194
+ | `account.portfolio_trades()` | `GET /portfolio/trades` | Your trades |
195
+ | `account.portfolio_factors()` | `GET /portfolio/factors` | Your portfolio's factors |
196
+ | `account.dashboards()` | `GET /dashboards` | Your dashboards |
197
+ | `account.dashboard(id)` | `GET /dashboards/{id}` | A dashboard |
198
+ <!-- /sdk:reference -->
199
+
200
+ </details>
201
+
202
+ Parameters are typed and described in your editor; fields for each are on its [docs page](https://tradytics.com/docs).
203
+
204
+ ## More
205
+
206
+ - [API docs](https://tradytics.com/docs), with a page per endpoint and a live console
207
+ - [Python SDK](https://pypi.org/project/tradytics/): `pip install tradytics`
208
+ - [MCP server](https://tradytics.com/docs/mcp) for Claude, ChatGPT and Cursor
209
+ - Support: [hello@tradytics.com](mailto:hello@tradytics.com)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradytics",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "JavaScript and TypeScript client for the Tradytics API: options flow, dark pool prints, dealer exposure and market data.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0'
1
+ export const VERSION = '0.1.1'