Skip to contents

This is a simple guide to access data via API. Regional granularity levels includes:

  • Enumeration areas (grunnkretser)
  • Cities (bydeler)
  • Municipalities (kommuner)
  • Counties (fylker)

Download geo codes

All functions that have get_ prefix access data directly via SSB API. This is the simple guide to use norgeo API functions to get codes for municipalities with selected time period:

library(norgeo)
dt <- get_code("kommune", from = 2015, to = 2021)
# only current geo code
dt <- get_code("kommune", from = 2021)

Get geo changes

You could download geo code changes via get_change() function. The example below will download municipalities codes that have changed from 2015 to 2021.

dtc <- get_change("kommune", from = 2015, to = 2021)

Track geo changes

To track all municipalities codes that have changed since 2015 to their current codes as in 2021 can be done as follows:

dtt <- track_change("kommune", from = 2015, to = 2021)

The difference between get_change() and track_change() is that, the former will only download codes that have changed while the later will, in addition, track these changes to the current codes.

You can also track geo codes that are split or merged to a new geo codes with function track_split() or track_merge().