state accounts
SkillDev toolsIcelandic 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.
No other account needed.
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
| Endpoint | Returns |
|---|---|
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_tg | Revenue & expense by málefnasvið (policy area 01–36) × year × type — ~620 rows |
GET /api/FJS/Data/skrar | Manifest 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:
tegund | texti | Meaning |
|---|---|---|
| Tekjur | Skattar | Tax revenue |
| Tekjur | Sala | Sales of goods/services |
| Tekjur | Annað | Other revenue (grants, interest, etc.) |
| Gjöld | Laun | Wage expenditure |
| Gjöld | Tilfærslur | Transfer payments (welfare, grants) |
| Gjöld | Vörukaup | Purchases of goods/services |
| Gjöld | Annað | 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.:
| Code | Málefnasvið (policy area) |
|---|---|
| 01 | Alþingi og eftirlitsstofnanir þess |
| 05 | Skatta-, eigna- og fjármálaumsýsla |
| 08 | Framhaldsskólastig |
| 18 | Menning, listir, íþrótta- og æskulýðsmál |
| 25 | Hjúkrunar- og endurhæfingarþjónusta |
| 34 | Almennur 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
| Path | Contents |
|---|---|
data/processed/rikisreikningur_summary.csv | ar, tekjur, gjold, afkoma (one row per year, values in ISK) |
data/processed/rikisreikningur_tekjur_gjold.csv | revenue/expense sub-totals (category × year × period) |
data/processed/rikisreikningur_malefni.csv | per-málefnasvið sub-totals |
data/processed/rikisreikningur_files.csv | file manifest |
data/processed/rikissjod_balance.csv | 1980–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:
| Table | Coverage | Content |
|---|---|---|
THJ05211 | 1980–2025 | one-stop balance: tekjur, gjöld, tekjuafgangur/-halli + % af VLF + real-2025 prices (m.kr) |
THJ05221 | 1998–2025 | full ESA accounts: rekstrartekjur, rekstrarútgjöld, tekjuafgangur, capital rows |
THJ95200 | 2004–2014 | cash-basis (greiðslugrunnur) monthly; month code 0 = annual total |
Worked example — state budget balance during the financial crisis (THJ05211, m.kr):
| Year | Tekjur | Gjöld | Afkoma | % af VLF |
|---|---|---|---|---|
| 2008 | 637,571 | 822,128 | −184,556 | −11.5 |
| 2009 | 564,394 | 678,626 | −114,232 | −7.0 |
| 2010 | 541,554 | 642,474 | −100,920 | −5.9 |
| 2011 | 591,297 | 708,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.xlsx
fromfiles` is the underlying per-institution ledger.
Caveats
- API key rotates rarely but can rotate. If the API starts returning 401,
re-extract from the SPA bundle — grep the current
main.*.chunk.jsfor a UUID assigned to a short variable name, currentlyEe = "6d4d…". - 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 infiles(Heimamundur gögn fyrir 2004–2016.xlsx, 70 MB) are the raw per-institution ledger if you need line-item detail. - Mid-year totals are partial.
timabil_ar=2025, timabil=06is the first half of 2025 closed; do not compare it to full-year rows (13). Thesummarycommand preserves both; you need to filter bytimabil. - 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. - Double-encoded JSON on
/api/FJS/Data/*. Script handles it via_decode_data; if you call the API directly remember tojson.loadsthe inner string. - Files are served at
/api/Files/Rikisreikningur/{name}—HEADreturns 405 (method not allowed), useGETonly. Content-type is genericapplication/octet-stream; trust the file-extension. - 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. - 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=Falseand read CSV exports withencoding="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