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

entsoe-api-node

v1.1.0

Published

Unofficial API wrapper for the ENTSO-E Transparency Platform API (https://transparency.entsoe.eu)

Downloads

143

Readme

entsoe-api-node Build

Unofficial API wrapper for the ENTSO-E Transparency Platform RESTful API.

Why this wrapper

The API responses from the ENTSO-E Transparency Platform are formatted in XML, which may not be easily consumable in JavaScript applications. This wrapper transforms the response into the more compatible JSON format.

Table of Contents

Installation

npm i entsoe-api-node

Getting started

To use this wrapper, you must first register with the Transparency Platform and request access to the RESTful API by sending an email to [email protected] with 'Restful API access' in the subject line. Be sure to include the email address you used during registration in the email body. Once granted access, you can then generate a security token under the account settings.

import Entsoe, { BiddingZonesByCountry } from "entsoe-api-node";

const client = Entsoe({ apiToken: "YOUR-SECURITY-TOKEN" });

const result = await client.dayAheadPrices({
  startDate: new Date().toISOString(),
  biddingZone: BiddingZonesByCountry.SE4,
});

Require using commonjs.

const Enstoe = require("entsoe-api-node").default;

Initialize

| Param | Type | Required | Info | | -------- | ------- | -------- | ------------------------ | | apiToken | String | true | | | testnet | Boolean | false | For testing purpose only |

Code examples

The /example folder contains code examples on how to use the API methods. You can try out these examples by running the following command:

npm run example:dev -- example/example-file.js

Public REST Endpoints

Time is always expressed in UTC.

Each method accepts an optional second parameter to customize the XML response.

Automatically throttle if the limit of 400 requests per minute is reached.

console.log(await client.dayAheadPrices({ biddingZone: "10Y1001A1001A47J" }, (xmlString) async => /* parse the XML and return some magic */));

dayAheadPrices

Get the published day-ahead prices for given bidding zone. The result always includes 24 hours of data, starting from midnight local time of the specified bidding zone.

console.log(
  await client.dayAheadPrices({
    startDate: new Date().toISOString(),
    biddingZone: "10Y1001A1001A47J",
  }),
);

| Param | Type | Required | Default | Info | | ----------- | ------ | -------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | biddingZone | String | true | | Check out the utility BiddingZonesByCountry for available zones/areas. | | startDate | String | true | | ISO 8601 formated date string | | endDate | String | false | startDate + next day | ISO 8601 formated date string |

  • One year range limit applies
  • Minimum time interval between startDate and endDate is one day
{
  "mRID": "d2ac60ea49be4a73b8dd3af014e19ff6",
  "revisionNumber": 1,
  "type": "A44",
  "senderMarketParticipantMRID": "10X1001A1001A450",
  "senderMarketParticipantMarketRoleType": "A32",
  "receiverMarketParticipantMRID": "10X1001A1001A450",
  "receiverMarketParticipantMarketRoleType": "A33",
  "createdDateTime": "2022-10-12T20:39:24Z",
  "timezone": "UTC",
  "period": {
    "timeInterval": { "start": "2022-08-11T22:00Z", "end": "2022-08-12T22:00Z" }
  },
  "timeSeries": [
    {
      "mRID": "1",
      "businessType": "A62",
      "inDomainMRID": "10Y1001A1001A47J",
      "outDomainMRID": "10Y1001A1001A47J",
      "currencyUnitName": "EUR",
      "priceMeasureUnitName": "MWH",
      "curveType": "A01",
      "period": {
        "timeInterval": {
          "start": "2022-08-11T22:00Z",
          "end": "2022-08-12T22:00Z"
        },
        "resolution": "PT60M",
        "point": [
          { "position": 1, "priceAmount": 411.97 },
          { "position": 2, "priceAmount": 395.28 },
          { "position": 3, "priceAmount": 386.2 },
          { "position": 4, "priceAmount": 382.55 },
          { "position": 5, "priceAmount": 392.89 },
          { "position": 6, "priceAmount": 398.21 },
          { "position": 7, "priceAmount": 469.21 },
          { "position": 8, "priceAmount": 513.31 },
          { "position": 9, "priceAmount": 508 },
          { "position": 10, "priceAmount": 472.56 },
          { "position": 11, "priceAmount": 419.9 },
          { "position": 12, "priceAmount": 405.6 },
          { "position": 13, "priceAmount": 376.39 },
          { "position": 14, "priceAmount": 328.45 },
          { "position": 15, "priceAmount": 334.37 },
          { "position": 16, "priceAmount": 372.09 },
          { "position": 17, "priceAmount": 393.24 },
          { "position": 18, "priceAmount": 448.08 },
          { "position": 19, "priceAmount": 478.23 },
          { "position": 20, "priceAmount": 546.56 },
          { "position": 21, "priceAmount": 551.83 },
          { "position": 22, "priceAmount": 495.59 },
          { "position": 23, "priceAmount": 458.21 },
          { "position": 24, "priceAmount": 413.84 }
        ]
      }
    }
  ]
}

Miscellaneous

Bidding zones

An utility bidding zone map is also being exported by the package in order for you to make readable request while using the API.

import { BiddingZonesByCountry } from "entsoe-api-node";

console.log(
  await client.dayAheadPrices({ biddingZone: BiddingZonesByCountry.SE4 }),
);
This project is based on the node-module-swc-cjs starter. Check it out for more production ready starters!