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

# Dividends

> Live updates over WebSocket as new dividend declarations are recorded.

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

This pushes newly-recorded dividend declarations as they happen, with the same fields [`GET /dividends/recent`](/api-reference/dividends/recent) returns, including the company name and sector. No query parameters.

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

<Note>
  This channel works differently from [Prices](/websocket/prices), [Market Snapshot](/websocket/snapshot), [Indices](/websocket/indices), and [Forex Rates](/websocket/forex). Dividends are an append-only log, not a value that changes in place, so there's no current state to repeat on every update. See [Message format](#message-format) below.
</Note>

<CodeGroup>
  ```javascript Browser theme={null}
  const ws = new WebSocket(
    'wss://api.ngnmarket.com/v1/ws/dividends?api_key=ngm_live_YOUR_KEY'
  );

  ws.onmessage = (event) => {
    const msg = JSON.parse(event.data);
    console.log(msg.type, msg.dividends);
  };
  ```

  ```javascript Node.js theme={null}
  import WebSocket from 'ws';

  const ws = new WebSocket(
    'wss://api.ngnmarket.com/v1/ws/dividends?api_key=ngm_live_YOUR_KEY'
  );

  ws.on('message', (data) => {
    const msg = JSON.parse(data.toString());
    console.log(msg.type, msg.dividends);
  });
  ```

  ```python Python theme={null}
  import asyncio
  import json
  import websockets

  async def main():
      url = "wss://api.ngnmarket.com/v1/ws/dividends?api_key=ngm_live_YOUR_KEY"
      async with websockets.connect(url) as ws:
          async for raw in ws:
              msg = json.loads(raw)
              print(msg["type"], msg["dividends"])

  asyncio.run(main())
  ```
</CodeGroup>

## Message format

`snapshot` arrives once on connect with the 20 most recent dividend records, so you have context right away. Every `update` after that contains only the dividends recorded since your last message: never the full history again, and never one you've already received.

```json theme={null}
{
  "type": "update",
  "dividends": [
    {
      "id": 3660,
      "symbol": "GTCO",
      "ex_dividend_date": "2026-09-01",
      "dividend": 3.50,
      "type": "Interim",
      "payment_date": "2026-09-15",
      "yield": 2.1,
      "company_name": "Guaranty Trust Holding Co",
      "sector": "Financial Services"
    }
  ]
}
```

An `update` can contain more than one dividend if several were recorded within the same five-second check interval. If nothing new was recorded, no `update` message goes out at all.

See [Errors](/websocket/errors) for connection-level error codes. This channel takes no parameters, so nothing about it specifically can fail.
