Metadata-Version: 2.4
Name: tradytics
Version: 0.2.1
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 -->79<!-- /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-79-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_usd"])
```

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

## Examples

```python
# The year's biggest dark pool prints for one stock, ranked against its own year
client.darkpool.prints(symbol="AAPL", from_="2026-01-01", max_rank=10)

# Dealer gamma by strike with the call wall, put wall and flip; 0DTE only
client.options.exposure(symbol="SPY", greek="gamma", dte=0)

# Every quarter Apple has filed, and its 8-Ks as they land
client.fundamentals.income_statement(symbol="AAPL", period="quarter", limit=40)
client.filings.list(symbol="AAPL", form="8-K")

# Insider buys over $1M, and Tesla's deliveries quarter by quarter
client.disclosures.insiders(type="buy", min_value=1_000_000)
client.kpis.list(symbol="TSLA", kpi="vehicle_deliveries")

# Screen the market on any field
client.screener.stocks(min_relative_volume=2, max_rsi=30, sort="change_pct", limit=25)
```

## Every page

```python
for p in client.paginate(client.options.flow, symbol="TSLA", min_premium=500_000, from_="2026-01-01"):
    print(p["time"], p["premium_usd"])
```

## 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_usd"])
```

`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 |
| --- | --- | --- |
| **options** | | |
| `options.flow(**params)` | `GET /options/flow` | Options flow |
| `options.flow_print(id)` | `GET /options/flow/{id}` | One print |
| `options.flow_timeline(**params)` | `GET /options/flow/timeline` | Flow timeline |
| `options.flow_leaders(**params)` | `GET /options/flow/leaders` | Flow leaders |
| `options.flow_strikes(**params)` | `GET /options/flow/strikes` | Flow by strike |
| `options.unusual(**params)` | `GET /options/unusual` | Unusual contracts |
| `options.chain(**params)` | `GET /options/chain` | Option chain |
| `options.expirations(**params)` | `GET /options/expirations` | Expirations |
| `options.contracts(**params)` | `GET /options/contracts` | Contracts |
| `options.contract(contract)` | `GET /options/contracts/{contract}` | Contract |
| `options.contract_bars(contract, **params)` | `GET /options/contracts/{contract}/bars` | Contract bars |
| `options.open_interest(**params)` | `GET /options/open-interest` | Open interest |
| `options.exposure(**params)` | `GET /options/exposure` | Dealer exposure |
| `options.exposure_history(**params)` | `GET /options/exposure/history` | Exposure history |
| `options.volatility(**params)` | `GET /options/volatility` | Volatility |
| `options.volatility_history(**params)` | `GET /options/volatility/history` | Volatility history |
| **darkpool** | | |
| `darkpool.prints(**params)` | `GET /darkpool/prints` | Dark pool prints |
| `darkpool.levels(**params)` | `GET /darkpool/levels` | Dark pool levels |
| `darkpool.daily(**params)` | `GET /darkpool/daily` | Dark pool by day |
| **stocks** | | |
| `stocks.quotes(**params)` | `GET /stocks/quotes` | Quotes |
| `stocks.bars(**params)` | `GET /stocks/bars` | Bars |
| `stocks.snapshot(**params)` | `GET /stocks/snapshot` | Market snapshot |
| `stocks.technicals(**params)` | `GET /stocks/technicals` | Technicals |
| `stocks.short_interest(**params)` | `GET /stocks/short-interest` | Short interest |
| `stocks.short_volume(**params)` | `GET /stocks/short-volume` | Short volume |
| `stocks.corporate_actions(**params)` | `GET /stocks/corporate-actions` | Dividends and splits |
| **fundamentals** | | |
| `fundamentals.profile(**params)` | `GET /fundamentals/profile` | Company profile |
| `fundamentals.income_statement(**params)` | `GET /fundamentals/income-statement` | Income statement |
| `fundamentals.balance_sheet(**params)` | `GET /fundamentals/balance-sheet` | Balance sheet |
| `fundamentals.cash_flow(**params)` | `GET /fundamentals/cash-flow` | Cash flow statement |
| `fundamentals.ratios(**params)` | `GET /fundamentals/ratios` | Ratios |
| `fundamentals.segments(**params)` | `GET /fundamentals/segments` | Revenue segments |
| `fundamentals.earnings(**params)` | `GET /fundamentals/earnings` | Earnings |
| `fundamentals.estimates(**params)` | `GET /fundamentals/estimates` | Analyst estimates |
| `fundamentals.analysts(**params)` | `GET /fundamentals/analysts` | Analysts |
| `fundamentals.transcripts(**params)` | `GET /fundamentals/transcripts` | Call transcripts |
| `fundamentals.etf_holdings(**params)` | `GET /fundamentals/etf-holdings` | ETF holdings |
| **filings** | | |
| `filings.list(**params)` | `GET /filings` | List filings |
| `filings.search(**params)` | `GET /filings/search` | Search filings |
| `filings.get(accession)` | `GET /filings/{accession}` | Filing |
| `filings.sections(accession, **params)` | `GET /filings/{accession}/sections` | Filing sections |
| **disclosures** | | |
| `disclosures.insiders(**params)` | `GET /disclosures/insiders` | Insider trades |
| `disclosures.institutions(**params)` | `GET /disclosures/institutions` | Institutional holders |
| `disclosures.institution(cik, **params)` | `GET /disclosures/institutions/{cik}` | Institution holdings |
| `disclosures.activists(**params)` | `GET /disclosures/activists` | Activist stakes |
| `disclosures.congress(**params)` | `GET /disclosures/congress` | Congress trades |
| **kpis** | | |
| `kpis.list(**params)` | `GET /kpis` | KPIs |
| `kpis.definitions(**params)` | `GET /kpis/definitions` | KPI definitions |
| **market** | | |
| `market.status()` | `GET /market/status` | Market status |
| `market.indices()` | `GET /market/indices` | Indices |
| `market.breadth()` | `GET /market/breadth` | Breadth |
| `market.sectors(**params)` | `GET /market/sectors` | Sectors and themes |
| **calendar** | | |
| `calendar.earnings(**params)` | `GET /calendar/earnings` | Earnings calendar |
| `calendar.economic(**params)` | `GET /calendar/economic` | Economic calendar |
| **news** | | |
| `news.list(**params)` | `GET /news` | News |
| **screener** | | |
| `screener.stocks(**params)` | `GET /screener/stocks` | Screen stocks |
| `screener.fields()` | `GET /screener/fields` | Screener fields |
| **signals** | | |
| `signals.list(**params)` | `GET /signals` | List signals |
| `signals.get(id)` | `GET /signals/{id}` | Signal |
| `signals.performance(**params)` | `GET /signals/performance` | Signal performance |
| **insights** | | |
| `insights.market(**params)` | `GET /insights/market` | Market digest |
| `insights.movers(**params)` | `GET /insights/movers` | Why it's moving |
| **probabilities** | | |
| `probabilities.list(**params)` | `GET /probabilities` | List questions |
| `probabilities.get(id)` | `GET /probabilities/{id}` | Question |
| `probabilities.history(id, **params)` | `GET /probabilities/{id}/history` | Outcome history |
| `probabilities.outlook()` | `GET /probabilities/outlook` | S&P 500 outlook |
| `probabilities.settled(**params)` | `GET /probabilities/settled` | Settled markets |
| **fund** | | |
| `fund.get()` | `GET /fund` | The fund |
| `fund.trades(**params)` | `GET /fund/trades` | Fund trades |
| **symbols** | | |
| `symbols.list(**params)` | `GET /symbols` | List symbols |
| `symbols.get(symbol)` | `GET /symbols/{symbol}` | Symbol |
| **account** | | |
| `account.portfolio()` | `GET /account/portfolio` | Your portfolio |
| `account.portfolio_trades()` | `GET /account/portfolio/trades` | Your trades |
| `account.portfolio_factors()` | `GET /account/portfolio/factors` | Your factors |
| `account.backtests(**params)` | `GET /account/backtests` | Your backtests |
| `account.backtest(id)` | `GET /account/backtests/{id}` | A backtest |
| `account.dashboards()` | `GET /account/dashboards` | Your dashboards |
| `account.dashboard(id)` | `GET /account/dashboards/{id}` | A dashboard |
| `account.watchlists()` | `GET /account/watchlists` | Your watchlists |
<!-- /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)
