Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

difi

zrrrzzt165MIT6.0.3

Query the hotell.difi.no API

readme

js-standard-style

difi

Node.js module for querying the hotell.difi.no API.

Requires Node >= 14

Installation

$ npm install difi --save

Usage

Pass an object with the required properties and receive the result.

dataset The dataset you want to query.

format Format for the result. Can be csv, json, jsonp, xml or yaml

query Object with properties for querystring. Find all options in the API description

const difi = require('difi')
const options = {
      dataset: 'brreg/enhetsregisteret',
      format: 'json',
      query: {
        query: 'Registerenheten i Brønnøysund'
      }
}

difi(options)
  .then(console.log)
  .catch(console.error)

Returns

{ entries: 
   [ { tvangsavvikling: 'N',
       regnskap: '',
       forradrpostnr: '8900',
       ansatte_antall: '566',
       postadresse: 'Postboks 900',
       nkode3: '',
       ppoststed: 'BRØNNØYSUND',
       konkurs: 'N',
       stiftelsesdato: '',
       sektorkode: '6100',
       ansatte_dato: '12.10.2017',
       organisasjonsform: 'ORGL',
       navn: 'REGISTERENHETEN I BRØNNØYSUND',
       regifriv: 'N',
       forradrkommnr: '1813',
       regimva: 'N',
       tlf_mobil: '',
       forradrland: 'Norge',
       ppostland: 'Norge',
       avvikling: 'N',
       regifr: 'N',
       hovedenhet: '912660680',
       forretningsadr: 'Havnegata 48',
       url: 'www.brreg.no',
       forradrpoststed: 'BRØNNØYSUND',
       tlf: '75 00 75 09',
       nkode1: '84.110',
       nkode2: '',
       forradrkommnavn: 'BRØNNØY',
       regdato: '09.08.1995',
       orgnr: '974760673',
       regiaa: 'J',
       ppostnr: '8910' } ],
  page: 1,
  pages: 1,
  posts: 1 }

License

MIT