You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

netz-ooe-api-client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netz-ooe-api-client

Unofficial node.js API client for Austrian grid operator Netz OÖ.

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Netz OÖ API Client

About

This project provides a basic implementation of a simple API client for the undocumented API of the Austrian grid operator Netz OÖ.

CAUTION: The entire API is undocumented and might break any time. Do not use for anything critical.

Any contributions are highly welcome!

Usage

Instantiating a client

Simply pass your Netz OÖ username and password to the client like so:

import {
    NetzOoeApiClient,
    Credentials
} from 'netz-ooe-api-client'

const credentials: Credentials = {
    "j_username": "eservice_username_here",
    "j_password": "eservice_password_here"
}
const client = new NetzOoeApiClient(credentials)

Authenticating

Once you have the client, you need to perform the authentication flow like this:

await client.performAuthFlow()

This will perform a series of requests necessary to authenticate against the API and obtain the required cookies and tokens.
Caution: There currently is no mechanism in place to reauthenticate automatically when the session expires.

Get data for a single meter

const exampleRequest = {
    "dimension": "ENERGY",
    "pods": [
        {
            "contractAccountNumber": "Vertragskontonummer_goes_here",
            "meterPointAdministrationNumber": "Zählpunktnummer_goes_here",
            "type": "ACTIVE_CURRENT",
            "timerange": {
                "from": "2024-02-01",
                "to": "2024-02-01"
            },
            "bestAvailableGranularity": "QUARTER_OF_AN_HOUR"
        }
    ]
}
const meterData = await client.getMeterData(exampleRequest)

Please note: QUARTER_OF_AN_HOUR granularity is only available when a single day is requested.

Get dashboard view

To get an overview of the available smart meters, you can use this request.

const dashboardView = await client.getDashboardView();

Todos

  • Proper error handling
  • Automating the authentication, reauthenticate after session expires
  • Documentation

Keywords

netzoberoesterreich

FAQs

Package last updated on 04 Jun 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.