state accounts

SkillDev tools

Icelandic state accounts actuals (Fjársýsla) — yearly revenue/expense 2015+; pre-2015 balance via Hagstofan THJ05211; 36 policy areas (málefnasvið).

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the state accounts skill

What this skill tells your AI

The instructions your AI receives, as published by jokull/icelandic-data in .agents/skills/rikisreikningur/SKILL.md and read by ahel’s review.

Government-wide revenue, expenditure, and surplus/deficit from the state treasury. rikisreikningur.is is the public disclosure portal operated by Fjársýsla ríkisins (State Treasury / Financial Management Authority).

Published data:

  • Annual state accounts (ríkisreikningur) back to 2004
  • In-year monthly summaries (mánaðaryfirlit) for the current fiscal year
  • "Heimamundur" — a detailed per-institution ledger published as XLSX
  • A front-page dashboard of revenue/expense category and málefnasvið (policy-area) breakdown

Architecture

React SPA at rikisreikningur.is. Data comes from a small Azure Functions backend at rikisreikningurapi.azurewebsites.net with four JSON endpoints plus a file-download endpoint. An X-Api-Key header is required — the key is hard-coded in the public JS bundle and is effectively an anonymous throttling key, not a secret.

API

EndpointReturns
GET /api/FJS/NuverandiTimabil{"ar": "2025", "timabil": "06"} — latest closed period. timabil 01–12 = monthly, 13 = full-year accounts
GET /api/FJS/TekjurOgGjold{"afkoma":[…], "tekjur_gjold":[…]} — yearly surplus/deficit + revenue/expense split into 7 categories (see below)
GET /api/FJS/Data/malefni_tgRevenue & expense by málefnasvið (policy area 01–36) × year × type — ~620 rows
GET /api/FJS/Data/skrarManifest of downloadable Excel/CSV files (ríkisreikningur, heimamundur, forsidugogn)
GET /api/Files/Rikisreikningur/{name}Raw file download (XLSX/CSV/PDF)

Auth header: X-Api-Key: 6d4d7394-2992-473d-9ea7-45946b39ad9d

This is not a secret — do not move it to an env var or a repo secret. It is a static public key shipped in the SPA's own JS bundle (verified: it appears in https://www.rikisreikningur.is/static/js/main.*.chunk.js), so every visitor to the site already has it. Hardcoding it is correct; hiding it would only break scripts/rikisreikningur.py for anyone cloning the repo.

If the API starts returning 401 the key was rotated: re-read it from the bundle above. tests/health/test_rikisreikningur.py asserts status != 401 precisely so that rotation surfaces as its own finding rather than as a confusing failure inside a fetch run.

Double-encoded payloads

The /api/FJS/Data/* endpoints return a single-element list containing a JSON-encoded string that must be re-parsed:

r = client.get("…/api/FJS/Data/malefni_tg")
outer = r.json()         # ["{\"malefni_tg\":[…]}"]
inner = json.loads(outer[0])  # {"malefni_tg": [{…}, {…}]}
rows  = inner["malefni_tg"]

NuverandiTimabil and TekjurOgGjold use normal single-layer JSON.

Revenue/expense category schema

tekjur_gjold rows use two discriminators:

tegundtextiMeaning
TekjurSkattarTax revenue
TekjurSalaSales of goods/services
TekjurAnnaðOther revenue (grants, interest, etc.)
GjöldLaunWage expenditure
GjöldTilfærslurTransfer payments (welfare, grants)
GjöldVörukaupPurchases of goods/services
GjöldAnnaðOther expenditure

Each row carries timabil_ar (year), timabil (13 = annual, 06 / 12 = mid/full-year in-flight period), and samtals in ISK.

Málefnasvið coverage

36 policy-area codes (01–37 with gaps), e.g.:

CodeMálefnasvið (policy area)
01Alþingi og eftirlitsstofnanir þess
05Skatta-, eigna- og fjármálaumsýsla
08Framhaldsskólastig
18Menning, listir, íþrótta- og æskulýðsmál
25Hjúkrunar- og endurhæfingarþjónusta
34Almennur varasjóður og sértækar fjárráðstafanir

Joined to revenue/expense sub-totals, this gives the "where does the money go" breakdown at the level the parliament allocates appropriations.

Usage

# Current fiscal period (quick health check)
uv run python scripts/rikisreikningur.py timabil

# Yearly afkoma + revenue/expense category CSVs
uv run python scripts/rikisreikningur.py summary

# Málefnasvið breakdown (620+ rows → CSV)
uv run python scripts/rikisreikningur.py malefni

# List the 35 published XLSX/CSV/PDF files
uv run python scripts/rikisreikningur.py files

# Download one (URL-encoding handled)
uv run python scripts/rikisreikningur.py download --name "Rikisreikningur_gogn_2024.csv"

# Pre-2015 balance (1980-2025, Hagstofan THJ05211) — the API only goes back to 2015
uv run python scripts/hagstofan_rikissjod.py fetch

Processed outputs

PathContents
data/processed/rikisreikningur_summary.csvar, tekjur, gjold, afkoma (one row per year, values in ISK)
data/processed/rikisreikningur_tekjur_gjold.csvrevenue/expense sub-totals (category × year × period)
data/processed/rikisreikningur_malefni.csvper-málefnasvið sub-totals
data/processed/rikisreikningur_files.csvfile manifest
data/processed/rikissjod_balance.csv1980–2025 balance, Hagstofan THJ05211 (tekjur/gjöld/afkoma, % af VLF, real 2025 prices — m.kr)
data/raw/rikisreikningur/{name}downloaded raw XLSX/CSV/PDF

Snapshot (2026-04 pull)

2015   rev=  732.9   exp=  693.8   net=  +39.2
2016   rev= 1215.2   exp=  759.8   net= +455.4   ← sale of stabilitetsframlag
2017   rev=  869.6   exp=  830.1   net=  +39.5
2018   rev=  972.0   exp=  887.6   net=  +84.4
2019   rev=  976.2   exp=  924.4   net=  +51.8
2020   rev=  906.5   exp= 1026.7   net= -120.2   ← COVID
2021   rev= 1014.3   exp= 1144.1   net= -129.8
2022   rev= 1095.6   exp= 1255.7   net= -160.1
2023   rev= 1080.8   exp= 1216.8   net= -136.0
2024   rev= 1125.9   exp= 1244.8   net= -118.9
2025   rev=  681.5   exp=  830.1   net= -148.7   ← YTD through timabil 06

All figures in ISK billions.

Pre-2015 data — the 2008–2011 crisis years

The API starts at 2015 (Caveat 2). The machine-readable way back is Hagstofan's state-treasury tables (Efnahagur/fjaropinber/fjarmal_rikissjods/), fetched by scripts/hagstofan_rikissjod.py:

TableCoverageContent
THJ052111980–2025one-stop balance: tekjur, gjöld, tekjuafgangur/-halli + % af VLF + real-2025 prices (m.kr)
THJ052211998–2025full ESA accounts: rekstrartekjur, rekstrarútgjöld, tekjuafgangur, capital rows
THJ952002004–2014cash-basis (greiðslugrunnur) monthly; month code 0 = annual total

Worked example — state budget balance during the financial crisis (THJ05211, m.kr):

YearTekjurGjöldAfkoma% af VLF
2008637,571822,128−184,556−11.5
2009564,394678,626−114,232−7.0
2010541,554642,474−100,920−5.9
2011591,297708,189−116,892−6.5

Context: +58.3 bn surplus in 2007 → −40.0 (2012) → −21.9 (2013). The 2008 expenditure jump (471 → 822 bn) is ~212 bn of one-off bank-rescue capital transfers — the deficit peaked at 11.5 % of GDP that year.

Basis caveat: THJ05211/05221 (ESA accounts basis) and the Fjársýsla API (2015+) are close but not identical — 2016 afkoma is +455.4 bn in the API vs +310.0 bn in THJ05211 (stöðugleikaframlög outlier, both), and THJ05211's gjöld include capital transfers that THJ05221's rekstrarútgjöld exclude. Quote either series consistently; pre-2015, Hagstofan is the only option. The cash-basis monthly series (THJ95200) is a third basis: 2008–2011 afkoma −199.2 / −136.9 / −69.1 / −57.4 bn. The raw 70 MB `Heimamundur gögn fyrir 2004

  • 2016.xlsxfromfiles` is the underlying per-institution ledger.

Caveats

  1. API key rotates rarely but can rotate. If the API starts returning 401, re-extract from the SPA bundle — grep the current main.*.chunk.js for a UUID assigned to a short variable name, currently Ee = "6d4d…".
  2. Year 2015 starts the series — pre-2015 balance (e.g. the 2008–2011 crisis deficits) comes from Hagstofan THJ05211 via scripts/hagstofan_rikissjod.py (see "Pre-2015 data" above). The XLSX bundles in files (Heimamundur gögn fyrir 2004–2016.xlsx, 70 MB) are the raw per-institution ledger if you need line-item detail.
  3. Mid-year totals are partial. timabil_ar=2025, timabil=06 is the first half of 2025 closed; do not compare it to full-year rows (13). The summary command preserves both; you need to filter by timabil.
  4. The 2016 surplus is an outlier. The +ISK 455 B number comes from the one-off realisation of stability-contribution revenue from failed-bank estates (stöðugleikaframlög). Don't treat the surplus as run-rate.
  5. Double-encoded JSON on /api/FJS/Data/*. Script handles it via _decode_data; if you call the API directly remember to json.loads the inner string.
  6. Files are served at /api/Files/Rikisreikningur/{name}HEAD returns 405 (method not allowed), use GET only. Content-type is generic application/octet-stream; trust the file-extension.
  7. Annual reports of state institutions and SOEs live on sibling subdomains linked from the SPA: arsreikningar.rikisreikningur.is/stofnun (state institutions), .../fyrirtaeki (state-owned enterprises), .../sveitarfelag (municipalities). These are separate skills — currently covered opportunistically by skatturinn for SOEs and reykjavik for the Reykjavík municipality.
  8. Encoding. Azure Functions returns UTF-8 JSON throughout. The 36 málefnasvið names and account-line descriptions all contain Icelandic chars; write JSON with ensure_ascii=False and read CSV exports with encoding="utf-8".

Attribution

"Byggir á upplýsingum frá Fjársýslu ríkisins."

Related

  • opnirreikningar — invoice-level government-spending data
  • tenders — public-procurement awards
  • hagstofan — GFS-standard fiscal aggregates (THJ tables)
  • Published PDF archive on island.is: https://island.is/s/fjarsyslan/utgefid-efni?filters=…manadaryfirlit-rikissjods…

Signals

GitHub stars
53
Forks
4
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
rikisreikningur
Source
github.com/jokull/icelandic-data