Dette er ein testversjon av portalen. Innhald og API-ar er under utvikling og kan endre seg utan varsel.

Last ned datasett

Her kan du laste ned heile innhaldet frå API-ane som ferdige JSON-filer utan API-nøkkel. Filene blir oppdaterte automatisk kvar natt og serverte komprimert (gzip), så dei pakkar seg ut sjølve i nettlesaren og i vanlege HTTP-klientar. Tal og filstorleikar nedanfor er omtrentlege og veks litt over tid etter kvart som nytt innhald blir publisert.

Innhald frå regjeringa (content.json)

Metadata om alle publiserte dokument frå regjeringen.no – proposisjonar, meldingar, rapportar, pressemeldingar og nyheiter – med tittel, dato, dokumenttype, sidetype, eigar/tema og lenkje til kjelda. Henta frå /content/GetDocList med alle detaljflagg på.

Format: JSON · Tal: ca. 63 000 dokument · Storleik: ~44 MB

Last ned JSON: Innhald frå regjeringa (content.json) (opnast i ny fane)

curl

curl --compressed -o content.json \
  https://api.test.data.regjeringen.no/exports/content.json
# Array av dokument (med eigar/tema/hierarki): { documentId, title, date, documentUrl, pageType, documentType, ... }

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/content.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("content.json"));
// Array av dokument (med eigar/tema/hierarki): { documentId, title, date, documentUrl, pageType, documentType, ... }

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/content.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("content.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array av dokument (med eigar/tema/hierarki): { documentId, title, date, documentUrl, pageType, documentType, ... }

Departementsinformasjon (organisations.json)

Inneheld gjeldande departementsstruktur: departementa og SMK med namn og underliggjande einingar/avdelingar. Henta frå /organisations/all.

Format: JSON · Storleik: ~0,4 MB

Last ned JSON: Departementsinformasjon (organisations.json) (opnast i ny fane)

curl

curl --compressed -o organisations.json \
  https://api.test.data.regjeringen.no/exports/organisations.json
# Array av departement: { id, name: [{ id, text }], departments: [ ... ] }

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/organisations.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("organisations.json"));
// Array av departement: { id, name: [{ id, text }], departments: [ ... ] }

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/organisations.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("organisations.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array av departement: { id, name: [{ id, text }], departments: [ ... ] }

Offisielt frå statsrådet (councilofstate.json)

Alle «Offisielt frå statsrådet»-kunngjeringar (proposisjonar, meldingar til Stortinget, sanksjonar og ikrafttredingar, forskrifter, utnemningar m.m.), kvar utvida med fullt detaljinnhald. Henta frå /councilofstate/getlist + /councilofstate/get.

Format: JSON · Tal: ca. 1 400 kunngjeringar · Storleik: ~15 MB

Last ned JSON: Offisielt frå statsrådet (councilofstate.json) (opnast i ny fane)

curl

curl --compressed -o councilofstate.json \
  https://api.test.data.regjeringen.no/exports/councilofstate.json
# Array (heile historikken): { id, tittel, ingress, datoPublisert, utgiver, detalj }

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/councilofstate.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("councilofstate.json"));
// Array (heile historikken): { id, tittel, ingress, datoPublisert, utgiver, detalj }

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/councilofstate.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("councilofstate.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array (heile historikken): { id, tittel, ingress, datoPublisert, utgiver, detalj }

Høyringar – oversikt (consultationresponse-consultations.json)

Oversikt over alle publiserte høyringar – tittel, ansvarleg departement, dato, status og lenkje. Éi rad per høyring. Henta frå /consultationresponse/GetPublished?type=H.

Format: JSON · Tal: ca. 7 300 høyringar · Storleik: ~2,6 MB

Last ned JSON: Høyringar – oversikt (consultationresponse-consultations.json) (opnast i ny fane)

curl

curl --compressed -o consultationresponse-consultations.json \
  https://api.test.data.regjeringen.no/exports/consultationresponse-consultations.json
# Array av høyringar: { documentId, title, date, depName, type, status, documentUrl }

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/consultationresponse-consultations.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("consultationresponse-consultations.json"));
// Array av høyringar: { documentId, title, date, depName, type, status, documentUrl }

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/consultationresponse-consultations.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("consultationresponse-consultations.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array av høyringar: { documentId, title, date, depName, type, status, documentUrl }

Innspel – oversikt (consultationresponse-input.json)

Same oppsett som høyringar, men listar opp saker der innbyggjarar, organisasjonar og næringsliv har sendt inn innspel. Henta frå /consultationresponse/GetPublished?type=I.

Format: JSON · Tal: ca. 50 innspel · Storleik: under 1 MB

Last ned JSON: Innspel – oversikt (consultationresponse-input.json) (opnast i ny fane)

curl

curl --compressed -o consultationresponse-input.json \
  https://api.test.data.regjeringen.no/exports/consultationresponse-input.json
# Array av innspel: { documentId, title, date, depName, type, status, documentUrl }

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/consultationresponse-input.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("consultationresponse-input.json"));
// Array av innspel: { documentId, title, date, depName, type, status, documentUrl }

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/consultationresponse-input.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("consultationresponse-input.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array av innspel: { documentId, title, date, depName, type, status, documentUrl }

Høyringsdokument (consultationresponse-documents.json)

Det fullstendige innhaldet for kvar høyring/innspel – for høyringar inkl. høyringsbrev, høyringsnotat og høyringsinstansar; for innspel inkl. invitasjon, vedlegg og mottakarar. Henta frå /consultationresponse/GetDocument?consultationId= per sak.

Format: JSON · Tal: ca. 7 300 dokument · Storleik: ~41 MB

Last ned JSON: Høyringsdokument (consultationresponse-documents.json) (opnast i ny fane)

curl

curl --compressed -o consultationresponse-documents.json \
  https://api.test.data.regjeringen.no/exports/consultationresponse-documents.json
# Array: { horingId, dokument } – eitt dokument per høyring/innspel (GetDocument)

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/consultationresponse-documents.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("consultationresponse-documents.json"));
// Array: { horingId, dokument } – eitt dokument per høyring/innspel (GetDocument)

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/consultationresponse-documents.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("consultationresponse-documents.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array: { horingId, dokument } – eitt dokument per høyring/innspel (GetDocument)

Høyringssvar (consultationresponse-responses.json)

Alle publiserte høyringssvar grupperte per høyring – til saman rundt 170 000 svar-oppføringar på tvers av ca. 7 300 høyringar (utan per-svar detalj/vedlegg). Henta frå /consultationresponse/GetPublishedAnswerItems?id= per høyring.

Format: JSON · Tal: ca. 7 300 høyringar · ca. 170 000 svar · Storleik: ~72 MB

Last ned JSON: Høyringssvar (consultationresponse-responses.json) (opnast i ny fane)

curl

curl --compressed -o consultationresponse-responses.json \
  https://api.test.data.regjeringen.no/exports/consultationresponse-responses.json
# Array: { horingId, svar: [ ... ] } – publiserte svar-oppføringar per høyring (utan per-svar detalj)

JavaScript

// Node.js 18+: fetch pakkar ut gzip, og innhaldet blir strøyma rett til disk.
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.test.data.regjeringen.no/exports/consultationresponse-responses.json");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await pipeline(Readable.fromWeb(res.body), createWriteStream("consultationresponse-responses.json"));
// Array: { horingId, svar: [ ... ] } – publiserte svar-oppføringar per høyring (utan per-svar detalj)

Python

import requests

# iter_content pakkar ut gzip; fila blir skriven i bitar.
with requests.get("https://api.test.data.regjeringen.no/exports/consultationresponse-responses.json", stream=True, timeout=300) as res:
    res.raise_for_status()
    with open("consultationresponse-responses.json", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 20):
            f.write(chunk)
# Array: { horingId, svar: [ ... ] } – publiserte svar-oppføringar per høyring (utan per-svar detalj)

DCAT-AP-NO-katalog

DCAT-AP-NO-kompatibel katalog over alle datasetta, for automatisk hausting til data.norge.no. Henta frå /dcat.

Format: JSON-LD (DCAT-AP-NO 2.0) · Tilgang: open (ingen nøkkel) · Cache: 1 time

Opne katalog: DCAT-AP-NO-katalog (opnast i ny fane)

curl

# DCAT-katalog (JSON-LD)
curl -H "Accept: application/ld+json" \
  https://api.test.data.regjeringen.no/dcat

JavaScript

const res = await fetch("https://api.test.data.regjeringen.no/dcat", {
  headers: { Accept: "application/ld+json" },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const catalog = await res.json();
console.log(catalog);

Python

import requests

res = requests.get(
    "https://api.test.data.regjeringen.no/dcat",
    headers={"Accept": "application/ld+json"},
    timeout=30,
)
res.raise_for_status()
catalog = res.json()
print(catalog)

URL-ane peikar på test-gatewayen. På produksjonsportalen blir api.test.data.regjeringen.no erstatta med api.data.regjeringen.no.