Orakel Docs
Data sources

SSB Klass

Reference data from Statistics Norway — NACE classifications, municipality codes, and aggregate context statistics.

Source attribution

Source: Statistisk sentralbyrå (SSB)
Data: Classifications (municipality codes, county codes) and aggregate statistics (population, industry wages, enterprise counts) that sit alongside company records
License: NLOD 2.0 for classifications; CC BY 4.0 for statistics (published via Statistikkloven)
Attribution required: Yes — "Statistisk sentralbyrå" or "SSB"
Link: https://www.ssb.no/klass
Update cadence: On-demand for the municipality classification (rarely changes); monthly (1st of month, 06:00) for aggregate statistics

What it is

SSB provides two kinds of data to Orakel.

First, classifications — the lookup tables that define what a municipality or county code means. Orakel pulls SSB Klass classification 131 (kommuner) and 104 (fylker) to populate the Municipality table. These sit behind the municipality codes stamped on every company address.

Second, aggregate statistics — industry-level and municipality-level context that Orakel surfaces alongside individual company records. A monthly job pulls three tables: population per municipality (07459), average monthly wages per NACE section (11419), and enterprise counts per NACE section (14000). A Brreg-derived live enterprise count runs as a fourth source so the current-year figure is always available. All of it lands in ssb_municipality_stats and ssb_industry_stats, keyed by year and metric.

Fields provided

Municipality (reference)

FieldTypeNotes
codestring (4 digits)SSB municipality code — e.g. 3905 (Tønsberg)
namestringMunicipality name
countyCodestring (2 digits)First two digits of code — e.g. 39
countyNamestringCounty name

Municipality statistics (ssb_municipality_stats)

FieldTypeNotes
municipalityNostringJoins to Company.businessAddressMuniNo
yearintReporting year
metricstringCurrently population
valuefloatMetric value
sourceTablestringSSB table ID (e.g. 07459)

Industry statistics (ssb_industry_stats)

FieldTypeNotes
naceSectionstringSingle-letter NACE section — e.g. J for ICT. Mapped from Company.naceCode1.
yearintReporting year
metricstringavgMonthlyWage | enterpriseCount
valuefloatMetric value
sourceTablestringSSB table ID (e.g. 11419, 14000, or brreg-derived for the live count)

Endpoints that surface this data

  • GET /api/municipalities — list all municipalities grouped by county; optional ?county=<2-digit code> filter.
  • SSB context is embedded in the company response when the client requests it — see the company endpoints. The context block includes the latest-year population for the company's municipality and the latest-year wage + enterprise count for its NACE section, resolved from these tables.

Limitations

  • Statistics lag the current year. Population typically trails by one year; wages and enterprise counts by one to two years. The monthly job walks a small year ladder backwards and uses the most recent year with data.
  • Classifications are versioned by SSB; Orakel pulls the snapshot as of 2025-01-01. Updating the snapshot date requires a code change.
  • Only three statistical metrics are live today (population, avgMonthlyWage, enterpriseCount). Additional metrics — household income, five-year survival, ICT usage — are planned but not yet synced.

Gotchas

  • Municipality numbering changed in the 2020 kommunesammenslåing. Historical company addresses may reference old municipality codes that no longer exist in the current classification. The active SSB snapshot wins; orphaned codes won't resolve.
  • ssbIndustryStat.sourceTable = "brreg-derived" is Orakel's own count computed from the live companies table, not an SSB figure. It covers all 21 NACE sections (SSB table 14000 excludes public sectors) and is always current-year. If you want the official SSB figure for apples-to-apples comparison, filter to sourceTable = "14000".
  • Industry stats key on the NACE section (single letter), not the full NACE code. The mapping lives in lib/ssb/nace-sections.ts.

On this page