# Index history

> Daily closing levels for any NGX index, including the full All-Share Index history.

```http
GET https://koboterminal.com/api/ngxdata/indices/{code}/history
```

**Plan:** Free and above (free key, no card).

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `code` | path | string | yes | Index code or slug (e.g. `ASI`) |
| `from` | query | string | no | Start date, YYYY-MM-DD (e.g. `2025-01-01`) |
| `to` | query | string | no | End date, YYYY-MM-DD (e.g. `2026-11-18`) |

## Request

```bash
curl "https://koboterminal.com/api/ngxdata/indices/ASI/history?from=2026-11-01" \
  -H "X-API-Key: $KOBO_API_KEY"
```

```python
import os, requests

r = requests.get(
    "https://koboterminal.com/api/ngxdata/indices/ASI/history",
    params={"from": "2026-11-01"},
    headers={"X-API-Key": os.environ["KOBO_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
data = r.json()
```

```javascript
const res = await fetch("https://koboterminal.com/api/ngxdata/indices/ASI/history?from=2026-11-01", {
  headers: { "X-API-Key": process.env.KOBO_API_KEY },
});
if (!res.ok) throw new Error(`Kobo API ${res.status}`);
const data = await res.json();
```

## Response

Real response from the live API on 18 November 2026, trimmed to the first item of each list:

```json
{
  "success": true,
  "code": "ASI",
  "slug": "asi",
  "name": "NGX ALL SHARE INDEX",
  "count": 4,
  "first_date": "2026-11-12",
  "last_date": "2026-11-17",
  "history": [
    {
      "date": "2026-11-12",
      "value": 252366.8
    },
    {
      "date": "2026-11-13",
      "value": 252269.16
    },
    {
      "date": "2026-11-16",
      "value": 252809.78
    }
  ]
}
```

## Use it from an AI assistant

This endpoint is available as the `get_index_history` tool on the Kobo Terminal MCP server (`https://koboterminal.com/mcp`). See [MCP server](https://koboterminal.com/docs/mcp).

## Errors

Standard errors apply: see [Rate limits and errors](https://koboterminal.com/docs/errors).
