Metadata-Version: 2.4
Name: tradytics
Version: 0.1.4
Summary: Python client for the Tradytics API: options flow, dark pool prints, dealer exposure and market data.
Author-email: Tradytics <hello@tradytics.com>
License: MIT
Project-URL: Homepage, https://tradytics.com/docs
Project-URL: Documentation, https://tradytics.com/docs
Project-URL: API keys, https://tradytics.com/developer/keys
Keywords: options flow,dark pool,gamma exposure,market data,stocks,trading,api
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<p align="center">
  <a href="https://tradytics.com/docs"><img src="https://tradytics.com/api/v2/og/sdk.png?v=3" alt="Tradytics: one API for options flow, dark pools and the market" width="100%"></a>
</p>

# Tradytics for Python

The official Python 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 method each, no dependencies.

[![PyPI](https://img.shields.io/pypi/v/tradytics?color=168eff&label=pypi)](https://pypi.org/project/tradytics/)
[![Python](https://img.shields.io/pypi/pyversions/tradytics?color=16171a)](https://pypi.org/project/tradytics/)
[![npm](https://img.shields.io/npm/v/tradytics?color=168eff&label=npm)](https://www.npmjs.com/package/tradytics)
[![Endpoints](https://img.shields.io/badge/endpoints-78-16171a)](https://tradytics.com/docs)
[![Docs](https://img.shields.io/badge/docs-tradytics.com-16171a)](https://tradytics.com/docs)
[![License](https://img.shields.io/badge/license-MIT-16171a)](https://opensource.org/license/mit)

```bash
pip install tradytics
```

## What you get

- **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.
- **Dark pool**: block and off-exchange prints as they happen, each ranked against a year of its kind, and the levels where size traded.
- **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.
- **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.
- **Built for scripts and services**: retries on rate limits, paging and live streaming built in, typed and documented methods, and plain JSON back.

## Quickstart

The API is part of Tradytics Pro. Make a key at [tradytics.com/developer/keys](https://tradytics.com/developer/keys) and pass it in, or export it as `TRADYTICS_API_KEY`. A key you pass wins over the environment.

```python
from tradytics import Client

client = Client("tdy_...")   # or Client(api_key="tdy_...")
client = Client()            # or set TRADYTICS_API_KEY and pass nothing

flow = client.options.flow(symbol="NVDA", min_premium=1_000_000, opening=True)
for p in flow["data"]:
    print(p["time"], p["symbol"], p["type"], p["strike"], p["expiry"], p["premium"])
```

Objects come back as `{"data": ..., "as_of": ...}` and lists as `{"data": [...], "count": n, "next_cursor": ...}`, the same JSON as the [REST API](https://tradytics.com/docs).

## Examples

```python
# Biggest dark pool prints today, and the year's largest for one stock
client.darkpool.prints(min_value=10_000_000)
client.darkpool.ranked("AAPL", kind="trade", sort="big")

# Dealer gamma by strike, and the SPX call wall, put wall and gamma flip
client.options.exposure("SPY", greek="gamma")
client.options.index_gamma(symbol="SPX")

# Five-minute bars, a year of daily bars
client.symbols.bars("TSLA", timeframe="5m", limit=500)
client.symbols.bars("SPY", timeframe="1d", limit=252)

# Scan the market on any field
client.scanner.scan(min_rvol=2, max_rsi=30, sort="oprem", limit=25)

# Live signals, and the market's options read today
client.signals.list(status="open")
client.options.read()
```

## Every page

```python
for p in client.paginate(client.options.flow_history, symbol="TSLA", min_premium=500_000):
    print(p["time"], p["premium"])
```

## New prints as they happen

```python
for p in client.stream(client.options.flow, min_premium=250_000):
    print(p["symbol"], p["type"], p["strike"], p["premium"])
```

`stream` works with `client.options.flow` and `client.darkpool.prints`, polls every two seconds and yields each print once, oldest first.

## Errors, retries and limits

```python
from tradytics import Client, TradyticsError

try:
    client.options.flow(symbol="NVDA", limit=5000)
except TradyticsError as e:
    print(e.status, e.code, e.message, e.request_id)  # 400 invalid_parameter ...
```

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. `Client(api_key=..., timeout=30, max_retries=3)` changes the defaults, and `client.get("/any/path", **params)` calls any endpoint by path.

## Reference

<details>
<summary>Every method, by resource</summary>

<!-- sdk:reference -->
| Method | Request | Name |
| --- | --- | --- |
| **symbols** | | |
| `symbols.list(**params)` | `GET /symbols` | List symbols |
| `symbols.get(symbol)` | `GET /symbols/{symbol}` | Symbol |
| `symbols.quotes(**params)` | `GET /quotes` | Quotes |
| `symbols.bars(symbol, **params)` | `GET /symbols/{symbol}/bars` | Bars |
| `symbols.news(symbol)` | `GET /symbols/{symbol}/news` | Symbol news |
| **market** | | |
| `market.assets()` | `GET /market/assets` | Major assets |
| `market.breadth()` | `GET /market/breadth` | Market breadth |
| `market.sectors()` | `GET /market/sectors` | Sectors |
| `market.heatmap()` | `GET /market/heatmap` | Heatmap |
| `market.themes()` | `GET /market/themes` | Themes |
| `market.movers()` | `GET /market/movers` | Movers |
| `market.crypto()` | `GET /market/crypto` | Crypto |
| `market.crypto_sectors()` | `GET /market/crypto/sectors` | Crypto sectors |
| `market.digest()` | `GET /market/digest` | Market digest |
| `market.news()` | `GET /news` | Market news |
| `market.earnings_calendar()` | `GET /calendar/earnings` | Earnings calendar |
| `market.insiders()` | `GET /insiders` | Insider trades |
| `market.congress()` | `GET /congress` | Congress trades |
| **options** | | |
| `options.flow(**params)` | `GET /options/flow` | Options flow |
| `options.flow_history(**params)` | `GET /options/flow/history` | Options flow history |
| `options.sentiment(**params)` | `GET /market/options/sentiment` | Options sentiment |
| `options.pressure()` | `GET /market/options/pressure` | Buying pressure |
| `options.index_gamma(**params)` | `GET /market/options/gamma` | Index dealer gamma |
| `options.put_call()` | `GET /market/options/put-call` | Put/call premium |
| `options.leaders()` | `GET /market/options/leaders` | Flow leaders |
| `options.sectors()` | `GET /market/options/sectors` | Flow by sector |
| `options.top_prints()` | `GET /market/options/top-prints` | Top prints |
| `options.contracts()` | `GET /market/options/contracts` | Most traded contracts |
| `options.iv()` | `GET /market/options/iv` | Implied volatility movers |
| `options.zero_dte(**params)` | `GET /market/options/zero-dte` | 0DTE flow |
| `options.zero_dte_gamma(**params)` | `GET /market/options/zero-dte/gamma` | 0DTE dealer gamma |
| `options.read()` | `GET /market/options/read` | Options market read |
| `options.bets()` | `GET /market/options/bets` | Big bets |
| `options.unusual()` | `GET /market/options/unusual` | Unusual opening bets |
| `options.chains()` | `GET /market/options/chains` | Contract lists |
| `options.evidence()` | `GET /market/options/evidence` | Tested market facts |
| `options.overview(symbol)` | `GET /symbols/{symbol}/options` | Options overview |
| `options.net_flow(symbol)` | `GET /symbols/{symbol}/options/flow` | Net flow today |
| `options.gamma(symbol)` | `GET /symbols/{symbol}/options/gamma` | Dealer gamma |
| `options.volatility(symbol)` | `GET /symbols/{symbol}/options/volatility` | Volatility |
| `options.open_interest(symbol, **params)` | `GET /symbols/{symbol}/options/open-interest` | Open interest |
| `options.expiries(symbol)` | `GET /symbols/{symbol}/options/expiries` | Premiums heatmap |
| `options.orders(symbol)` | `GET /symbols/{symbol}/options/orders` | Largest and unusual orders |
| `options.history(symbol)` | `GET /symbols/{symbol}/options/history` | Daily flow history |
| `options.exposure(symbol, **params)` | `GET /symbols/{symbol}/options/exposure` | Dealer exposure |
| `options.exposure_history(symbol, **params)` | `GET /symbols/{symbol}/options/exposure/history` | Dealer exposure history |
| **darkpool** | | |
| `darkpool.prints(**params)` | `GET /darkpool/prints` | Dark pool prints |
| `darkpool.history(**params)` | `GET /darkpool/history` | Dark pool history |
| `darkpool.levels(symbol)` | `GET /symbols/{symbol}/darkpool` | Dark pool levels |
| `darkpool.ranked(symbol, **params)` | `GET /symbols/{symbol}/darkpool/ranked` | Ranked dark pool prints |
| **research** | | |
| `research.summary(symbol)` | `GET /symbols/{symbol}/summary` | Summary |
| `research.analysts(symbol)` | `GET /symbols/{symbol}/analysts` | Analysts |
| `research.earnings(symbol)` | `GET /symbols/{symbol}/earnings` | Earnings |
| `research.financials(symbol)` | `GET /symbols/{symbol}/financials` | Financials |
| `research.technicals(symbol)` | `GET /symbols/{symbol}/technicals` | Technicals |
| `research.ownership(symbol)` | `GET /symbols/{symbol}/ownership` | Ownership |
| `research.holdings(symbol)` | `GET /symbols/{symbol}/holdings` | Fund holdings |
| **scanner** | | |
| `scanner.scan(**params)` | `GET /scanner` | Scan the market |
| `scanner.fields()` | `GET /scanner/fields` | Scanner fields and labels |
| `scanner.symbol(symbol)` | `GET /symbols/{symbol}/scan` | Symbol scan |
| **signals** | | |
| `signals.list(**params)` | `GET /signals` | List signals |
| `signals.get(id)` | `GET /signals/{id}` | Signal |
| **probabilities** | | |
| `probabilities.list(**params)` | `GET /probabilities` | List questions |
| `probabilities.get(id)` | `GET /probabilities/{id}` | Question |
| `probabilities.history(market, **params)` | `GET /probabilities/markets/{market}/history` | Outcome history |
| `probabilities.outlook()` | `GET /probabilities/outlook` | S&P 500 outlook |
| `probabilities.track()` | `GET /probabilities/track` | Index closes scored |
| `probabilities.settled(**params)` | `GET /probabilities/settled` | Settled markets |
| **fund** | | |
| `fund.summary()` | `GET /fund` | The fund now |
| `fund.trades(**params)` | `GET /fund/trades` | Fund trades |
| `fund.posts(**params)` | `GET /fund/posts` | Fund posts |
| **account** | | |
| `account.backtests(**params)` | `GET /backtests` | Your backtests |
| `account.backtest(id)` | `GET /backtests/{id}` | A backtest |
| `account.portfolio()` | `GET /portfolio` | Your portfolio |
| `account.portfolio_trades()` | `GET /portfolio/trades` | Your trades |
| `account.portfolio_factors()` | `GET /portfolio/factors` | Your portfolio's factors |
| `account.dashboards()` | `GET /dashboards` | Your dashboards |
| `account.dashboard(id)` | `GET /dashboards/{id}` | A dashboard |
<!-- /sdk:reference -->

</details>

Parameters and fields for each are in the method's docstring and on its [docs page](https://tradytics.com/docs).

## More

- [API docs](https://tradytics.com/docs), with a page per endpoint and a live console
- [JavaScript SDK](https://www.npmjs.com/package/tradytics): `npm install tradytics`
- [MCP server](https://tradytics.com/docs/mcp) for Claude, ChatGPT and Cursor
- Support: [hello@tradytics.com](mailto:hello@tradytics.com)
