> ## Documentation Index
> Fetch the complete documentation index at: https://mathematicalcompany.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Third-Party Providers

> Access external data sources — options flow, dark pool, market data, and more — through Horizon's unified interface.

Horizon wraps third-party data APIs so you can query options flow, dark pool prints, Congress trades, market snapshots, and technical indicators from a single interface — Python, CLI, or MCP.

## Available Providers

<CardGroup cols={2}>
  <Card title="Unusual Whales" icon="binoculars" href="/providers/unusual-whales">
    Options flow alerts, dark pool data, Congress & insider trades, Greek exposure, IV analytics, short interest, screeners, and market sentiment.
  </Card>

  <Card title="Massive" icon="chart-mixed" href="/providers/massive">
    Real-time snapshots, OHLCV bars, options chains with Greeks, technical indicators (SMA, EMA, RSI, MACD), news, and reference data. Formerly Polygon.io.
  </Card>
</CardGroup>

## How It Works

Each provider is accessible through three interfaces:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from horizon.providers import UnusualWhalesProvider, MassiveProvider

    # Unusual Whales
    flow = UnusualWhalesProvider.options_flow(ticker="AAPL", min_premium=100000)
    congress = UnusualWhalesProvider.congress_trades(limit=20)

    # Massive (Polygon.io)
    snap = MassiveProvider.snapshot("NVDA")
    rsi = MassiveProvider.rsi("TSLA", window=14)
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    # Unusual Whales
    horizon providers uw flow --ticker AAPL --min-premium 100000
    horizon providers uw congress --name "Pelosi"
    horizon providers uw dark-pool NVDA

    # Massive
    horizon providers massive snapshot AAPL
    horizon providers massive rsi TSLA --window 14
    horizon providers massive movers --direction gainers
    ```
  </Tab>

  <Tab title="MCP">
    All provider functions are registered as MCP tools. Any MCP-compatible client
    (Claude Code, Cursor, Claude Desktop) can call them directly:

    ```
    uw_options_flow(ticker="AAPL", min_premium=100000)
    massive_snapshot(ticker="NVDA")
    uw_congress_trades(ticker="TSLA")
    ```
  </Tab>
</Tabs>

## Authentication

Each provider requires its own API key, set via environment variables:

| Provider       | Environment Variable     | Get a Key                                                                  |
| -------------- | ------------------------ | -------------------------------------------------------------------------- |
| Unusual Whales | `UNUSUAL_WHALES_API_KEY` | [unusualwhales.com/pricing](https://unusualwhales.com/pricing?product=api) |
| Massive        | `MASSIVE_API_KEY`        | [massive.com/pricing](https://massive.com/pricing)                         |

```bash theme={null}
export UNUSUAL_WHALES_API_KEY="your-uw-key"
export MASSIVE_API_KEY="your-massive-key"
```

<Warning>
  Never pass API keys as function parameters. Always use environment variables.
</Warning>

## Use in Pipelines

Provider data feeds naturally into Horizon pipelines. For example, use Unusual Whales flow data to inform your trading signals:

```python theme={null}
import horizon as hz
from horizon.providers import UnusualWhalesProvider as UW

def flow_signal(ctx: hz.Context) -> float:
    """Bias toward buy when large call sweeps appear."""
    flow = UW.options_flow(ticker="SPY", is_sweep=True, is_call=True, min_premium=500000, limit=5)
    if flow:
        return 0.55  # bullish bias
    return 0.50

hz.run(
    name="flow_trader",
    markets=["spy-up-today"],
    pipeline=[flow_signal],
)
```

## Combining Providers

Stack data from multiple providers for richer signals:

```python theme={null}
from horizon.providers import UnusualWhalesProvider as UW, MassiveProvider as M

def multi_source_signal(ctx: hz.Context) -> float:
    # Technical: RSI from Massive
    rsi_data = M.rsi("AAPL", window=14, limit=1)
    rsi_val = rsi_data[0]["value"] if rsi_data else 50

    # Flow: unusual activity from UW
    flow = UW.options_flow(ticker="AAPL", is_sweep=True, min_premium=200000, limit=5)
    sweep_count = len(flow) if isinstance(flow, list) else 0

    # Combine: oversold + heavy call flow = bullish
    if rsi_val < 30 and sweep_count >= 3:
        return 0.70
    return 0.50
```
