edsn-eancodeboek-api-wrapper

async/await Node.js Wrapper for EANCodeBoek API from Energie Data Services Nederland (EDSN)


Keywords
node, EANCodeBoek, edsn, async, Energie Data Services Nederland, EDSN.NL
License
MIT
Install
npm install edsn-eancodeboek-api-wrapper@0.0.1

Documentation

edsn-eancodeboek-api-wrapper

async/await Node.js Wrapper for EANCodeBoek API from Energie Data Services Nederland (EDSN)

codecovCodeQLMIT

Search MeteringPoints and GridOperator with the given search parameters and api-token.

To use this api you need to retrieve an api-token which is send by email after enrollment. You can Enroll here

Search MeteringPoints

Allowed parameter combinations:

  • product + streetNumber + postalCode
  • product + streetNumber + postalCode + streetNumberAddition
  • product + city + specialMeteringPoint
  • product + streetNumber + city + street
  • product + streetNumber + city + street + streetNumberAddition

Definition specialMeteringPoint:

The business logic rules described below are used to determine whether a MeteringPoint can be considered ‘special’.

Based on the BAG-ID and whether a MeteringPoint is a primary or secondary allocationpoint, the specialMeteringPoint property will return either true or false when:

  • BAG-ID = Not Empty -> specialMeteringPoint = False
  • BAG-ID = Empty & MeteringPoint is a secondary allocationpoint -> specialMeteringPoint = False
  • BAG-ID = Empty & MeteringPoint is not a secondary allocationpoint -> specialMeteringPoint = True

Paging:

  • limit: the size of the page. Default is 100, max is 1000.
  • offset: the record offset to use. Default is 0.

Grid Operator by Postal Code

This service retrieves given a postalCode a complete list of the grid operator that operate on the postalcode. For every grid operator the eancode, name and a set of product (ELK and/or GAS) is returned.

How to use this module

npm install edsn-eancodeboek-api-wrapper


const eanCodeBoekApi = require('edsn-eancodeboek-api-wrapper');

const apiKey = process.env.apiKey

async function main() {
  const eanCodeBoekWrapper = new eanCodeBoekApi.Wrapper(apiKey);
  const data = {product: 'ELK', city: 'Rotterdam', specialMeteringPoint: 'true'};
  console.log(await eanCodeBoekWrapper.searchMeteringPoints(data));
  console.log(await eanCodeBoekWrapper.getGridOperatorByPostalCode('3010CK'));
}

main().catch(
console.log
);