Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tvanlaerhoven/epex-client

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tvanlaerhoven/epex-client

Get European Power Exchange (EPEX) market data

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Epex Client

The Epex Client package enables querying of the latest European Power Exchange (EPEX) market data. It is intended primarily for hobbyist solutions, as the data is sourced directly from the official EPEX website.

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.

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 });

Then request the market data:

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);
}

Rendering 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 table with today's market prices:

Market Prices

FAQs

Package last updated on 24 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc