npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lekkimworld-nordpool

v2.0.0

Published

Nord Pool ELSPOT API client

Downloads

2

Readme

Nordpool Elspot API npm client

Build Status

Unofficial Nordpool Elspot API npm client

Features

Usage


const nordpool = require('nordpool')
const prices = new nordpool.Prices()
let opts = {}
prices.hourly(opts, function (error, results) {
  console.log(results)
})

Methods

  • at: get price at an exact time
  • hourly: get hourly prices
  • daily: get daily prices
  • weekly: get weekly prices
  • monthly: get monthly prices
  • yearly: get yearly prices

Options

  • area: the energy market area. See http://www.nordpoolspot.com/maps/ Currently active areas are BERGEN, DK1, DK2, EE, ELE, FRE, KR.SAND, KT, LT, LV, MOLDE, OSLO, SE, SE1, SE2, SE3, SE4, SYS, TR.HEIM, TROMSØ, EE, LV, LT, AT, BE, DE-LU, FR and NL.
  • currency: choose either DKK, EUR, NOK or SEK. Note that not all areas will return all currencies.
  • date: can be a Date or moment.js object or a string in ISO 8601 format or W/YYYY (week number and year) or YYYY-MM (year and month). If no timezone is set, CET is assumed.
  • from: Don't return values before this time. Accepts same formats as date.
  • to: Don't return values after this time. Accepts same formats as date.

Install

npm install nordpool

Examples

Example 1: Latest hourly prices from all areas


var nordpool = require('nordpool')
var prices = new nordpool.Prices()

prices.hourly({}, function (error, results) {
  if (error) console.error(error)
  for (var i=0; i<results.length; i++) {
    var date = results[i].date // moment object (see http://momentjs.com/)
    var price = results[i].value // float, EUR/MWh
    var hourlyPriceMessage = results[i].area +
      " at " + date.format("DD.MM. H:mm") + ": " + price/10 + " eurocent/kWh"
    console.log(hourlyPriceMessage)
  }
})

Example 2: Latest hourly prices in Finland


var nordpool = require('nordpool')
var prices = new nordpool.Prices()

var opts = {
  area: 'FI', // See http://www.nordpoolspot.com/maps/
  currency: 'EUR', // can also be 'DKK', 'NOK', 'SEK'
}

prices.hourly(opts, function (error, results) {
  if (error) console.error(error)
  for (var i=0; i<results.length; i++) {
    var date = results[i].date
    var price = results[i].value
    var time = date.tz('Europe/Helsinki').format("D.M. H:mm")
    console.log(price + ' ' + opts.currency + '/MWh at ' + time)
  }
})

Example 3: Weekly prices in Bergen in 2015


var nordpool = require('nordpool')
var prices = new nordpool.Prices()

var opts = {
  currency: 'NOK',
  area: 'Bergen',
  from: '2016-01-01'
}

prices.weekly(opts, function (error, results) {
  if (error) console.error(error)
  for (var i=0; i<results.length; i++) {
    var date = results[i].date
    var price = results[i].value
    var weeklyPriceMessage = "The price on week " + date.format("W/GGGG") +
      " was " + price + " NOK/MWh"
    console.log(weeklyPriceMessage)
  }
})

See examples folder for more examples.

Check possible values for area (regions) from nordpoolspot.com

Data availability

Historical data seems to be available for two previous years.

Known issues

  • Versions prior to 2.0 were full of flaws. Don't use them.
  • The Nordpool API returns data in Norwegian time zones. The hourly API returns data from midnight to midnight in the Europe/Oslo timezone.
  • The API limits are a bit strange. The maximum number of weeks is 24 and the maximum number of months is 53.

TODO

Add support for other API functions (volume, capacity, flow).