Code Monkey home page Code Monkey logo

primagas-api's Introduction

primagas-api

This NPM package provides a full nodejs-api for the Primagas-Website to fetch data of your account, your gas tank and more.

Note: As of July 2023, there is a new customer portal, which is a complete rewrite of the old one. This script will currently not work with the new one and the old one is offline.

Some information about the new portal:

  • OAuth2 Authorization URL: https://depgprodaadb2c.b2clogin.com/depgprodaadb2c.onmicrosoft.com/b2c_1a_signinorsignup/oauth2/v2.0/authorize
  • OAuth2 Token URL: https://depgprodaadb2c.b2clogin.com/depgprodaadb2c.onmicrosoft.com/b2c_1a_signinorsignup/oauth2/v2.0/token
  • OAuth2 Client ID: 15f4b687-8555-413c-bafd-acb38cff6837
  • OAuth2 redirect URL: https://kunden.primagas.de/api/auth/callback/azureadb2c
  • OAuth2 flow uses PKCE with SHA256
  • API Endpoint for tank data: https://api.shvenergy.com/assets-api/v1/business-units/DE-PG/accounts/<customer-number>/delivery-points/<customer-number>_T_1/assets/<customer-number>_T_1/readings?$filter=

This NPM package provides a full nodejs-api for the Primagas-Website to fetch data of your account, our gas tank...

Note: Currently, not all API functions are implemented which are available of the shvenergy-api

Usage

  • Install NPM package from GitHub.
  • Functions return a Promise
  • For detailed information about the function return values, view the Typescript interface files in /src/interfaces

Example

import PrimaGasClient from "@trickfilm400/primagas-api";

const client = new PrimaGasClient<"timestamp">("<USERNAME>", "<PASSWORD>", "<CUSTOMER-NUMBER>", "timestamp");

client.tankDaten().then(console.log, console.error);
// client.rechnungsDaten().then(console.log, console.error);
// client.stammDaten().then(console.log, console.error);

© 2022-2024 Trickfilm400

primagas-api's People

Contributors

trickfilm400 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.