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

entsoe-api-client

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

entsoe-api-client

ENTSO-e transparency platform API Client. Complete. Easy to use. Minimal.

  • 0.9.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
Maintainers
1
Weekly downloads
 
Created
Source

entsoe-api-client

Unofficial ENTSO-e REST API Client for Deno and Node. Complete. Easy to use. Minimal.

Module type: CJS+ESM NPM Downloads MIT License

Features

  • Supports all requests listed in Entso-e REST API Documentation
  • Support zip-file endpoints, unzips documents transparently
  • Examples written to support both Node and Deno
  • Supports Deno and Node
  • Fully Typed, written in TypeScript
  • ESM (Deno, Node) and CommonJS (Node) support
  • Adds description to codes while parsing the documents

Installation

Make sure to use a recent version of your runtime, Node.js >=18 and Deno >=1.26 is supported.

Deno

import { QueryConfiguration } from "https://deno.land/x/entsoe_api_client/mod.ts";

Node

npm install entsoe-api-client --save

Documentation

Documents structure and parameters returned by this library closely resemble what you find in ENTSO-e REST API documentation, so have a look there too.

If you want a Publication_MarketDocument, the corresponding function in this library is QueryPublication. In the resulting document (object), the key receiver_MarketParticipant.mRID will become receiverMarketParticipantId. The same goes for parameters. We recommend have auto-completion enabled in your editor, the types will give great help in navigating the parameters and document objects.

Another difference compared to source documents is that most ids automatically get a complementary description, where applicable. As an example businessType=B33 in the raw xml will result in keys businessType: "B33" and businessTypeDescription: "Area Control Error" in the output.

Note Full library and method documentation can be found at deno.land/x/entsoe_api_client.

Methods

Querying

MethodInterfaceDescription
Query(securityToken, params)
=>
Promise<unknown[]>
Fetch any document, and return a array of typed and
parsed JavaScript object(s). Primarily internal, but exported.
QueryPublication(securityToken, params)
=>
Promise<PublicationDocument[]>
Request Publication_MarketDocument(s), and return
a array of typed and parsed JavaScript object(s)
QueryGL(securityToken, params)
=>
Promise<GLDocument[]>
Same, for GL_MarketDocument
QueryUnavailability(securityToken, params)
=>
Promise<UnavailabilityDocument[]>
Same, for Unavailability_MarketDocument
QueryConfiguration(securityToken, params)
=>
Promise<ConfigurationDocument[]>
Same, for Configuration_MarketDocument
QueryBalancing(securityToken, params)
=>
Promise<BalancingDocument[]>
Same, for Balancing_MarketDocument(s)
QueryTransmissionNetwork(securityToken, params)
=>
Promise<TransmissionNetworkD...>
Same, for Transmission_MarketDocument(s)
QueryCriticalNetworkElement(securityToken, params)
=>
Promise<CriticalNetworkEleme...>
Same, for CriticalNetworkElement_MarketDocument(s)

Translations

Helper functions for translate human readable descriptions to ids usable by the api.

MethodInterfaceDescription
Area(identifier)
=>
string[] | undefined
Finds internal id (10YL-1001A00074) of all areas
having aspecific identier (CTA|SE, BZN|DE-LU etc...)
AllAreas(identifier)
=>
string | undefined
Same as above, but return first match
DocumentType(name)
=>
string | undefined
Get document type from Document name
ProcessType(name)
=>
string | undefined
Get process type from process name
BusinessType(name)
=>
string | undefined
Get business type from business name
PsrType(name)
=>
string | undefined
Get psr type from psr name
AuctionType(name)
=>
string | undefined
Get auction type from auction name
AuctionCategory(name)
=>
string | undefined
Get auction category type from auction category name
Direction(name)
=>
string | undefined
Get direction id from direction name
DocStatus(name)
=>
string | undefined
Get document status id from document status name
MarketAgreementType(name)
=>
string | undefined
Get market agreement type id from market agreement type name
MarketProduct(name)
=>
string | undefined
Get Market product id from market product name

Parsing

MethodInterfaceDescription
ParseDocument(xmlDocument)
=>
PublicationDocument|BalancingDoc...
Parses raw XML into a typed object.
Primarily internal, but exported and usable.

Note The parsing function is mainly intended for internal use in the library

Query Parameters

All parameters that can be passes to Query(), QueryPublication() etc.

Parameter NameTypeName in ENSO-e REST APINote
documentTypestringDocumentType
processType (optional)stringProcessType
businessType (optional)stringBusinessType
psrType (optional)stringPsrType
inDomain (optional)stringIn_Domain
inBiddingZoneDomain (optional)stringInBiddingZone_Domain
biddingZoneDomain (optional)stringBiddingZone_Domain
outDomain (optional)stringOut_Domain
outBiddingZoneDomain (optional)stringOutBiddingZone_Domain
startDateTime(optional)DateTimeIntervalISO8601 string
endDateTime (optional)DateTimeIntervalISO8601 string
startDateTimeUpdate (optional)DateTimeIntervalUpdateISO8601 string
endDateTimeUpdate (optional)DateTimeIntervalUpdateISO8601 string
offset (optional)numberOffsetEnables fetching more than x documents by using pagination
implementationDateAndOrTime (optional)stringImplementation_DateAndOrTimeISO8601 string
contractMarketAgreementType (optional)stringContract_MarketAgreement.Type
auctionType (optional)stringAuction.Type
auctionCategory (optional)stringAuction.Category
classificationSequenceAICPosition (optional)stringClassificationSequence_(...).Position
connectingDomain (optional)stringconnecting_Domain
standardMarketProduct (optional)stringStandard_MarketProduct
originalMarketProduct(optional)stringOriginal_MarketProduct
registeredResource (optional)stringregisteredResource
acquiringDomain (optional)stringAcquiring_Domain
mRID (optional)stringmRID
docStatus (optional)stringDocStatus

Examples

Examples can be found in the /examples directory.

To run the examples, pass your ENTSO-e API key by environment variable API_TOKEN.

Deno

Powershell

$env:API_TOKEN="your-api-token"; deno run -A .\spot-prices-today.ts

Bash

API_TOKEN="your-api-token" deno run -A .\spot-prices-today.ts

Node

Powershell

$env:API_TOKEN="your-api-token"; node .\spot-prices-today.ts

Bash

API_TOKEN="your-api-token" node .\spot-prices-today.ts

Contributing

Deno CI Node CI

All contributions are welcome.

Module is developed in Deno. Node module is generated by dnt, using scripts/build_npm.ts.

See Contribution Guide

Note Please run deno task precommit before each commit, to make sure every file is tested/formatted/linted to standards.

Donations

Sponsor me on GitHub, or

Buy Me a Coffee at ko-fi.com

License

MIT

FAQs

Package last updated on 10 Feb 2023

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