Indonesia Stocks API Quick-Start Guide: IDX Real-Time Quotes & Historical Data

  1. iTick
  2. Tutorial
Indonesia Stocks API Quick-Start Guide: IDX Real-Time Quotes & Historical Data - iTick
Indonesia Stocks API Quick-Start Guide: IDX Real-Time Quotes & Historical Data

Indonesia, Southeast Asia’s largest economy, hosts the Indonesia Stock Exchange (IDX) — home to leading blue-chip issuers such as Bank Central Asia (BBCA), Telkom Indonesia (TLKM), Bank Rakyat Indonesia (BBRI), and others. The IDX has become a key focus for global quantitative traders and fintech developers. However, obtaining reliable, low-latency Indonesian equity data has historically been challenging: free endpoints suffer from high latency, incomplete historical depth, and inconsistent documentation.

This guide shows you how to integrate IDX market data using the iTick API in under 30 minutes — covering real-time quotes, historical bars, and WebSocket streaming — with just a few lines of Python and a free-tier account.

Why iTick Is the Best Indonesia Stock API Choice

  • Full IDX Coverage — All listed securities accessible via region=ID
  • Multi-Protocol Support — REST for on-demand queries, WebSocket for real-time push (<50 ms latency)
  • Deep Historical Data — 30+ years of bars (daily to minute-level), perfect for robust backtesting
  • Generous Free Tier — Unlimited basic real-time quote calls, developer-friendly

1. 5-Minute Quick Start: Fetch Real-Time Quotes

1. Register & Obtain API Token

Visit the iTick official website to register (≈30 seconds). Your personal API Token is immediately available in the developer console.

2. Install Dependency

      pip install requests

    

3. First Line of Code: Retrieve Bank Central Asia (BBCA) Live Quote

      import requests

API_KEY = "your_token_here"
url = "https://api.itick.org/stock/quote"
params = {"region": "ID", "code": "BBCA"}
headers = {"token": API_KEY}

resp = requests.get(url, params=params, headers=headers).json()
if resp["code"] == 0:
    data = resp["data"]
    print(f"{data['n']} Last: {data['ld']} IDR, Change: {data['chp']}%")
else:
    print("Error:", resp["msg"])

    

Sample Output:

      PT Bank Central Asia Tbk Last: 10250 IDR, Change: 0.49%

    

That’s it — you now have live Indonesian equity data.

2. Core Functionality at a Glance

2.1 Historical OHLCV Bars (Backtesting Ready)

      def get_kline(symbol, interval="8", limit=100):
    params = {"region": "ID", "code": symbol, "interval": interval, "limit": limit}
    resp = requests.get("https://api.itick.org/stock/kline", headers=headers, params=params).json()
    return resp.get("data", [])

# Fetch last 10 trading days of Telkom Indonesia
kline_data = get_kline("TLKM", limit=10)
print(kline_data[-1])  # Most recent bar

    

Supported intervals: 8 (daily), 9 (weekly), 10 (monthly), and minute-level bars.

2.2 Low-Latency WebSocket Real-Time Streaming

      import websocket
import json

def on_message(ws, message):
    data = json.loads(message)
    if "data" in data:
        md = data["data"]
        if md["type"] == "quote":
            print(f"{md['s']} Last: {md['ld']} IDR")

ws = websocket.WebSocketApp("wss://api.itick.org/stock",
                            header={"token": API_KEY},
                            on_open=lambda ws: ws.send(json.dumps({
                                "ac": "subscribe",
                                "params": "BBCA$ID,TLKM$ID",
                                "types": "quote"
                            })),
                            on_message=on_message)
ws.run_forever()

    

After subscription, you receive live quote updates with sub-50 ms latency.

3. Indonesia Market Quick Reference (Developer Essentials)

ItemDetails
Market Coderegion=ID (REST) or $ID (WebSocket)
Flagship StocksBBCA (Bank Central Asia), TLKM (Telkom Indonesia), BBRI (Bank Rakyat Indonesia), ASII (Astra), GOTO (GoTo Group)
Benchmark IndicesJKSE (Jakarta Composite Index), LQ45 (Blue-chip index)
Trading HoursJakarta time 09:00–16:00 (continuous, no lunch break) — same as Beijing time
CurrencyIndonesian Rupiah (IDR) — note large nominal values

4. Why Developers Choose iTick for IDX Data

Use CasePain Points of Free APIsiTick Advantage
Quantitative BacktestingOnly 1–2 years of data30+ years of bars, including minute data
Live Trading15-minute delayWebSocket push <50 ms
Application DevelopmentREST polling onlyREST + WebSocket dual protocols
Cost ControlHeavy rate limitsFree tier with unlimited basic quotes

5. Summary: Start Your Indonesia Quant Journey Today

With this guide, you now know how to:

  • ✅ Fetch real-time IDX quotes and historical bars via REST
  • ✅ Subscribe to sub-50 ms live updates via WebSocket
  • ✅ Understand core Indonesian market identifiers and conventions

iTick delivers stable, comprehensive, and free Indonesian equity data — perfect for building quantitative strategies, fintech applications, or conducting academic research.

👉 Register now at https://itick.org and begin accessing IDX data today!


Further Reading: