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

# Price charts

> Fetch NGX end-of-day line and candlestick data by ticker or company UUID.

Use `GET /v1/companies/{company_ref}/chart` for company and listed-fund price charts. `company_ref` accepts an NGX ticker such as `DANGCEM` or `VETBANK`, or a Rangler company UUID.

The same route handles exchange-traded funds and returns `asset_type: "fund"` for them. See [ETF market data](/etf-market-data) for ETF discovery, linked fund/company IDs, factsheets, and thin-trading behavior.

## Choose a range

Use a named `period` when you need a rolling window:

* one day (`1d`) — intraday, see below
* one week (`1w`)
* one month (`1m`)
* three months (`3m`)
* year to date (`ytd`)
* one year (`1y`)
* all available history (`all`)

The API reference selector shows these seven primary values. Older integrations may
continue sending `7d`, `30d`, `90d`, `6m`, `5y`, or `max`; they remain accepted but
are not offered to new integrations in the selector.

Use inclusive `from` and `to` dates for an exact range. An explicit `from` date overrides `period`.

```bash theme={null}
curl -s "https://api.rangler.co/v1/companies/DANGCEM/chart?from=2026-04-16&to=2026-04-16&format=detailed" \
  -H "X-API-Key: $RANGLER_API_KEY"
```

## Intraday

`period=1d` returns every intraday observation rather than a single daily close. It
requires `format=detailed` because the `line` and `ohlcv` formats are keyed by date.

When the current market day has no observations yet, the named one-day request
returns the latest available session. Check `as_of_date` and the coverage dates to
identify the session represented by the response.

Observations run from 09:30 to 16:00 West Africa Time at roughly five-minute spacing,
so the window opens half an hour after the exchange does.

```bash theme={null}
curl -s "https://api.rangler.co/v1/companies/DANGCEM/chart?period=1d&format=detailed" \
  -H "X-API-Key: $RANGLER_API_KEY"
```

One-week requests remain daily by default, so existing integrations do not need to
change. To request the optional hourly one-week series for a company, add
`interval=hourly` and use `format=detailed`:

```bash theme={null}
curl -s "https://api.rangler.co/v1/companies/DANGCEM/chart?period=1w&interval=hourly&format=detailed" \
  -H "X-API-Key: $RANGLER_API_KEY"
```

Use each point's `timestamp` as its chart key because an hourly response contains
multiple observations with the same `date`. The hourly option is not currently
available for listed funds.

`coverage.frequency` and `coverage.freshness` are `intraday` for one-day and hourly
one-week responses. Daily responses use `daily` and `end_of_day` respectively.

Paid access returns every observation Rangler has for the requested range. Rangler does not shorten chart history according to the paid package.

## Choose a format

### Detailed data

`format=detailed` is the default. Each point includes `date`, `timestamp`, OHLCV fields where available, `value_traded`, `vwap`, `trade_count`, daily change, and `candle_ready`.

```json theme={null}
{
  "symbol": "DANGCEM",
  "company_name": "Dangote Cement Plc",
  "exchange": "NGX",
  "currency": "NGN",
  "format": "detailed",
  "period": null,
  "count": 1,
  "as_of_date": "2026-04-16",
  "data": [
    {
      "timestamp": "2026-04-16T00:00:00Z",
      "date": "2026-04-16",
      "open": 810,
      "high": 810,
      "low": 810,
      "close": 810,
      "volume": 2691050,
      "value_traded": 2167216454.5,
      "vwap": 805.3423215845116,
      "trade_count": 1514,
      "change": 0,
      "percentage_change": 0,
      "candle_ready": true
    }
  ]
}
```

Percentage changes are fractional: `0.05` means 5%.

### Line data

Use `format=line` for compact `[date, close]` points. Line responses retain older close-only history.

```bash theme={null}
curl -s "https://api.rangler.co/v1/companies/DANGCEM/chart?period=max&format=line" \
  -H "X-API-Key: $RANGLER_API_KEY"
```

```json theme={null}
{
  "format": "line",
  "data": [
    ["2016-12-31", 175.5],
    ["2017-01-03", 176]
  ]
}
```

Map the response into the object shape expected by your line-chart library:

```js theme={null}
const response = await fetch(
  "https://api.rangler.co/v1/companies/DANGCEM/chart?period=5y&format=line",
  { headers: { "X-API-Key": process.env.RANGLER_API_KEY } },
);
const payload = await response.json();
const points = payload.data.map(([time, value]) => ({ time, value }));
```

## Render candlesticks safely

Use `format=ohlcv` for compact `[date, open, high, low, close, volume]` arrays.

```bash theme={null}
curl -s "https://api.rangler.co/v1/companies/DANGCEM/chart?period=5y&format=ohlcv" \
  -H "X-API-Key: $RANGLER_API_KEY"
```

The OHLCV response contains only usable candles. Rangler omits a date when a required field is missing or non-positive, when the high and low cannot contain the open and close, or when the candle close does not agree with the close-history value for that date. The response reports the number in `coverage.omitted_incomplete_candles`.

```js theme={null}
const candles = payload.data.map(([time, open, high, low, close]) => ({
  time,
  open,
  high,
  low,
  close,
}));
```

This prevents chart libraries from interpreting a missing or broken value as zero. A bad daily row also cannot replace a valid close in the longer line series. Use `format=line` if you need every available close.

## Check coverage and freshness

Every response includes a `coverage` block:

```json theme={null}
{
  "earliest_available_date": "2016-12-31",
  "latest_available_date": "2026-08-21",
  "earliest_candle_date": "2020-07-23",
  "latest_candle_date": "2026-04-16",
  "available_points": 3521,
  "returned_points": 47,
  "candle_ready_points": 47,
  "incomplete_candle_points": 3474,
  "omitted_incomplete_candles": 3474,
  "corporate_action_adjusted": false,
  "frequency": "daily",
  "freshness": "end_of_day"
}
```

This example shows DANGCEM with `period=max&format=ohlcv` using production data audited on August 23, 2026. Coverage varies by company and grows as new observations are ingested. Use the block returned with each response rather than hard-coding these values.

<Warning>
  These are unadjusted prices. The one-day and optional hourly one-week series are
  delayed rather than live. Other requests return end-of-day observations. Do not
  describe these as real-time quotes or use them as a split-adjusted total-return
  series.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.