Skip to content
Back to search

idx

Analyze the Indonesian stock market (IDX/IHSG) from web terminal, CLI, or any AI agents via MCP server. IHSG Prices, Fundamentals, and Screening. Free and No API keys required. Changelog: https://github.com/fzn0x/idx/blob/main/CHANGELOG.md

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/fzn0x/idx with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/fzn0x/idx'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/fzn0x--idx/badge.svg)](/listings/fzn0x--idx)

HTML

<a href="/listings/fzn0x--idx"><img src="/api/listings/fzn0x--idx/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

The package is called **`ihsg-cli`**; the command it installs is **`idx`** (npm also adds `ihsg-cli` as an alias).

cargo install ihsg-cli                    # crates.io, builds from source (Rust 1.88+)
npm install -g github:fzn0x/idx           # npm, straight from this repository
npx github:fzn0x/idx stocks quote BBCA    # npm, no install
curl -fsSL https://raw.githubusercontent.com/fzn0x/idx/main/install.sh | sh   # Linux, macOS

npm installs a small launcher from this repository; the first `idx` command downloads the prebuilt binary for your platform from the matching GitHub release and checks it against the release's `SHA256SUMS` (so does `install.sh`). The binary is stored next to the launcher, or in a per-user cache when the global npm folder is not writable. On npm 12, which only installs from git when allowed, add `--allow-git=all` to the command.

Windows without npm: download `idx-<version>-x86_64-pc-windows-msvc.zip` from the [releases page](https://github.com/fzn0x/idx/releases). Static Linux binaries are musl builds and run on any distribution. The development version installs with `cargo install --git https://github.com/fzn0x/idx`.

Shell completions:

idx completions bash > ~/.local/share/bash-completion/completions/idx
idx completions zsh  > ~/.zfunc/_idx
idx completions fish > ~/.config/fish/completions/idx.fish
idx completions powershell | Out-String | Invoke-Expression

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 525 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <picture>
  3. <source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg">
  4. <source media="(prefers-color-scheme: light)" srcset="assets/logo-light.svg">
  5. <img src="assets/logo.svg" alt="IDX: Indonesian market data for people and agents" width="480">
  6. </picture>
  7. </p>
  8. <p align="center">
  9. Indonesian stock market (IDX / IHSG) analysis for people and AI agents.<br>
  10. One binary: a CLI that prints tables, a JSON mode for scripts, and an MCP server for agents.
  11. </p>
  12. <p align="center">
  13. <a href="https://github.com/fzn0x/idx/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/fzn0x/idx/actions/workflows/ci.yml/badge.svg"></a>
  14. <a href="LICENSE"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-16a34a.svg"></a>
  15. <a href="https://ihsg.midoriresearch.com"><img alt="Web terminal" src="https://img.shields.io/badge/web-ihsg.midoriresearch.com-123a64.svg"></a>
  16. </p>
  17. ---
  18. <p align="center">
  19. <a href="https://ihsg.midoriresearch.com"><img src="docs/screenshots/landing.png" alt="ihsg.midoriresearch.com: IHSG with the day's chart, stocks up and down, and a stock search, in Bahasa Indonesia and English" width="100%"></a>
  20. </p>
  21. ```sh
  22. idx stocks quote BBCA,BBRI,TLKM
  23. ```
  24. ```
  25. ╭────────┬──────────────────────────────┬───────┬──────┬─────────┬───────┬───────┬───────┬───────────────┬─────────┬───────┬────────╮
  26. │ Symbol ┆ Name ┆ Price ┆ Chg ┆ Chg % ┆ Open ┆ High ┆ Low ┆ Volume ┆ Mkt Cap ┆ P/E ┆ Div % │
  27. ╞════════╪══════════════════════════════╪═══════╪══════╪═════════╪═══════╪═══════╪═══════╪═══════════════╪═════════╪═══════╪════════╡
  28. │ BBCA ┆ PT Bank Central Asia Tbk ┆ 5,175 ┆ -900 ┆ -14.81% ┆ 5,825 ┆ 5,825 ┆ 5,175 ┆ 1,241,098,200 ┆ 635.7T ┆ 10.96 ┆ 6.27% │
  29. │ BBRI ┆ PT Bank Rakyat Indonesia (P… ┆ 2,640 ┆ -460 ┆ -14.84% ┆ 2,640 ┆ 2,890 ┆ 2,640 ┆ 1,193,916,400 ┆ 397.8T ┆ 6.49 ┆ 13.48% │
  30. │ TLKM ┆ Perusahaan Perseroan (Perse… ┆ 1,900 ┆ -330 ┆ -14.80% ┆ 1,900 ┆ 1,985 ┆ 1,900 ┆ 963,614,200 ┆ 187.3T ┆ 10.98 ┆ 10.01% │
  31. ╰────────┴──────────────────────────────┴───────┴──────┴─────────┴───────┴───────┴───────┴───────────────┴─────────┴───────┴────────╯
  32. Last trade 2026-10-16 16:14 WIB · market closed · delayed data
  33. ```
  34. ```sh
  35. idx -o json stocks quote BBCA | jq '.data[0] | {price, change_pct, pe_trailing, dividend_yield_pct}'
  36. ```
  37. ```json
  38. { "price": 5175.0, "change_pct": -14.814815, "pe_trailing": 10.963983, "dividend_yield_pct": 6.27 }
  39. ```
  40. <p align="center">
  41. <img src="docs/screenshots/cli.png" alt="idx stocks quote and idx stocks compare in a terminal" width="100%">
  42. </p>
  43. - **Free data, no keys.** Yahoo Finance and MSN Money for prices and
  44. fundamentals, the exchange's own idx.co.id summaries for foreign flow,
  45. member activity, indices and the corporate-action calendar, IDX's monthly
  46. KSEI register for ownership, Indo Premier's broker summary for who bought
  47. and sold (read as bandarmology by `idx bandar`) and for foreign flow in
  48. rupiah (`stocks foreign --source ipot`), its corporate-action
  49. pages, Kontan and CNBC Indonesia feeds for news. Every source sits behind a `Provider` trait, so
  50. one breaking does not take the tool down, and `auto` fills gaps in one
  51. source's fundamentals from the other.
  52. - **Built for agents.** `-o json` emits a stable, schema-documented envelope
  53. (`idx schema quotes`), `-o jsonl` one record per line. Exit codes mean
  54. something, and `-` reads tickers from stdin so commands chain. `idx mcp`
  55. exposes every command as a typed MCP tool that returns the very same JSON.
  56. - **Works offline.** Responses are cached with per-endpoint TTLs; `--offline`
  57. serves the cache instead of failing when the network is gone.
  58. - **Ownership, not just prices.** KSEI's monthly register of holders above 1 %
  59. is imported into local SQLite with normalised entity names, so "who owns
  60. more than 1 % of BBCA" and "what did this fund change last month" are one
  61. command each. The monthly IDX files are mirrored to GitHub, so neither you
  62. nor the web terminal imports anything by hand: `idx ownership sync`
  63. installs every month in one download.
  64. - **Single static binary.** Rust, no runtime, Linux / macOS / Windows.
  65. ## Install
  66. The package is called **`ihsg-cli`**; the command it installs is **`idx`**
  67. (npm also adds `ihsg-cli` as an alias).
  68. ```sh
  69. cargo install --locked ihsg-cli # crates.io, builds from source (Rust 1.89+)
  70. npm install -g ihsg-cli # npm
  71. npx ihsg-cli stocks quote BBCA # npm, no install
  72. curl -fsSL https://raw.githubusercontent.com/fzn0x/idx/main/install.sh | sh # Linux, macOS
  73. nix profile install github:fzn0x/idx # Nix (Linux; Apple silicon macOS untested), with shell completions
  74. nix run github:fzn0x/idx -- stocks quote BBCA # Nix, no install
  75. ```
  76. npm installs a small launcher; the first `idx` command downloads the
  77. prebuilt binary for your platform from the matching GitHub release and checks
  78. it against the release's `SHA256SUMS` (so does `install.sh`). The binary is
  79. stored next to the launcher, or in a per-user cache when the global npm
  80. folder is not writable. `npm install -g github:fzn0x/idx` installs the same
  81. launcher from this repository's `main`; npm 12 only installs from git with
  82. `--allow-git=all`.
  83. Windows without npm: download `idx-<version>-x86_64-pc-windows-msvc.zip` from
  84. the [releases page](https://github.com/fzn0x/idx/releases). Static Linux
  85. binaries are musl builds and run on any distribution. The development version installs
  86. with `cargo install --git https://github.com/fzn0x/idx`.
  87. Nix builds idx from source on your machine (there is no binary cache), so the
  88. first `nix profile install` or `nix run` takes several minutes. The bare
  89. `github:fzn0x/idx` ref follows `main`; add a release tag to pin one, as in
  90. `github:fzn0x/idx/v0.8.2` (the first release with the flake). For MCP clients,
  91. install once and register `$HOME/.nix-profile/bin/idx`, written as an absolute
  92. path, with the argument `mcp`: `idx mcp setup` prints the binary's resolved
  93. `/nix/store` path, which an upgrade followed by garbage collection removes.
  94. `nix run github:fzn0x/idx#mcp` starts the same server without installing, for
  95. trying it from a terminal; do not make it a client's server command, because a
  96. cold start (the first run, or the first after `main` moves) builds idx before
  97. the server answers, which takes longer than clients wait. `overlays.default`
  98. adds `pkgs.idx` for NixOS and home-manager configurations, and `nix develop` in
  99. a clone gives the toolchain from `rust-toolchain.toml` plus Node for `web/`. On
  100. NixOS, point `idx stockbit login` at a browser with
  101. `IDX_BROWSER=$(command -v chromium)`.
  102. Shell completions:
  103. ```sh
  104. idx completions bash > ~/.local/share/bash-completion/completions/idx
  105. idx completions zsh > ~/.zfunc/_idx
  106. idx completions fish > ~/.config/fish/completions/idx.fish
  107. idx completions powershell | Out-String | Invoke-Expression
  108. ```
  109. ## Commands
  110. | command | what it does |
  111. | --- | --- |
  112. | `stocks quote <SYMBOLS>` | Delayed quote for one or many tickers (`BBCA,BBRI` or `BBCA BBRI`; `.JK` optional; `-` reads them from stdin; another Yahoo Finance market by its suffix, e.g. `D05.SI`) |
  113. | `stocks history <SYMBOL> [--period 1y] [--interval 1d] [--limit 30]` | OHLCV candles with a summary line. Periods `1d 5d 1mo 3mo 6mo 1y 2y 5y 10y ytd max`, intervals `1m 2m 5m 15m 30m 1h 1d 1wk 1mo` (`1m` covers at most `5d`, `2m` at most `1mo`) |
  114. | `stocks intraday <SYMBOL> [--interval 1m] [--limit 15]` | The latest session by the minute (today's while the market trades, otherwise the last one): OHLCV bars, the quote with its previous close and change, and a summary of the bars with VWAP computed by idx. Yahoo's chart, no login, about 10 minutes behind the market; works for IHSG (`^JKSE`) too. `--provider stockbit` makes the bars realtime |
  115. | `stocks profile <SYMBOL>` | Sector, industry, description, size, headquarters, management |
  116. | `stocks financials <SYMBOL> [--period annual\|quarterly\|ttm] [--statement income,balance,cash]` | Income statement, balance sheet, cash flow; `--statement` (comma-separated or repeated, `all` by default) picks the tables shown |
  117. | `stocks earnings <SYMBOL> [--annual\|--quarterly] [--reported\|--estimates]` | Quarterly EPS vs estimates with surprise, yearly and quarterly revenue/earnings, analyst consensus for this and next quarter and fiscal year, next earnings date; the flags keep only those rows in every format (`--history`/`--forecast` are aliases) |
  118. | `stocks dividends <SYMBOL>` | Every cash dividend (ex-date, split-adjusted amount) and split; yearly totals, TTM total and yield, payout streak |
  119. | `stocks returns <SYMBOLS> [--benchmark ^JKSE]` | 1w/1m/3m/6m/YTD/1y/3y/5y returns, CAGR, volatility, max drawdown, best/worst day, 52-week position, and excess over IHSG |
  120. | `stocks rotation <SYMBOLS> [--benchmark ^JKSE] [--interval 1wk\|1d] [--window 14] [--tail 10]` (alias `rrg`) | Relative rotation graph: each ticker's RS-Ratio, RS-Momentum and quadrant (leading, weakening, lagging, improving) against IHSG, with its recent path. An open approximation of the JdK formulas; see [Relative rotation](#relative-rotation) |
  121. | `stocks brief <SYMBOL>` | One page: quote, verdict, signal, returns vs IHSG, dividends, top holders, headlines, with plain-language key points |
  122. | `stocks fundamental <SYMBOL>` | P/E, P/B, PEG, EV/EBITDA, ROE, ROA, margins, leverage, growth, dividend, analyst targets, plus a plain-language verdict that lists every rule it applied (negative equity counts against a company; multiples that mix USD statements with an IDR price are marked and not scored) |
  123. | `stocks growth <SYMBOL>` | Growth lens: latest-quarter revenue and earnings growth, forward EPS against trailing, and revenue and net income across the annual statements (CAGR, how often revenue grew, a turn from profit to loss); every rule with its points, every skipped rule with the reason |
  124. | `stocks valuation <SYMBOL>` | Valuation lens: P/E, PEG, P/B, P/S, EV/EBITDA, dividend yield and the analyst target (3 or more analysts), each scored; multiples that mix USD statements with an IDR price are shown, not scored |
  125. | `stocks risk <SYMBOL>` | Risk lens: negative equity, debt/equity, current ratio, losses, and beta, volatility and largest fall against IHSG over a year of daily closes (computed by idx, not the source's beta). `stocks fundamental <SYMBOL> --lens growth\|valuation\|risk` gives the same three readings |
  126. | `stocks technical <SYMBOL> [--period 1y]` | RSI, MACD, SMA/EMA 20/50/200, Bollinger, ATR, volume, support/resistance, trend, buy/sell/neutral signal with reasons |
  127. | `stocks compare <SYMBOLS>` | Side-by-side fundamentals for two or more tickers |
  128. | `stocks screen [--preset P] [-f "pe<15,roe>15,sector=financial"] [--sort KEY] [--asc\|--desc] [--returns]` | Screener over ~950 IDX tickers: one batch quote for valuation/size/dividend keys and `range` (position in the 52-week range), one request for MSN's whole-market list for the return keys `ret1w ret1m ret3m ret6m retytd ret1y`, per-company fundamentals for the rest (capped, largest first). Presets defined by idx: `top-performers`, `worst-performers`, `high-dividend`, `low-pe`, `52w-high`, `52w-low`, `high-volume`, `large-cap`. A P/B over statements in another currency than the price (USD reporters such as BSSR) is marked with `*`, and `pb` and `ps` filters and sorts read such P/B and P/S as missing |
  129. | `stocks news [SYMBOL] [--company-only] [--source kontan\|cnbcindonesia\|all]` | Headlines from Kontan and CNBC Indonesia RSS. With a ticker, the company's headlines come first, then market context fills the limit |
  130. | `stocks sentiment <SYMBOL>` | Aggregate lexicon sentiment over the matching headlines, with counts, terms and the strongest headlines |
  131. | `stocks insights <SYMBOL> [--all]` | MSN Money's rule-based statements (about 30, in Valuation, Earnings, Growth, Performance, Health), each rated good, bad, neutral or not rated against the peers, the industry, the company's own history or the price, with the peer tickers |
  132. | `stocks actions <SYMBOL> [--since D]` | Corporate actions from IPOT, upcoming ones included: cash and stock dividends, splits, bonus shares, rights issues (amount, ratio old:new, cum, ex, recording and payment dates, status, announcement), shareholders' meetings (RUPS: time, venue, agenda), listed warrants and rights |
  133. | `stocks foreign <SYMBOL> [--days 20 \| --from D --to D] [--source idx\|ipot]` | Foreign buying and selling per session, totals and the net-buy/net-sell streak: from idx.co.id by default (shares on the regular board, as IDX publishes them, net and net × close), or from IPOT with `--source ipot` (rupiah across all boards, value traded and foreign share; works where idx.co.id refuses the connection) |
  134. | `stocks list [--board B] [--search S]` | Listed stocks from idx.co.id with listing board, listing date and shares; the bundled universe stands in offline |
  135. | `ownership import --latest\|--all [--family composition]\|--file F\|--url U` | Import KSEI's monthly ">1 % holders" register (XLSX or PDF) into local SQLite. `--latest`/`--all` read idx.co.id and fall back to the CI-maintained GitHub mirror. `--family composition`, or a ZIP/TXT given to `--file`/`--url`, imports KSEI's composition archive into its own tables |
  136. | `ownership sync [--force]` · `ownership status` | Install the prebuilt SQLite snapshot CI builds from the mirrored files (one download, SHA-256 checked), then any newer month; a database holding months the snapshot lacks is kept unless `--force` (a `.bak` copy is kept). `status` shows the local database, the mirror and what sync would do |
  137. | `ownership ticker <SYMBOL> [--as-of D]` | Holders above 1 % of a ticker (a holder's accounts summed; controller/affiliate flag from the 30 Oct 2026 register) |
  138. | `ownership entity "<NAME>" [--as-of D] [--exact]` | Every position of a person or institution, spelling variants grouped (`--exact`: one holder by its key) |
  139. | `ownership search "<NAME>" [--limit N] [--as-of D]` | Find holders by name in every imported month: every spelling KSEI printed, words in any order, with the key for `entity --exact` |
  140. | `ownership cross-holders [--min-issuers N] [--type T] [--origin foreign\|local]` | Holders ranked by the number of issuers they own more than 1 % of, with every position |
  141. | `ownership concentration [SYMBOLS] [--by hhi\|top1\|top3] [--ascending]` | Issuers ranked by disclosed ownership concentration: HHI over the listed holders, largest and top-3 stakes, undisclosed percent, controller stake |
  142. | `ownership graph <ROOT> [--depth N] [--min-pct P] [--max-nodes N] [--dot]` | Holder-issuer network around a ticker or holder, as a table, JSON or Graphviz DOT |
  143. | `ownership resolve candidates\|merge\|map\|list\|undo` | Suggest, merge and split holder spellings KSEI printed differently between months (rules stored in the local database, undoable) |
  144. | `broker <SYMBOLS> [--date D \| --from D --to D] [--investor all\|foreign\|domestic] [--board all\|regular\|cash\|negotiated] [--source auto\|ipot\|stockbit]` | Broker summary: which brokers bought and sold a ticker, ranked by lots, with broker name, class (local, foreign, BUMN), lots, value and average price, plus total value and foreign net (for one investor side, what it bought and sold). IPOT publishes the top 10 per side; once `idx stockbit login` has stored a working session, `auto` (the default) lists every broker from Stockbit instead, and JSON says how many brokers each side had and whether its list is complete. Latest session with trades by default; `-o csv` gives one row per broker |
  145. | `bandar detect <SYMBOLS> [--period 1d\|1w\|1m\|3m] [--top 1\|3\|5\|10] [--daily]` | Bandarmology: are the top brokers accumulating or distributing? The top 1/3/5/10 buyers against as many sellers (bandar value and volume), net as a share of the value traded, the phase against the price move, the top buyers' average against the price, foreign flow; `--daily` adds the bandar movement session by session. See [Bandarmology](#bandarmology) |
  146. | `bandar screen [--preset P] [-f FILTER] [--period P] [--scan N]` | Bandarmology screener over the 100 most traded stocks by value: presets `big-accumulation`, `accumulation`, `distribution`, `big-distribution`, `quiet-accumulation`, `quiet-distribution`, `foreign-accumulation`, `below-bandar`, or filters on `acc`, `net`, `fnet`, `fpct`, `gain`, `chg`, `turnover`, `conc`, `signal`, `phase` |
  147. | `bandar broker <CODE> [--period P] [--scan N \| --symbols S]` | Broker activity: where one broker (e.g. `YP`) sits among the top 10 buyers or sellers of the 100 most traded stocks, with rank, lots, value, average, share of the stock's value and net where both sides are visible |
  148. | `market overview [--top 10]` | IHSG, breadth, turnover, gainers, losers, most traded, heavyweights from one pass over the universe |
  149. | `market foreign [--date D] [--top 10] [--sort value\|shares] [--source idx\|ipot]` | Top foreign net buying and net selling across every stock for one session (idx.co.id, in shares), with the market's foreign totals; `--source ipot` ranks the 100 most traded stocks (not every stock) by each one's foreign net in rupiah from IPOT's broker summaries, for the latest session IPOT has published, with the market's value traded and foreign buying, selling and net from IPOT's market statistics (its own shape, `idx.market.foreign.value.v1`) |
  150. | `market brokers [--date D] [--top 20] [--sort value\|volume\|frequency] [--source auto\|idx\|ipot]` | Every exchange member's trading for one session, ranked, with each member's share of all members' value: from idx.co.id, or from IPOT when idx.co.id refuses, cannot be reached, fails or has not published the session yet and IPOT holds that session (`auto`, the default), or with `--source ipot` (its latest session), which adds each member's class and net to the table, and its value bought and sold to `-o json`, `csv` and `jsonl` |
  151. | `market indices [CODE...] [--date D]` | Every IDX index (IHSG, LQ45, IDX30, sector and thematic) for one session: close, change, range, constituents, value, market cap |
  152. | `market calendar [--from D --to D \| --date D] [--symbol S] [--type T]` | The exchange calendar: dividend and rights dates (cum, ex, recording, payment), RUPS, public exposes, listings; bonds and buyback reports with `--type all`. Default: the next 14 days |
  153. | `market holidays [--year Y \| --all] [--upcoming]` | Trading holidays (Kalender Libur Bursa, bundled), the year's trading days, whether today is a trading day and the next one |
  154. | `market astro [--date D] [--days N] [--natal launch\|base\|none] [--backtest [--period P]]` | Traditional astrology for IHSG, computed offline: the Sun, Moon and planets (sign, degree, speed, retrograde) at 16:00 WIB, Moon phase, Mercury retrograde, Javanese weton, Chinese shio, phases, stations and ingresses ahead, aspects to IHSG's chart; `--backtest` tests them on IHSG's daily returns. See [Astrology](#astrology) |
  155. | `market members [--search S]` | Exchange members (broker codes) with names and licences |
  156. | `ownership changes --from D --to D [--symbol S] [--min-change PP] [--limit N --offset N]` | New holders, exits and position changes between two months, paged, with a summary (counts, foreign vs local net, by investor type, issuer flow, top moves) over every match |
  157. | `ownership foreign [SYMBOL] [--from D --to D]` | Disclosed foreign (KSEI `A`) vs local stake: one issuer month by month, or every issuer's change between two months |
  158. | `ownership composition <SYMBOL> [--as-of D]` | KSEI's monthly "Kepemilikan Efek" archive: local vs foreign shares in nine investor types, as a percent of the scripless shares, with the scripless share of listed shares and the trend over imported months. Downloads the newest month on first use |
  159. | `ownership institutions <SYMBOL>` | Institutional and fund holders from MSN Money (live, no import): shares, % of shares outstanding, the change since each holder's last report and a `new`/`buyer`/`seller`/`exited`/`unchanged` signal, with institutional, fund and free-float percentages and counts per list. See [docs/ownership.md](docs/ownership.md#institutional-and-fund-holders-msn) |
  160. | `stockbit login [--page [--port N]] \| status \| logout` | Opt-in: store your own Stockbit session, signed in in a browser idx opens or, over SSH and for Google sign-in, through a page on 127.0.0.1 for your own browser (idx never sees the password; every session is checked before it is stored); check when its tokens expire; delete it. See [docs/stockbit.md](docs/stockbit.md) |
  161. | `stockbit orderbook <SYMBOL>` | The live depth ladder and session foreign flow (your Stockbit session) |
  162. | `stockbit actions <SYMBOL> [--kind K] [--from D --to D]` · `stockbit calendar [--from D --to D \| --days N] [--kind K]` | Corporate actions from your Stockbit session, one structured row each: a stock's whole history (dividends since 2009 for BBCA, splits, bonus, rights, warrants, RUPS, public exposes, tender offers), or the market's calendar with rights, tender and IPO offers still open |
  163. | `stockbit movements [SYMBOL] [--from D --to D] [--holder ID] [--action A] [--source idx\|ksei] [--pages N]` | Insider and 5 % holder movements from your Stockbit session: IDX insider disclosures (with the trade price) and KSEI's 5 % holder changes (Stockbit's estimated price kept apart), shares exact and signed |
  164. | `watch [add\|rm\|list\|clear\|returns]` | Plain-text watchlist next to the config; `idx watch` quotes it |
  165. | `ownership releases\|discover [--family F --limit N]\|path` | Imported months, files published on idx.co.id and ksei.co.id (families `above1`, `above5`, `investor-type`, `classification`, `composition`, `all`, each marked `importable`), database path |
  166. | `mcp [--http ADDR --token T]` · `mcp setup <client>` | MCP server over stdio or streamable HTTP, and the registration recipe for 25 agent harnesses. 48 tools: `idx_brief`, `idx_market`, `idx_quote`, `idx_history`, `idx_intraday`, `idx_profile`, `idx_financials`, `idx_earnings`, `idx_dividends`, `idx_returns`, `idx_rotation`, `idx_fundamental`, `idx_technical`, `idx_compare`, `idx_screen`, `idx_news`, `idx_sentiment`, `idx_insights`, `idx_corporate_actions`, `idx_foreign`, `idx_instruments`, `idx_market_foreign`, `idx_market_brokers`, `idx_indices`, `idx_calendar`, `idx_holidays`, `idx_astro`, `idx_members`, `idx_broker`, `idx_bandar`, `idx_bandar_screen`, `idx_bandar_broker`, `idx_ownership_ticker`, `idx_ownership_entity`, `idx_ownership_changes`, `idx_ownership_foreign`, `idx_ownership_releases`, `idx_ownership_search`, `idx_ownership_rankings`, `idx_ownership_graph`, `idx_ownership_composition`, `idx_ownership_snapshot`, `idx_ownership_institutions`, `idx_orderbook`, `idx_stockbit_status`, `idx_stockbit_login`, `idx_stockbit_actions`, `idx_stockbit_movements` |
  167. | `schema [name]` | JSON Schema for every payload (`quotes`, `history`, `intraday`, `profile`, `fundamentals`, `growth`, `valuation`, `risk`, `compare`, `financials`, `earnings`, `dividends`, `returns`, `rotation`, `market`, `brief`, `technical`, `screen`, `news`, `sentiment`, `insights`, `actions`, `foreign`, `foreign-value`, `instruments`, `market-foreign`, `market-brokers`, `indices`, `calendar`, `holidays`, `astro`, `members`, `broker`, `bandar`, `bandar-screen`, `bandar-broker`, `ownership-*`, `stockbit-*`, `watchlist`, `error`, ...) |
  168. | `config init\|set\|get\|path` | Config file management |
  169. | `cache stats\|clear\|path` | Response cache management |
  170. | `completions <shell>` | bash, zsh, fish, powershell, elvish |
  171. | `version` | Version, build and default paths |
  172. Global flags work anywhere on the line:
  173. | flag | env | meaning |
  174. | --- | --- | --- |
  175. | `-o, --output table\|json\|jsonl\|csv\|auto` | `IDX_OUTPUT` | Output format: tables for people, the JSON envelope for programs, one JSON record per line (`jsonl`), CSV rows of the payload's main list for spreadsheets; `auto` is a table on a terminal and the JSON envelope when piped (opt-in: the default stays `table`) |
  176. | `--provider auto\|yahoo\|msn\|stockbit` | `IDX_PROVIDER` | Data source (`auto` tries Yahoo, then MSN, and merges fundamentals; `stockbit` is opt-in realtime from your own session, see [docs/stockbit.md](docs/stockbit.md)) |
  177. | `--history-provider auto\|yahoo\|stockbit` | `IDX_HISTORY_PROVIDER` | Where candles come from; `auto` follows `--provider` (Yahoo for `msn`; under `stockbit`, Stockbit where its bars match the request and Yahoo otherwise or when Stockbit fails). See [docs/configuration.md](docs/configuration.md#history-provider) |
  178. | `--offline` | `IDX_OFFLINE=1` | Never touch the network |
  179. | `--no-cache` | `IDX_NO_CACHE=1` | Ignore cached responses |
  180. | `--timeout SECS` | `IDX_TIMEOUT_SECS` | Per-request timeout (default 15) |
  181. | `--no-color` | `NO_COLOR` | Plain tables |
  182. | `-v, -vv, -vvv` | `IDX_LOG` | Diagnostics on stderr, including every URL requested |
  183. | `-q, --quiet` | `IDX_QUIET=1` | stderr carries errors only: no warnings, notes or loading line. stdout is unchanged and `-o json` keeps `warnings` in the envelope |
  184. | | `IDX_EXCHANGE=SI` | Yahoo Finance suffix a bare ticker gets in `stocks quote`, `history`, `profile`, `financials`, `earnings`, `dividends`, `returns`, `rotation`, `fundamental`, `technical`, `compare` and `watch` (default `JK`, IDX). An explicit suffix (`D05.SI`) always works there; every other command reads IDX tickers only |
  185. | | `IDX_PROGRESS=never\|always` | The loading line on stderr (`⠹ 6s · waiting on investasi.kontan.co.id 6s`) shows on a terminal only; `never` hides it, `always` forces it |
  186. ## For scripts and agents
  187. ```sh
  188. idx -o json stocks history TLKM --period 1y --interval 1wk \
  189. | jq '.data.summary.change_pct'
  190. idx -o jsonl market holidays --year 2026 | jq -r .date # one record per line
  191. idx -o jsonl stocks screen -f 'pe<10,roe>15' -n 5 | idx stocks compare -
  192. echo BBCA BBRI | idx stocks quote - # tickers from stdin
  193. idx -q -o csv stocks quote BBCA BBRI > quotes.csv # stderr: errors only
  194. ```
  195. - stdout carries exactly one JSON document (`-o json`) or one JSON record per
  196. line (`-o jsonl`); everything else goes to stderr. Errors are one JSON line
  197. on stderr in both modes.
  198. - `-o auto` (or `IDX_OUTPUT=auto`) prints a table on a terminal and the JSON
  199. envelope when stdout is piped or captured.
  200. - `-` in a ticker list (`stocks quote|returns|rotation|compare`, `broker`, `bandar`,
  201. `watch add|rm`) reads tickers from stdin: plain text (spaces, commas or lines,
  202. `#` comments) or idx's own `-o json` / `-o jsonl` output.
  203. - The envelope records `provider`, `fetched_at`, `cached`, `stale`, `stale_reason` (`offline` or `fetch_failed`, only when stale) and `warnings`.
  204. - Fields the source did not return are `null`. Nothing is estimated.
  205. - Quotes carry `behind_session`: `true` when the last trade is dated before the latest IDX session that has ended (a suspended stock, one that did not trade, or a source that lags the close), using the bundled holiday calendar.
  206. - Exit codes: `0` ok · `2` usage · `3` network/provider (JSON code `blocked` when the source's bot protection, Cloudflare, refused the request) · `4` not found · `5` offline cache miss · `6` config.
  207. Full field reference: [docs/json-output.md](docs/json-output.md).
  208. Configuration and cache: [docs/configuration.md](docs/configuration.md).
  209. Calling idx from an agent (rules, exit codes, recipes, an agent-led install):
  210. [docs/agent-guide.md](docs/agent-guide.md).
  211. ### MCP server
  212. `idx mcp` serves the Model Context Protocol over stdio, which is what every
  213. local agent launches. `idx mcp --http` serves the same tools over streamable
  214. HTTP for products that only connect to a URL. `idx mcp setup <client>` prints
  215. the exact command or config snippet for your agent with the absolute path of
  216. the binary filled in, because GUI apps rarely inherit your shell `PATH`:
  217. ```sh
  218. idx mcp setup --list # every supported client
  219. idx mcp setup codex # prints: codex mcp add idx -- /abs/path/idx mcp
  220. idx mcp setup muse # prints the settings.json block Meta's Muse Code expects
  221. ```
  222. | agent | register idx |
  223. | --- | --- |
  224. | Claude Code | `claude mcp add --scope user idx -- idx mcp` |
  225. | Claude Desktop | `claude_desktop_config.json` → `"mcpServers": {"idx": {"command": "idx", "args": ["mcp"]}}` |
  226. | OpenAI Codex (CLI, IDE extension, app) | `codex mcp add idx -- idx mcp`, or `[mcp_servers.idx]` with `command`/`args` in `~/.codex/config.toml` |
  227. | Meta Muse Code | `~/.config/muse/settings.json`: `{"schema_version": 1, "mcp_servers": {"idx": {"transport": "stdio", "command": "idx", "args": ["mcp"], "mode": "optional"}}}` |
  228. | Google Antigravity (IDE, CLI) | `~/.gemini/config/mcp_config.json` → `mcpServers.idx` with an absolute `command` and no `type` field |
  229. | Gemini CLI | `gemini mcp add -s user idx idx mcp` |
  230. | GitHub Copilot CLI | `copilot mcp add idx -- idx mcp` |
  231. | VS Code (Copilot agent mode) | `code --add-mcp '{"name":"idx","command":"idx","args":["mcp"]}'`, or `.vscode/mcp.json` → `servers.idx` with `"type": "stdio"` |
  232. | Cursor · Windsurf · JetBrains · Warp · Trae · Augment | paste `{"mcpServers": {"idx": {"command": "idx", "args": ["mcp"]}}}` into the MCP settings (file paths in `idx mcp setup`) |
  233. | Kiro (IDE and CLI, formerly Amazon Q Developer CLI) | `~/.kiro/settings/mcp.json`, or `kiro-cli mcp add --name idx --command idx --args mcp` |
  234. | Zed | `settings.json` → `"context_servers": {"idx": {"command": "idx", "args": ["mcp"], "env": {}}}` |
  235. | Cline · Roo Code · Kilo Code | MCP Servers → Configure → `mcpServers.idx` with `"type": "stdio"` |
  236. | Continue | `~/.continue/mcpServers/idx.yaml` (`idx mcp setup continue` prints it) |
  237. | OpenCode | `opencode.json` → `"mcp": {"idx": {"type": "local", "command": ["idx", "mcp"], "enabled": true}}` |
  238. | Goose | `goose configure` → Add Extension → Command-line Extension → `idx mcp` |
  239. | Factory Droid | `droid mcp add idx "idx mcp"` |
  240. | Mistral Vibe | `~/.vibe/config.toml` → `[[mcp_servers]]` with `name = "idx"`, `transport = "stdio"`, `command`, `args` |
  241. | Qwen Code | `qwen mcp add idx idx mcp` |
  242. | Crush | `crush.json` → `"mcp": {"idx": {"type": "stdio", "command": "idx", "args": ["mcp"]}}` |
  243. | ChatGPT · Claude.ai · Perplexity · Devin · Manus | remote only: `idx mcp --http 127.0.0.1:8765 --token T --allowed-host '*'` behind an HTTPS tunnel, then add `https://<host>/mcp` as a connector with header `Authorization: Bearer T` |
  244. A bare `idx` in the table assumes the binary is on `PATH`; `idx mcp setup`
  245. substitutes the absolute path, and `--npx` swaps in `npx -y ihsg-mcp`: the
  246. npm package [`ihsg-mcp`](npm-mcp/README.md) runs `idx mcp` without installing
  247. idx, fetching the release binary on first start and checking it against the
  248. release's `SHA256SUMS` (`cmd /c npx -y ihsg-mcp` on Windows; from this
  249. repository `npx -y github:fzn0x/idx mcp` still works). Each entry's remote
  250. (HTTP) form and the config file locations are in [docs/mcp.md](docs/mcp.md).
  251. ```sh
  252. claude mcp add --scope user idx -- npx -y ihsg-mcp # no idx install needed (Node 18+)
  253. npx -y ihsg-mcp setup cursor # any client's recipe, in the npx form
  254. ```
  255. The server lists 48 tools with typed input schemas kept to the subset every
  256. harness accepts (no nullable type arrays, no `format` or `default` keywords)
  257. and one-paragraph descriptions. `idx_brief` is the one-call starting point;
  258. `idx_fundamental` takes an optional `lens` (`growth`, `valuation` or `risk`)
  259. for the focused readings of `stocks growth|valuation|risk`;
  260. each tool returns the same envelope as `-o json`, so an agent that learned the
  261. CLI already knows the tools. Failures come back as tool errors carrying
  262. `{error: {code, message}, exit_code}`.
  263. ## Relative rotation
  264. `idx stocks rotation` (alias `rrg`, MCP `idx_rotation`) places each ticker on
  265. a relative rotation graph against a benchmark, IHSG (`^JKSE`) by default:
  266. ```sh
  267. idx stocks rotation BBCA BBRI BMRI TLKM ASII
  268. idx stocks rotation BBCA TLKM --benchmark ^JKLQ45 --tail 5
  269. idx stocks rotation BBCA TLKM --interval 1d --window 20
  270. idx -o json stocks rotation BBCA GOTO | jq '.data.rows[] | {symbol, quadrant}'
  271. idx stocks rotation - < watchlist.txt
  272. ```
  273. The x axis is RS-Ratio (is the stock beating the benchmark?), the y axis
  274. RS-Momentum (is that getting stronger?), both centred on 100. The quadrants:
  275. **leading** (both at or above 100), **weakening** (ratio above, momentum
  276. below), **lagging** (both below), **improving** (ratio below, momentum
  277. above). Stocks usually rotate clockwise through them. Each row carries its
  278. latest point, the change over the tail, and the tail itself (the recent
  279. path, oldest first); the table adds the four quadrants laid out as the graph
  280. draws them.
  281. idx computes it from five years of daily closes (the history `stocks
  282. returns` reads, so the two share the cache), on the dates the stock and the
  283. benchmark both have:
  284. - RS = 100 x close / benchmark close
  285. - RS-Ratio = 100 + (RS - mean) / standard deviation over the last `--window` bars
  286. - RS-Momentum = 100 + the same z-score of RS-Ratio's rate of change
  287. The original JdK RS-Ratio and RS-Momentum (RRG Research, shown by StockCharts
  288. and Optuma) are proprietary, so this is an open approximation and says so
  289. (`method.approximation`, `method.formula` in the JSON): its values will not
  290. match those charts. The axes are in standard deviations, not percent. Weekly
  291. bars (`--interval 1wk`, the default) are each week's last session, and the
  292. current week counts with its latest one. Defaults: window 14, tail 10. A
  293. first point needs 2 x window bars and a full tail 2 x window + tail - 1 (37
  294. weeks by default); a shorter history (a new listing) leaves the row's values
  295. `null` with a warning, never a fill. Yahoo has no history for the IDX sector
  296. indices, so a sector graph is not possible yet; index codes that do have one
  297. (`^JKLQ45`, `^JKII`) work as symbols or as the benchmark. The web terminal
  298. does not draw the graph yet: it runs in the CLI and the MCP server. Not
  299. investment advice.
  300. ## Bandarmology
  301. "Bandar" is market slang for the big, concentrated money that moves a stock.
  302. `idx bandar` reads it from the IPOT broker summary, whose top 10 buyers and
  303. top 10 sellers are ranked by lots. For N = 1, 3, 5 and 10 the top N buyers'
  304. value minus the top N sellers' value is the bandar value (in lots, the bandar
  305. volume); its share of all value traded is the reading, with the headline on
  306. the top 5 (`--top`):
  307. | Top-N net, % of value | Signal | Phase when the price over the range is... |
  308. |---|---|---|
  309. | +15 or more | `big_accumulation` | up more than 2 %: `markup`; otherwise `quiet_accumulation` |
  310. | +5 to +15 | `accumulation` | as above |
  311. | -5 to +5 | `neutral` | `neutral` |
  312. | -15 to -5 | `distribution` | down more than 2 %: `markdown`; otherwise `quiet_distribution` |
  313. | -15 or less | `big_distribution` | as above |
  314. Quiet accumulation is the usual "bandar buying quietly": concentrated buying
  315. while the price stalls or falls. Each reading also gives the top buyers'
  316. average price against the last price (`bandar_gain_pct`: below zero they sit
  317. under water), how much of the value the top buyers took, the foreign net
  318. flow, and the rules in plain words (`reasons`). `--daily` adds the session
  319. series with its cumulative net and streak. The thresholds were set against
  320. the 40 most traded stocks in October 2026, where about half of single
  321. sessions read neutral. They are heuristics, not advice.
  322. ```sh
  323. idx bandar detect BBCA # last week, top 5 vs top 5
  324. idx bandar detect BBRI --period 1m --daily # with the bandar movement
  325. idx bandar screen --preset quiet-accumulation # buying while the price stalls
  326. idx bandar screen -f 'acc>=5,fpct>=5,gain<0' # with foreigners, under the bandar's average
  327. ```
  328. ## Astrology
  329. `idx market astro` is traditional astrology done carefully: the positions are
  330. astronomy, computed on this machine from JPL's Keplerian elements (Standish),
  331. Schlyter's Jupiter-Saturn terms and Meeus's lunar theory, and checked in the
  332. tests against JPL Horizons (Sun and Moon within 0.01°, planets within 0.04°,
  333. 1800-2050) and the USNO moon phases (within 2 minutes). The Javanese weton
  334. (day, pasaran, neptu) and the Chinese shio (Imlek computed from new moons and
  335. solar terms, checked against the published dates 1924-2050) come with it, and
  336. IHSG's own chart is cast for noon WIB on its launch (1983-04-01) or base date
  337. (1982-08-10, value 100), dates from secondary sources (Antara, Bisnis.com,
  338. CEIC) not yet confirmed against an IDX publication.
  339. `--backtest` asks whether any of it shows up in the index: IHSG's daily
  340. returns grouped by lunar phase, Mercury retrograde or direct, pasaran and Sun
  341. sign, each group tested against all other days (Welch's t, Bonferroni over the
  342. 27 groups). On every session from 1990-04-09 to 2026-11-04 (8,904 returns) no
  343. group passes Bonferroni; the nominal p < 0.05 groups (full moon -0.07 % a day,
  344. Capricorn +0.19 %, Pisces -0.10 %, Leo -0.09 %) are the lunar-effect and
  345. month-of-year patterns the finance literature already knows, since Sun signs
  346. follow the calendar. v1 prints no interpretations; it is not a forecast or
  347. investment advice.
  348. ```sh
  349. idx market astro # today: planets, Moon, Mercury, weton, shio
  350. idx market astro --date 2026-12-24 --days 7
  351. idx market astro --backtest # every session since 1990
  352. idx -o json market astro --backtest --period 10y | jq '.data.backtest.factors[0]'
  353. ```
  354. ## Data sources
  355. | source | used for | auth | notes |
  356. | --- | --- | --- | --- |
  357. | Yahoo Finance `v8/finance/chart` | history, intraday minute bars, quote fallback | none | IDX tickers carry the `.JK` suffix; another market's suffix (`D05.SI`) passes through for the Yahoo-backed commands. One-minute bars for up to 8 days per request and two-minute bars for the last 60 days (HTTP 422 beyond); minutes without a trade have no bar and the opening auction's volume is in no bar. `range=max` comes back monthly, so `--period max` with daily or weekly bars asks for `period1=0&period2=9999999999` |
  358. | Yahoo Finance `v7/finance/quote` | quotes | anonymous cookie + crumb, cached 6 h | Falls back to the chart endpoint (fewer fields) if rejected |
  359. | Yahoo Finance `v10/finance/quoteSummary` | profile, fundamentals, earnings | same session | Statement modules are empty at the source, so they are not used |
  360. | Yahoo Finance `fundamentals-timeseries` | financials | none | Annual, quarterly and TTM statement items |
  361. | idx.co.id "Data Kepemilikan Saham" page + `Media/*.xlsx` | ownership (KSEI monthly register) | none, but Cloudflare bot protection | Mirrored three times a day by GitHub Actions to the [`ownership-data`](https://github.com/fzn0x/idx/releases/tag/ownership-data) release (byte-identical files, SHA-256 in `index.json`). The CLI tries idx.co.id first, then the mirror; a Cloudflare refusal is the JSON error code `blocked`; `idx ownership sync` installs the prebuilt SQLite snapshot published next to the files. See [docs/ownership.md](docs/ownership.md) |
  362. | ksei.co.id "Kepemilikan Efek" page (`id/publikasi/data-dan-statistik/kepemilikan-efek`) + `storage/Download/BalanceposEfek*.zip` | ownership composition (local vs foreign by investor type, monthly) | none, no bot protection | One ZIP a month (about 125 KB, one pipe-separated TXT), scripless holdings only. The listing is cached 12 h; archives go into the local ownership database. CLI and MCP. See [docs/ownership.md](docs/ownership.md#ksei-composition-kepemilikan-efek) |
  363. | Indo Premier (IPOT) `module/saham/include/data-brokersummary.php` | broker summary, foreign flow (`--source ipot`) | none | Top 10 buyers and sellers per range, ranked by lots; figures of a million and more are rounded to one decimal by the source (`rounded: true`). Its nginx answers spurious 404s in bursts, so a 404 is retried with backoff. Over a range that reaches its latest session the source's foreign net counts that session twice, so idx rebuilds a range's foreign net from single sessions. Broker names come from IDX's member list, bundled as `data/brokers.csv`; `bandar` computes its readings from these summaries |
  364. | idx.co.id JSON endpoints behind its pages (`primary/TradingSummary/GetStockSummary`, `GetBrokerSummary`, `GetIndexSummary`, `ListedCompany/GetTradingInfoSS`, `Home/GetCalendar`, `StockData/GetSecuritiesStock`, `ExchangeMember/GetBrokerSearch`) | foreign flow, member activity, indices, the exchange calendar, listed stocks, members | none, but Cloudflare bot protection | Foreign trading is published in shares only; `foreign_net_value_at_close` (net shares × close) is a rupiah scale, not the traded value. The bot protection now and then refuses a request from any network, and data centres and CI runners more often: a challenged request is asked again for 30 s (under `market brokers --source auto`, only when IPOT cannot stand in), then a cached copy is served marked stale, and with none the `blocked` error says what to do. Closed sessions are cached for 30 days |
  365. | Indo Premier (IPOT) `module/saham/include/corporateaction.php` | corporate actions, RUPS, warrants and rights | none | Same module and spurious-404 retry as the broker summary; repeated rows are dropped |
  366. | Indo Premier (IPOT) `module/saham/include/ma-topbroker.php`, dated by `statistic.php?code=BBCA` | member activity (`market brokers --source ipot`, and `auto` when idx.co.id refuses, cannot be reached, fails or has not published the session; the web terminal's `brokers`) | none | Every broker of IPOT's latest session, ranked by value, with value bought, sold and net, shares, trades and class. The page takes no date, so past sessions cannot be asked for: the session comes from a second page, the `Today` row of BBCA's statistics, read together with the ranking. Figures of a million and more are abbreviated to two decimals (`rounded: true`); same spurious-404 retry. When the two pages roll over to a new session has not been measured, so a ranking read on a trading day from 08:58 to 19:00 WIB is refused rather than given a date it may not have, and in those hours IPOT is not asked unless a copy read outside them is cached. Until it is measured, both pages are assumed to have rolled over by 19:00 WIB: a date page naming an older session than the latest that has ended is refused (unless the pair is the one accepted for that session before), and a ranking that has not rolled over by then while its date page has is caught only when this cache remembers the previous session's ranking, from an earlier IPOT read. A broker IPOT lists apart under another member's code (`JB`, `[CC] BJB Sekuritas Jawa Barat`) is counted in that member, as idx.co.id counts it. On 2026-11-06 the two sources listed the same 88 members with trades and the same trades for each; values and volumes agreed within about one unit of IPOT's second decimal |
  367. | Indo Premier (IPOT) `module/saham/include/ma-marketstatistic.php`, dated by `statistic.php?code=BBCA` | the market's foreign totals in rupiah (`market foreign --source ipot`) | none | IPOT's latest session summed up by board (regular, negotiated, cash, total) and by foreign investors' side (bought, sold, net), in value, lots and trades; figures of a million and more are abbreviated to two decimals. Like the broker ranking it takes no date and is dated by BBCA's statistics page under the same rules (refused on a trading day from 08:58 to 19:00 WIB), with its own copy of that page. For 2026-11-06 its board values matched idx.co.id's; it does not say which boards its foreign figures cover, and its foreign lots were above idx.co.id's regular-board foreign shares |
  368. | computed on this machine: JPL Keplerian elements (Standish, Table 1; Pluto from JPL's archived table), Schlyter (Jupiter, Saturn), Meeus (Moon, nutation, aberration) | `market astro` | none | Checked against JPL Horizons and USNO recordings in `tests/fixtures/astro/`; the `--backtest` reads `^JKSE` daily history from Yahoo's chart endpoint |
  369. | idx.co.id trading-holiday calendar (published as an image per year) | trading holidays | none | Transcribed into `data/holidays.csv` (2026, 2027) and checked against IDX's monthly trading-day counts; `IDX_HOLIDAYS` overrides it |
  370. | Kontan RSS (`investasi`, `keuangan`, `industri`, `insight`) and CNBC Indonesia RSS (`market`, `research`, `news`) | news, sentiment | none | Bisnis.com refuses non-browser clients; listed as an opt-in source |
  371. | MSN Money `Finance/Quotes`, `Finance/Equities` | quotes, profile, fundamentals, analyst targets, institutional and fund holders (`ownershipSummary`) | MSN's own public web key (shipped; override with `IDX_MSN_API_KEY`) | Tickers resolve to MSN ids through its autosuggest service, filtered to exchange `XIDX` |
  372. | MSN Money `pages/finance/insights` (api.msn.com) | stocks insights | same public web key | Rule-based statements, refreshed about once a day (cached for the fundamentals TTL, 6 h by default); peers resolve to tickers through `Finance/Quotes`. MSN's crowd sentiment is not used: it has no data for IDX tickers |
  373. | MSN Money `Finance/Screener` (POST, whole Indonesian market) | screen return windows (`ret1w`..`ret1y`) | same public web key | One request, ~887 stocks, cached 15 minutes; values as MSN reports them. MSN's own preset lists are not used (stale or empty for IDX) |
  374. | Stockbit `exodus.stockbit.com` (`--provider stockbit`, opt-in) | realtime quote, history, live order book + foreign flow; corporate actions and calendar; insider and 5 % holder movements; the full broker summary (`broker`, by default once logged in) | **your own Stockbit session**, taken in by `idx stockbit login` (a browser or a local page; never the password) and stored locally | The one source that needs a credential and the one not in the `auto` provider chain; `broker --source auto` reads it only while a stored session works. Volume is realtime; the order book carries the full depth ladder. Foreign flow is left empty, with a warning, while Stockbit marks it as not current (seen during trading). Candles alone with `--history-provider stockbit`. The broker summary (`/marketdetectors/`, gross figures) lists every broker that bought and sold, exact; ordered by lots, its first ten were IPOT's top 10 on the day and the range recorded, and a second read of foreign investors gives the foreign net. Not read for domestic investors or the cash and negotiated boards yet. See [docs/stockbit.md](docs/stockbit.md) |
  375. Prices from the free sources are delayed as published; Stockbit is realtime for
  376. your own account. This tool is for research and tooling; it is not investment
  377. advice and not affiliated with IDX, KSEI, Yahoo, Microsoft or Stockbit.
  378. ## Web terminal
  379. **https://ihsg.midoriresearch.com** is the market page: IHSG and its session,
  380. breadth, the heavyweights and the most active stocks, refreshed every minute, with
  381. a stock search. It speaks Bahasa Indonesia at `/` and English at `/en/`, with the
  382. numbers in each language's style, and follows the device's light or dark setting.
  383. **https://ihsg.midoriresearch.com/terminal** (English: `/en/terminal`) runs the same commands in a
  384. browser, no install: `brief BBCA`, `quote BBCA,BBRI`, `intraday BBCA`, `returns BBCA BBRI`,
  385. `screen pe<10,div>5,mcap>5T --sort div`, `screen --preset top-performers`,
  386. `insights BBCA`, `news ASII`, `ownership ticker BBCA`,
  387. `ownership foreign`, `bandar BBCA --daily`, `bandar screen --preset
  388. big-accumulation`, `bandar broker YP`, `actions BBCA`, `foreign BBCA` (foreign
  389. flow from IPOT in rupiah, up to 20 sessions), `holidays --upcoming`, `astro`,
  390. `list --search bank`, `members`, `risk TLKM` (also `growth` and `valuation`), `brokers`
  391. (`market brokers` from IPOT's ranking of its latest session, with each member's class and
  392. net), `market foreign` (`market foreign --source ipot`: the session's 100 most traded
  393. stocks by their foreign net in rupiah, from the nightly bandar scan, with IPOT's market
  394. totals), and `tools` (every MCP tool as a button). The idx.co.id
  395. commands (market-wide foreign flow in shares, the calendar, indices, and `market brokers
  396. --source idx`) are CLI and MCP only, because idx.co.id refuses requests from Cloudflare Workers; so,
  397. for now, is `ownership institutions`, until MSN is checked from the Worker. Typed into the terminal,
  398. any of these, and the CLI-only commands (`watch`, `mcp`, `ownership import`, ...), answer
  399. with a notice instead of an error: where the command runs and why, its CLI line with your
  400. own arguments, and the nearest command the page has. A line pasted from the CLI, such as
  401. `idx stocks quote BBCA` or `idx -o json market overview`, runs as the page's own command.
  402. `quote` with one symbol also draws a price chart (1D, 5D,
  403. 1M, 6M, YTD, 1Y, 5Y) with volume, the previous close and a crosshair readout.
  404. The web `bandar screen` and `bandar broker` read a scan the Worker runs after
  405. each close, once IPOT publishes the session's broker lists, over the session's
  406. 100 most traded stocks; their warnings say when an older session is shown. The
  407. CLI scans live.
  408. A Cloudflare Worker refreshes a D1 snapshot of the whole
  409. IDX board every minute in trading hours and serves `/api/*` with the exact JSON
  410. envelopes the CLI prints; everything else is fetched on demand and cached. The
  411. Worker lives in [`web/`](web/) and answers on the custom domain only
  412. (`workers_dev = false`, Host check in the Worker).
  413. The same site serves this README and `docs/` as
  414. **https://ihsg.midoriresearch.com/docs/**, every page also as Markdown at its
  415. `.md` address (`/docs/mcp.md`), with
  416. [`/llms.txt`](https://ihsg.midoriresearch.com/llms.txt) and `/llms-full.txt`
  417. for language models. They are built from the repository at deploy time.
  418. ## Ownership data pipeline
  419. Nobody imports the KSEI register by hand, and nothing outside the repository
  420. can write it:
  421. 1. [`.github/workflows/ownership.yml`](.github/workflows/ownership.yml) runs at
  422. 08:17, 14:17 and 20:17 WIB. It fetches the IDX "Data Kepemilikan Saham" page
  423. through a browser-impersonating client, downloads any new or re-published
  424. "Pemegang Saham di Atas 1%" workbook, imports every month with `idx` to
  425. prove it parses, and publishes the files plus `index.json` and parsed JSON
  426. parts to the [`ownership-data`](https://github.com/fzn0x/idx/releases/tag/ownership-data)
  427. prerelease. idx.co.id blocks cloud networks, GitHub's own runners included,
  428. so the job runs on a self-hosted runner (an always-on machine with an
  429. ordinary connection; set the repository variable `OWNERSHIP_RUNNER` to
  430. `self-hosted`). On GitHub's runners it rebuilds the parts and the snapshot
  431. from the files already mirrored, and turns red once the newest register is
  432. 45 days old. From the same database it builds a prebuilt SQLite snapshot
  433. (`snapshot-v{V}.json` plus a gzip of the file) and publishes it whenever its
  434. content changes, the manifest last.
  435. 2. The web terminal's Worker reads that release on its minute cron: it checks
  436. `index.json` every 30 minutes, verifies each part's SHA-256 and loads one
  437. part per minute into D1. A month appears only once all its rows are in and
  438. the count matches. The newest six months are kept. The Worker has no write
  439. endpoint at all.
  440. 3. `idx ownership sync` on your machine installs that snapshot (a few MB,
  441. SHA-256 checked, swapped in as one SQLite transaction) and imports any
  442. newer month from the raw files; a database holding months the snapshot
  443. lacks is kept unless `--force`.
  444. 4. `idx ownership import --latest` tries idx.co.id and, when Cloudflare
  445. refuses it, downloads the same file from the mirror and checks its SHA-256.
  446. `IDX_OWNERSHIP_SOURCE=mirror` skips idx.co.id.
  447. <p align="center">
  448. <a href="https://ihsg.midoriresearch.com/terminal"><img src="docs/screenshots/terminal.png" alt="The idx web terminal showing technical BBRI" width="100%"></a>
  449. </p>
  450. ## Development
  451. ```sh
  452. cargo build
  453. cargo test # recorded fixtures, no network
  454. cargo clippy --all-targets -- -D warnings
  455. ./scripts/smoke.sh # live providers
  456. ```
  457. Architecture, conventions and "how to add a provider" live in
  458. [AGENTS.md](AGENTS.md). Contributions: [CONTRIBUTING.md](CONTRIBUTING.md).
  459. ## License
  460. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.