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

# WebSocket API

> Receive live updates over a persistent connection instead of polling the REST API.

The REST API works on request and response: you ask, it answers. WebSocket flips that. You connect once, and the server pushes a message every time the underlying data changes, for as long as the connection stays open.

<Note>
  NGX equity prices update roughly every 20 minutes, not tick by tick. Live here means pushed the moment the data changes, not a constant stream of price movement.

  If you're polling `GET /companies` on an interval to catch changes, a WebSocket connection gets you the same data faster and without wasted requests. You only hear from it when something actually changed.

  It carries no historical data, so keep using the REST endpoints for charts and history.
</Note>

## Base URL

```
wss://api.ngnmarket.com/v1/ws
```

Every channel is a path under this, authenticated with the same API key you already use for REST calls. The key travels as a query parameter instead of a header. See [Authentication](/websocket/authentication) for why.

```
wss://api.ngnmarket.com/v1/ws/snapshot?api_key=ngm_live_YOUR_KEY
```

## Available on every plan

Prices, market snapshot, indices, and forex rates are all available on the Free plan. None of them carry historical data, and their REST equivalents are free too.

What actually scales by plan is how many connections you can hold open at once, and, on the prices channel, how many symbols one connection can request. See [Limits](/websocket/limits) for the full table.

<Note>
  WebSocket connections don't count against your monthly REST quota. The two are tracked separately.
</Note>

## Channels

<CardGroup cols={3}>
  <Card title="Prices" icon="chart-line" href="/websocket/prices">
    Current price for a symbol list you choose
  </Card>

  <Card title="Market snapshot" icon="gauge" href="/websocket/snapshot">
    The daily ASI, volume, and value-traded summary
  </Card>

  <Card title="Indices" icon="chart-bar" href="/websocket/indices">
    All NGX indices
  </Card>

  <Card title="Forex rates" icon="money-bill-wave" href="/websocket/forex">
    Current NGN exchange rates
  </Card>

  <Card title="Corporate disclosures" icon="file-lines" href="/websocket/disclosures">
    New disclosure filings as they're published
  </Card>

  <Card title="Dividends" icon="coins" href="/websocket/dividends">
    New dividend declarations as they're recorded
  </Card>
</CardGroup>

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/websocket/quickstart">
    Connect to your first channel in under five minutes
  </Card>

  <Card title="Authentication" icon="key" href="/websocket/authentication">
    How your API key travels over a WebSocket handshake
  </Card>

  <Card title="Limits" icon="gauge-high" href="/websocket/limits">
    Connection and symbol limits by plan
  </Card>

  <Card title="Errors" icon="circle-exclamation" href="/websocket/errors">
    Every WebSocket-specific error code, and how to fix it
  </Card>
</CardGroup>
