> ## 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.

# Massive (Polygon.io)

> Real-time market data, OHLCV bars, options chains with Greeks, technical indicators, news, and reference data via the Massive API.

[Massive](https://massive.com) (formerly Polygon.io) provides real-time and historical market data across stocks, options, crypto, and forex — including OHLCV aggregates, options chains with full Greeks, technical indicators, and financial news.

## Setup

<Steps>
  <Step title="Get an API key">
    Sign up at [massive.com/pricing](https://massive.com/pricing) and get your key from the [dashboard](https://massive.com/dashboard/api-keys).
  </Step>

  <Step title="Set environment variable">
    ```bash theme={null}
    export MASSIVE_API_KEY="your-api-key"
    ```
  </Step>

  <Step title="Start using">
    ```python theme={null}
    from horizon.providers import MassiveProvider as M

    snap = M.snapshot("AAPL")
    ```
  </Step>
</Steps>

<Note>
  Massive is the rebrand of Polygon.io (October 2025). The API is identical — same endpoints, same keys.
  Both `api.massive.com` and `api.polygon.io` work. Horizon uses `api.massive.com` by default.
</Note>

## Snapshots

Real-time price snapshot with day OHLCV, previous close, last trade, and last quote.

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

    snap = M.snapshot("AAPL")
    # snap["todaysChange"], snap["day"]["c"], snap["lastTrade"]["p"]
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive snapshot AAPL
    ```
  </Tab>
</Tabs>

## OHLCV Bars

Historical and intraday aggregates at any resolution.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    # Daily bars
    bars = M.aggregates("AAPL", 1, "day", "2024-01-01", "2024-06-30")

    # 5-minute bars
    bars = M.aggregates("AAPL", 5, "minute", "2024-06-01", "2024-06-01")

    # Previous close
    prev = M.previous_close("TSLA")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    # Daily bars
    horizon providers massive bars AAPL --from 2024-01-01 --to 2024-06-30

    # 5-minute bars
    horizon providers massive bars AAPL --from 2024-06-01 --to 2024-06-01 --timespan minute --multiplier 5
    ```
  </Tab>
</Tabs>

**Timespan options:** `second`, `minute`, `hour`, `day`, `week`, `month`, `quarter`, `year`

Each bar contains:

| Field | Description                   |
| ----- | ----------------------------- |
| `o`   | Open price                    |
| `h`   | High price                    |
| `l`   | Low price                     |
| `c`   | Close price                   |
| `v`   | Volume                        |
| `vw`  | Volume-weighted average price |
| `t`   | Timestamp (Unix ms)           |
| `n`   | Number of transactions        |

## Top Movers

Get the top 20 gainers or losers across the market.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    gainers = M.gainers_losers("gainers")
    losers = M.gainers_losers("losers")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive movers --direction gainers
    horizon providers massive movers --direction losers
    ```
  </Tab>
</Tabs>

## Last Trade & Quote

Most recent trade and NBBO quote for a ticker.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    trade = M.last_trade("NVDA")
    quote = M.last_quote("NVDA")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive quote NVDA
    ```
  </Tab>
</Tabs>

## Options Chain

Full options chain with Greeks (delta, gamma, theta, vega) and implied volatility.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    # Full chain
    chain = M.options_chain("AAPL")

    # Filtered: calls expiring June 2024, strikes $150-$200
    chain = M.options_chain(
        "AAPL",
        contract_type="call",
        expiration_date="2024-06-21",
        strike_price_gte=150,
        strike_price_lte=200,
    )
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive options AAPL --type call --expiry 2024-06-21 --strike-gte 150 --strike-lte 200
    ```
  </Tab>
</Tabs>

Each contract includes:

| Field                | Description        |
| -------------------- | ------------------ |
| `break_even_price`   | Break-even price   |
| `open_interest`      | Open interest      |
| `implied_volatility` | Implied volatility |
| `greeks.delta`       | Delta              |
| `greeks.gamma`       | Gamma              |
| `greeks.theta`       | Theta              |
| `greeks.vega`        | Vega               |
| `last_quote`         | Bid/ask            |
| `day`                | Day OHLCV          |

## Technical Indicators

Built-in technical indicator calculations.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    # Simple Moving Average
    sma = M.sma("AAPL", window=200)

    # Exponential Moving Average
    ema = M.ema("AAPL", window=50)

    # RSI
    rsi = M.rsi("TSLA", window=14)

    # MACD
    macd = M.macd("AAPL")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive sma AAPL --window 200
    horizon providers massive rsi TSLA --window 14
    horizon providers massive macd AAPL
    ```
  </Tab>
</Tabs>

**Indicator parameters:**

| Parameter     | Description                       | Default                |
| ------------- | --------------------------------- | ---------------------- |
| `timespan`    | second/minute/hour/day/week/month | `day`                  |
| `window`      | Lookback period                   | 50 (SMA/EMA), 14 (RSI) |
| `series_type` | open/high/low/close               | `close`                |
| `limit`       | Number of values                  | 50                     |

## Ticker Details & Search

Look up company information or search for tickers.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    # Full details
    details = M.ticker_details("NVDA")
    # details["name"], details["market_cap"], details["description"]

    # Search
    results = M.search_tickers("apple", market="stocks")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive details NVDA
    horizon providers massive search "apple" --market stocks
    ```
  </Tab>
</Tabs>

## News

Financial news with sentiment analysis and ticker tagging.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    # General market news
    news = M.news(limit=10)

    # Ticker-specific
    aapl_news = M.news(ticker="AAPL", limit=5)
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive news --ticker AAPL --limit 5
    ```
  </Tab>
</Tabs>

Each article includes `title`, `description`, `article_url`, `published_utc`, `tickers`, and `insights` with sentiment analysis.

## Corporate Actions

Dividends and stock splits.

```python theme={null}
divs = M.dividends("AAPL")
splits = M.splits("TSLA")
```

```bash theme={null}
horizon providers massive dividends AAPL
```

## Crypto

Crypto market data using `X:BTCUSD` format.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    btc = M.crypto_snapshot("X:BTCUSD")

    # Crypto movers
    gainers = M.crypto_gainers_losers("gainers")

    # OHLCV bars (same aggregates function)
    bars = M.aggregates("X:BTCUSD", 1, "day", "2024-01-01", "2024-06-30")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive crypto X:BTCUSD
    ```
  </Tab>
</Tabs>

## Forex

Real-time forex conversions and snapshots. Pairs use `C:EURUSD` format.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    rate = M.forex_conversion("EUR", "USD")
    snap = M.forex_snapshot("C:EURUSD")
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    horizon providers massive forex EUR USD
    ```
  </Tab>
</Tabs>

## Market Status

Check if markets are currently open.

```python theme={null}
status = M.market_status()
holidays = M.market_holidays()
```

```bash theme={null}
horizon providers massive status
```

## Rate Limits

| Tier | REST Limit | Data             |
| ---- | ---------- | ---------------- |
| Free | 5 req/min  | Delayed (15 min) |
| Paid | Unlimited  | Real-time        |

<Tip>
  Paid plans are recommended for trading use. Stay under 100 req/sec.
</Tip>

## MCP Tools

All functions are available via the `market_data` compound MCP tool with an `action` parameter:

```json theme={null}
// Example: get AAPL snapshot
{"action": "snapshot", "params": "{\"ticker\": \"AAPL\"}"}
```

Available actions: `aggregates`, `snapshot`, `last_trade`, `last_quote`, `previous_close`, `grouped_daily`, `gainers_losers`, `crypto_gainers_losers`, `ticker_details`, `search_tickers`, `market_status`, `market_holidays`, `sma`, `ema`, `rsi`, `macd`, `options_chain`, `options_contracts`, `news`, `dividends`, `splits`, `crypto_snapshot`, `forex_conversion`, `forex_snapshot`.
