Finding the organization domain name of a school#

Feide uses the domain name (realm) of an organization to identify it. The domain name is chosen by the organization and can be something like eksempel.kommune.no, feide.eksempel.kommune.no, eksempelskolen.no, etc.

Sometimes, you need to determine the domain name of a school’s organization. This page describes how to do this using data from the Nasjonalt Skoleregister (NSR) and Feide.

Step 1: Find the organization number of the school owner#

  • To find it interactively, visit Nasjonalt Skoleregister (https://nsr.udir.no/) and search for the school. At the page for the school, you can follow a link to the owner of the school and find its organization number.

  • To find it programmatically, use the NSR API (https://data-nsr.udir.no/). It is documented at https://data-nsr.udir.no/swagger/. If you know the organization number of a school, its data can be found at https://data-nsr.udir.no/v4/enhet/{organization_number}. The format is JSON.

    The field ForeldreRelasjoner is a list of objects having the fields Enhet and Relasjonstype. You are looking for one where the Id is 1. The organization number of the owner is the Organisasjonsnummer in the Enhet field.

    Example for the school “Skjåk barne- og ungdomsskule”, retrieved from https://data-nsr.udir.no/v4/enhet/975274624:

    {
      ...,
      "ForeldreRelasjoner": [
          {
              "Enhet": {
                  "Organisasjonsnummer": "961381096",
                  "Navn": "Skjåk kommune"
              },
              "Relasjonstype": {
                  "Id": "1",
                  "Navn": "Eierstruktur"
              }
          },
          ...
      ],
      ...
    }
    

Step 2: Find the Host Organization#

Retrieve the list of organizations in Feide using the organization list of the Feide API. The URL is https://api.feide.no/2/org/all?fields=name,realm,organization_number.

You can then search the returned data for an organization that matches the organization number you got from Nasjonalt Skoleregister. The domain name of the organization is the value of the realm field in the organization object.

Example:

{
  "name": {
    "en": "Skjåk municipality",
    "nb": "Skjåk kommune",
    "nn": "Skjåk kommune"
  },
  "realm": "skjaakskulane.no",
  "organization_number": "961381096"
}