Sources › Finance › IDX (Bursa Efek Indonesia) › Stock History

IDX Stock History API
Riwayat harian satu saham dalam satu panggilan, sampai 2020: OHLC, volume, nilai, frekuensi, bid/offer, saham tercatat, plus arus beli/jual investor asing dalam lembar dan nilai rupiah turunannya. Terima rentang `from`/`to` atau `length` hari bursa.
Request
https://api.zapi.ink/v1/finance:idx/stock-historySend your key in the x-api-key header. The response is JSON in the { project, data, timestamp } envelope, and an identical request is served from cache for 1 minute.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| code | string | query | Yes | Stock code. Required. Example: BBCA |
| from | string | query | No | Start date (YYYY-MM-DD or YYYYMMDD). When set, `length` is derived from the range. Example: 2026-07-01 |
| to | string | query | No | End date (YYYY-MM-DD or YYYYMMDD). Defaults to the latest trading day. Example: 2026-08-08 |
| length | number | query | No | Number of trading days when `from` is not set (default 30, max 2000) Example: 30 |
Code examples
curl -X GET "https://api.zapi.ink/v1/finance:idx/stock-history?code=BBCA&from=2026-07-01&to=2026-08-08&length=30" \ -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
const res = await fetch("https://api.zapi.ink/v1/finance:idx/stock-history?code=BBCA&from=2026-07-01&to=2026-08-08&length=30", { method: "GET", headers: { "x-api-key": "zpi_xxxxxxxxxxxxxxxxxxxxxxxx" }, }); const data = await res.json(); console.log(data);
import requests res = requests.get( "https://api.zapi.ink/v1/finance:idx/stock-history", params={"code":"BBCA","from":"2026-07-01","to":"2026-08-08","length":"30"}, headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"}, ) print(res.json())
Example response
{ "project": "finance:idx", "data": { "to": "2026-08-07", "code": "SSIA", "from": "2026-07-01", "name": "Surya Semesta Internusa Tbk.", "unit": "shares", "count": 28, "items": [ { "bid": 1670, "low": 1655, "date": "2026-08-07", "high": 1690, "open": 1655, "close": 1670, "offer": 1675, "value": 14356282500, "change": 15, "volume": 8596500, "previous": 1655, "frequency": 2165, "listedShares": 4705249440, "foreignBuyValue": 1265192000, "netForeignValue": 781560000, "foreignBuyShares": 757600, "foreignSellValue": 483632000, "netForeignShares": 468000, "foreignSellShares": 289600 }, { "bid": 1655, "low": 1655, "date": "2026-08-06", "high": 1710, "open": 1685, "close": 1655, "offer": 1660, "value": 19197284000, "change": -15, "volume": 11447000, "previous": 1670, "frequency": 3305, "listedShares": 4705249440, "foreignBuyValue": 1200702500, "netForeignValue": -3797066500, "foreignBuyShares": 725500, "foreignSellValue": 4997769000, "netForeignShares": -2294300, "foreignSellShares": 3019800 }, { "bid": 1670, "low": 1660, "date": "2026-08-05", "high": 1685, "open": 1675, "close": 1670, "offer": 1675, "value": 21255486500, "change": 15, "volume": 12726200, "previous": 1655, "frequency": 3174, "listedShares": 4705249440, "foreignBuyValue": 2823469000, "netForeignValue": 947057000, "foreignBuyShares": 1690700, "foreignSellValue": 1876412000, "netForeignShares": 567100, "foreignSellShares": 1123600 }, { "bid": 1655, "low": 1635, "date": "2026-08-04", "high": 1690, "open": 1650, "close": 1655, "offer": 1660, "value": 24366083500, "change": 5, "volume": 14631400, "previous": 1650, "frequency": 3001, "listedShares": 4705249440, "foreignBuyValue": 3981102500, "netForeignValue": 2325606000, "foreignBuyShares": 2405500, "foreignSellValue": 1655496500, "netForeignShares": 1405200, "foreignSellShares": 1000300 }, { "bid": 1650, "low": 1650, "date": "2026-08-03", "high": 1695, "open": 1665, "close": 1650, "offer": 1655, "value": 21072123500, "change": 0, "volume": 12636800, "previous": 1650, "frequency": 3471, "listedShares": 4705249440, "foreignBuyValue": 995940000, "netForeignValue": -4350555000, "foreignBuyShares": 603600, "foreignSellValue": 5346495000, "netForeignShares": -2636700, "foreignSellShares": 3240300 }, { "bid": 1650, "low": 1615, "date": "2026-07-31", "high": 1690, "open": 1630, "close": 1650, "offer": 1655, "value": 29946218500, "change": 40, "volume": 18079300, "previous": 1610, "frequency": 3994, "listedShares": 4705249440, "foreignBuyValue": 2134605000, "netForeignValue": 637560000, "foreignBuyShares": 1293700, "foreignSellValue": 1497045000, "netForeignShares": 386400, "foreignSellShares": 907300 }, { "bid": 1610, "low": 1575, "date": "2026-07-30", "high": 1610, "open": 1605, "close": 1610, "offer": 1615, "value": 14342819000, "change": 25, "volume": 9012100, "previous": 1585, "frequency": 2335, "listedShares": 4705249440, "foreignBuyValue": 3586597000, "netForeignValue": 2784173000, "foreignBuyShares": 2227700, "foreignSellValue": 802424000, "netForeignShares": 1729300, "foreignSellShares": 498400 }, { "bid": 1580, "low": 1555, "date": "2026-07-29", "high": 1655, "open": 1605, "close": 1585, "offer": 1585, "value": 21078841000, "change": -20, "volume": 13196700, "previous": 1605, "frequency": 4871, "listedShares": 4705249440, "foreignBuyValue": 3144323000, "netForeignValue": -2024996000, "foreignBuyShares": 1983800, "foreignSellValue": 5169319000, "netForeignShares": -1277600, "foreignSellShares": 3261400 } ], "dataset": "stock-history", "provider": "idx", "valueBasis": "close" }, "timestamp": "2026-06-13T02:22:00Z" }
Frequently asked questions
How do I call the IDX Stock History API?
Send a GET request to https://api.zapi.ink/v1/finance:idx/stock-history?code=BBCA with your Zapi key in the x-api-key header. Parameters — required: code; optional: from, to, length. The response is JSON in the { project, data, timestamp } envelope.
What does the IDX Stock History API return?
Riwayat harian satu saham dalam satu panggilan, sampai 2020: OHLC, volume, nilai, frekuensi, bid/offer, saham tercatat, plus arus beli/jual investor asing dalam lembar dan nilai rupiah turunannya. The example response has the fields to, code, from, name, unit, count, items, dataset. Each item in items has fields such as bid, low, date, high, open, close, offer, value.
Is the IDX Stock History API free?
Yes. It is on the Zapi free tier: 600 Zap a month with one API key and no credit card. Each call costs 5 Zap. Paid plans raise the limits.
Can an AI assistant call the IDX Stock History API?
Yes. Add the Zapi MCP server (https://mcp.zapi.ink/mcp) to Claude, Cursor or another MCP client and ask in plain words; it calls run_scraper with scraper "idx" and endpoint "stock-history".
What other IDX API endpoints are there?
It has 47 endpoints. Besides Stock History: Ringkasan Saham, Ringkasan Indeks, Top Movers, Ringkasan Broker, Emiten Tercatat, Daftar Securities, and 40 more.