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

# Plot the All Share Index

> Fetch NGX All Share Index history and render it as a price chart.

The ASI (All Share Index) is the NGX benchmark index. This example fetches the last 90 days of daily values in chart-friendly `[timestamp, value]` format, ready to drop into any charting library like Chart.js, Recharts, or Highcharts.

**Endpoint:** `GET /indices/ASI/chart` (Starter plan)

## Fetch 90-day ASI history

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.ngnmarket.com/v1/indices/ASI/chart?period=90d&format=chart" \
    -H "Authorization: Bearer ngm_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    'https://api.ngnmarket.com/v1/indices/ASI/chart?period=90d&format=chart',
    { headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' } }
  );
  const { data } = await res.json();

  // data.data is an array of [timestamp, value] pairs
  const chartPoints = data.data;
  // e.g. [[1744848000000, 105432.18], [1744761600000, 104555.74], ...]
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      'https://api.ngnmarket.com/v1/indices/ASI/chart',
      params={'period': '90d', 'format': 'chart'},
      headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
  )
  chart_points = res.json()['data']['data']
  # [[1744848000000, 105432.18], [1744761600000, 104555.74], ...]
  ```
</CodeGroup>

## Sample response

```json theme={null}
{
  "success": true,
  "data": {
    "symbol": "ASI",
    "period": "90d",
    "format": "chart",
    "count": 63,
    "data": [
      [1736208000000, 101847.29],
      [1736294400000, 102310.54],
      [1744848000000, 105432.18]
    ],
    "statistics": {
      "period_change": 3584.89,
      "period_change_percent": 3.52,
      "min_value": 101847.29,
      "max_value": 105432.18,
      "start_date": "2026-01-07",
      "end_date": "2026-04-17"
    }
  },
  "meta": {
    "plan": "starter",
    "calls_used": 14,
    "calls_remaining": 99986,
    "reset_at": "2026-05-01T00:00:00.000Z"
  }
}
```

## Use a custom date range

Swap `period` for `from` and `to` if you need a specific window:

```bash curl theme={null}
curl "https://api.ngnmarket.com/v1/indices/ASI/chart?from=2026-01-01&to=2026-03-31&format=chart" \
  -H "Authorization: Bearer ngm_live_YOUR_KEY"
```

## Need full OHLCV detail?

Drop `format=chart` and use `format=detailed` instead. Each point then includes `date`, `value`, `change`, and `change_percent` fields individually.

<Card title="Indices chart reference" icon="book" href="/api-reference/indices/chart">
  Full parameter list for `GET /indices/:symbol/chart`
</Card>
