--- name: state-ownership-data description: Extract current state-owned companies, ownership shares, purposes, sectors, and state-founded foundations from the Ministry of Finance tables. module: riigiosalus.mjs execution: get --- # State Ownership Data Rahandusministeerium publishes what the state owns as three server-rendered tables: companies it holds shares in, foundations it founded, and non-profits it is a member of. Public HTML, no login, no browser JavaScript needed. ## Retrieve ```js const r = await stateHoldings({ kind: "ariuhingud" }); show(r.asOf, r.updated); // "31.12.2025", "02.07.2026" show(r.totals); // { entities, stated, ministries, byMinistry, fullyOwned } show(r.rows.slice(0, 5)); // nr, name, ministry, share, purpose, activity show(await stateHolding("Elering")); // one body: who administers it, what share ``` `kind` is `ariuhingud` (default), `sihtasutused` or `mittetulundusuhingud`. ## Counting `totals.entities` is counted here over every row; `totals.stated` is the "Kokku, arv" the page prints about itself. **When they differ, report both** — a gap means the page is mid-edit, and silently preferring one is how a wrong number gets an official-looking citation. The tables are sectioned by ministry, and the sections are ordinary rows. An entity row starts with its ordinal; a ministry heading does not. Reading them the same way turns 17 ministry headings into 17 phantom companies. ## Estonian and English are different snapshots `/riigihanked-riigiabi-osalused/riigi-osalused/ariuhingud` (Estonian) said **24 companies as of 31.12.2025**, updated 02.07.2026. `/en/public-procurement-state-aid-and-assets/state-assets/state-stakeholdings` (English, all three tables on one page) said **25 as of 30.09.2025**, updated 02.10.2025. Same ministry, same table, ten months apart. The module reads the **Estonian** pages only. Cite one language or the other and say which — a merged count is a number that appears on neither page. ## Return One row per body with the ministry that administers it, the state's share as published (decimal commas kept), the stated purpose and field of activity. For foundations: founders, founding date, articles-of-association goal. For non-profits: registry code, members, the government decision behind the membership, and the annual fee. Always carry `asOf` (the date the shares are measured on) and `updated` (when the page last changed). Neither is today. ## Limits - A current snapshot, not a historical API. - No company financials here. Use the business register for accounts, board and baseline entity data. - `stateHolding(name)` returning `matched: false` means the body is not on any of the three lists — a complete answer, not a lookup failure. ## Verify Require the table's own header (`Äriühing` / `Sihtasutus` / `Mittetulundusühing` with `Riigi osalus`, `Asutajate arv` or `Registrikood`) and multiple numbered entity rows. The module throws when no numbered row parses, because a count off a changed layout would be wrong rather than merely empty. Reject a navigation shell or a policy-only page. ## Module API stateHoldings({kind}) -> {source, page, kind, title, asOf, updated, totals, rows, note} stateHolding(name) -> {source, page, kind, asOf, name, ministry, share, purpose, activity, matched, alsoMatched, note}