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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tvanlaerhoven/epex-client

v1.0.5

Published

Collect European Power Exchange (EPEX) market data

Downloads

448

Readme

Epex Client

The Epex Client package provides access to the latest European Power Exchange (EPEX) market data across all areas. It is intended primarily for hobbyist solutions.

License: GPL v3 npm version CI

Overview

The European Power Exchange (EPEX SPOT) is a market platform for the trading of electricity in Europe. It provides a marketplace for electricity producers, consumers, and traders to buy and sell electricity, aiming to create a transparent and efficient market for power trading.

The Epex Client package gives you access to the EPEX Spot Day-Ahead Market, where the electricity price and volume for each hour of the next day is established. You can work with these Day-Ahead prices by adjusting your electricity consumption patterns based on the price fluctuations. Here's how:

  • Shift High Consumption Activities: reduce energy costs by scheduling energy-intensive activities (like running washing machines, dishwashers, or electric heating) during hours when electricity prices are lower.
  • Use Home Automation: home automation systems or smart appliances can automatically adjust the timing of electricity usage based on the predicted lower-cost periods provided by the Epex-client.
  • Energy Storage: energy storage systems (like batteries) can store electricity during low-price hours and use it during peak-price hours.

Installation

npm i @tvanlaerhoven/epex-client

or

yarn add @tvanlaerhoven/epex-client

Usage

First create an Epex client, with optional configuration. The debug property allows for extra logging during usage of the client.

import * as Epex from '@tvanlaerhoven/epex-client';

const client = new Epex.Client({ debug: true });

Accessing day-ahead market data

The day-ahead market data contains the established electricity prices and quantities for a selected region, based on supply and demand. As an example. the data for MarketArea.Belgium can be requested as follows:

try {
    // Get today's hourly market data
    const data = await client.getDayAheadMarketData(Epex.MarketArea.Belgium, Epex.today());
    console.log(`Today's electricity price from 9h-10h is €${data.entries[9].price}`);
} catch(error) {
    console.error(error.message);
}

The requested delivery date is passed as a string "YYY-MM-DD", or using the convenient methods Epex.today() and Epex.tomorrow(). Note that prices for the next day are typically available in the early afternoon on the day before delivery.

SDAC (Single Day-Ahead Coupling), Great Britain and Switzerland

Most European countries are part of the SDAC (Single Day-Ahead Coupling) pan-European market coupling initiative, which allows cross-border electricity trading and price convergence. Since Brexit, Great Britain has its own market, and also Switzerland as a non-EU country is not part of the SDAC initiative. For both regions it is necessary to pass the auction name when requesting Day-Ahead prices:

const gbData = await client.getDayAheadMarketData(
    Epex.MarketArea.GreatBritain, 
    Epex.tomorrow(), 
    Epex.today(), 
    DayAheadAuction.GB_DAA1
);

const chData = await client.getDayAheadMarketData(
    Epex.MarketArea.Switzerland, 
    Epex.tomorrow(), 
    Epex.today(), 
    DayAheadAuction.CH
);

Displaying market data in a browser

The Epex website does not allow browser requests from any other location than its own host (CORS). To solve this, run a local proxy server that drops any CORS headers from the http request.

import * as Epex from '@tvanlaerhoven/epex-client';

const client = new Epex.Client({ proxyServer: 'http://localhost:8088', debug: true });

The example demonstrates this. Try it by running:

npm run example

The output is a page where you can choose to either visualize today's market prices in table or as a bar graph.