FTSE Bursa Malaysia KLCI (KLSE) Price API: Historical OHLC Endpoints and Usage
You need to chart the FTSE Bursa Malaysia KLCI, backfill a clean historical series with OHLC candles for analytics, and trigger alerts when the index moves. By the end of this guide you’ll pull the latest KLSE print, fetch a daily time series you can cache into your database, and understand how to request OHLC data for your dashboards and models.
What you’ll implement
This walkthrough focuses on three practical pieces you can ship today:
- Latest KLSE value for a live dashboard tile.
- Daily time series for backfills and rolling calculations.
- Historical OHLC data for candlestick charts and signal engines.
We’ll do this using Indices-API’s latest, time-series, and OHLC endpoints. If you’re new to the product, you can browse the API at indices-api.com, and refer to the Documentation as you integrate.
Symbol and quote conventions for KLSE
The FTSE Bursa Malaysia KLCI is exposed via the symbol “KLSE”. Always confirm the live symbol code and availability on the Indices-API Supported Symbols page before wiring your integration.
Quotes are returned relative to a base currency. By default the base is USD. That means the numeric value you’ll read in the response is “USD per index unit” (unit: per index). For clarity:
- base: "USD" — all rates are quoted in USD terms.
- rates.KLSE — the USD price per one KLSE “index unit.”
- Some responses also include a synthetic cross such as “USDKLSE” for convenience; read it as the implied number of KLSE units per 1 USD (the inverse of rates.KLSE).
Trading days follow Bursa Malaysia’s schedule. On weekends and local market holidays the latest print will remain the prior close. Time-series queries will omit non-trading days (no candles) or show no change, depending on the endpoint behavior; handle gaps accordingly in your charts.
Get the latest KLSE print
Use the latest endpoint for your real-time tile or to confirm that your backfill has reached the most recent closing level. Update frequency depends on your plan. The latest endpoint refresh cadence is typically every 60 minutes at entry tiers and can be faster at higher tiers; see the Documentation for specifics.
curl: latest KLSE
curl "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
Official JSON sample (copy-pasteable). This is a real response format you will parse in production:
{"data":{"success":true,"timestamp":1794789600,"date":"2026-11-16","base":"USD","rates":{"KLSE":0.0025819953367581,"USD":1,"USDKLSE":387.29736873017725}}}
How to read the fields that matter:
- data.success — boolean result flag you should check before parsing.
- data.timestamp — UNIX epoch seconds for the snapshot. Store this for caching and invalidation.
- data.date — ISO trading date of the snapshot (YYYY-MM-DD).
- data.base — base currency; here it’s “USD”.
- data.rates.KLSE — USD per index unit for KLSE. Use this for your tile, conversions, and alert logic.
- data.rates.USD — baseline 1.0, since base is USD.
- data.rates.USDKLSE — implied KLSE units per USD (inverse of rates.KLSE).
Notes for production:
- Caching: cache latest responses keyed by symbol and date for at least the plan’s update interval to avoid unnecessary calls.
- Non-trading days: expect the latest to reflect the last close; you should label the tile with the trading date (data.date) instead of system time.
- Base currency: if you change the base (where available), recompute your downstream transformations accordingly.
Build a daily KLSE time series for backfills
Next, request a daily range to backfill historical data or to compute rolling indicators. The time-series endpoint returns a date-keyed map of rates. Practical guardrails to remember:
- end_date cannot be today; request up to yesterday’s date to avoid partial days.
- Expect missing dates for weekends/holidays; your charting layer should handle gaps.
- Persist data with the date and timestamp for reproducibility of research pipelines.
The response structure you’ll parse mirrors the documented time-series format (date-keyed “rates” with the same base/rate semantics). Refer to the Documentation for parameter details and plan limits.
JavaScript example: latest + time-series for KLSE
async function fetchKlseSeries() {
const accessKey = 'YOUR_API_KEY';
// 1) Latest snapshot (for your dashboard tile)
const latestUrl = `https://indices-api.com/api/latest?access_key=${accessKey}`;
const latestRes = await fetch(latestUrl);
if (!latestRes.ok) throw new Error(`Latest failed: ${latestRes.status}`);
const latestJson = await latestRes.json();
// Extract the fields you actually use
const ok = latestJson?.data?.success === true;
if (!ok) throw new Error('Latest response not successful');
const latestDate = latestJson.data.date; // e.g. "2026-11-16"
const latestTs = latestJson.data.timestamp; // epoch seconds
const base = latestJson.data.base; // "USD"
const klseUsd = latestJson.data.rates?.KLSE; // USD per index unit
const usdPerKlse = latestJson.data.rates?.USDKLSE; // KLSE units per 1 USD (inverse)
console.log({ latestDate, latestTs, base, klseUsd, usdPerKlse });
// 2) Time-series backfill (yesterday-30d to yesterday)
const toDate = new Date(); // today (do not use as end_date)
toDate.setUTCDate(toDate.getUTCDate() - 1); // use yesterday to avoid partial day
const fromDate = new Date(toDate);
fromDate.setUTCDate(toDate.getUTCDate() - 30);
const fmt = (d) => d.toISOString().slice(0, 10);
const start = fmt(fromDate);
const end = fmt(toDate);
// Request the KLSE range; parse date-keyed daily values in "rates"
const tsUrl = `https://indices-api.com/api/timeseries?access_key=${accessKey}&start_date=${start}&end_date=${end}`;
const tsRes = await fetch(tsUrl);
if (!tsRes.ok) throw new Error(`Timeseries failed: ${tsRes.status}`);
const tsJson = await tsRes.json();
// Iterate dates -> read USD-per-index-unit for KLSE
const series = [];
const daily = tsJson?.rates || tsJson?.data?.rates || {};
for (const [date, payload] of Object.entries(daily)) {
const v = payload?.KLSE;
if (typeof v === 'number') {
series.push({ date, klseUsd: v });
}
}
// Sort ascending by date and return
series.sort((a, b) => a.date.localeCompare(b.date));
return { latest: { date: latestDate, value: klseUsd }, series };
}
fetchKlseSeries()
.then(({ latest, series }) => {
console.log('Latest KLSE (USD per index unit):', latest);
console.log('Timeseries points:', series.length);
// You can now write series[] to your DB or render a chart
})
.catch(err => console.error(err));
Sample latest JSON (the official response you saw above) that this code consumes:
{"data":{"success":true,"timestamp":1794789600,"date":"2026-11-16","base":"USD","rates":{"KLSE":0.0025819953367581,"USD":1,"USDKLSE":387.29736873017725}}}
Implementation notes:
- Always verify data.success before parsing payloads.
- Use end_date = yesterday to avoid partial candles and pass backtests deterministically.
- Persist base along with values if you ever change base currency for experiments.
- If your plan has an update window (e.g., every 60 minutes vs 10 minutes), align cache TTL with that interval to avoid unnecessary refreshes.
If you don’t yet have an API key, you can start a 7‑day trial on the Pro plan ($49.99/month afterward) and be up and running in minutes: Register.
Historical OHLC for candlesticks and backtesting
For charting and strategy validation, you’ll want open, high, low, close (OHLC). The OHLC endpoint returns daily candles keyed by your requested date. Use it to render candlesticks, compute ATR/volatility, or align event studies to precise session ranges.
Endpoint behavior to incorporate:
- Request a specific date (YYYY-MM-DD) to retrieve that session’s OHLC snapshot.
- Data is represented relative to the base currency (USD by default) and the unit is per index.
- On non-trading days, expect no candle or a carry of last close depending on the exchange schedule. Handle this by checking the returned date and timestamp.
You can explore the OHLC fields and payload structure in the Documentation. When wiring your front-end, read rates.KLSE.open/high/low/close for the requested date, and respect the returned base and timestamp for labeling and currency conversion if you display in another currency downstream.
Production details that save time
- Update frequency: the latest endpoint refresh cadence depends on your plan. Align polling and cache strategies with the update window.
- Timezone: use the response timestamp for cache keys and validity; don’t assume local time equals market time. For end-of-day processes, run after the local market close.
- Weekends/holidays: do not forward-fill into non-trading days when plotting candlesticks. For summary charts, you can forward-fill last close but clearly label the date.
- end_date cannot be today: when pulling time-series, set end_date to yesterday or the most recent trading day you intend to capture.
- Resilience: check success flags, handle HTTP errors, and use exponential backoff on retries.
- Symbols: confirm “KLSE” on the Symbols page before deploying to production. Do not hardcode symbols that aren’t documented.
- Units and base: all quoted “rates” are relative to data.base and the unit is per index. If you transform or normalize, store the method alongside the data to make backtests reproducible.
Quick reference to fields you’ll actually use
- base — currency in which the index rate is expressed; default “USD”.
- date — trading date string “YYYY-MM-DD”, use for labels and DB primary keys.
- timestamp — epoch seconds, use for cache lifetimes and freshness logic.
- rates.KLSE — USD per index unit for KLSE on that date.
- OHLC fields — rates.KLSE.open, .high, .low, .close for candlesticks.
Where to go next
Explore the full index coverage, OHLC specifics, and intraday capabilities in the Documentation. Confirm live symbol codes on the Symbols page. If you need to evaluate your data controls and compliance workflows, read the MCP overview. For a fast start with a 7‑day trial, head to Register. You can always reach the product site at indices-api.com.
FAQ
What symbol should I use for the FTSE Bursa Malaysia KLCI?
Use “KLSE”. Always confirm on the Symbols page before deploying.
Why does end_date fail if I pass today’s date?
Time-series queries should end at a completed trading day. Use yesterday for end_date; avoid partial sessions.
How are values quoted?
By default, base is USD, and rates are “USD per index” (unit: per index). For example, rates.KLSE is the USD price per one KLSE index unit. Some payloads also include USDKLSE (KLSE units per 1 USD).
How often does the latest endpoint update?
Update frequency depends on your subscription tier (for example, around every 60 minutes on entry tiers, faster on higher tiers). Align your polling and cache TTL with your plan; see the Documentation.
Can I get OHLC candles for KLSE?
Yes. Use the OHLC endpoint to retrieve open, high, low, and close for a requested date. Read rates.KLSE.open/high/low/close in the response. Handle non-trading days by checking the returned date and timestamp.
How do I start and what’s the cost?
Sign up for the Pro plan ($49.99/month) with a 7‑day free trial. Get your key here: Register.
Ready to wire KLSE into your dashboard or backtest? Grab a free trial key and ship your integration today: Register.