Coder Social home page Coder Social logo

hugo-persson / avanzagrafanatracker Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 24 KB

A Node service that scrapes Avanza account and exposes values to /metrics route for Grafana to scare

TypeScript 96.16% Dockerfile 2.92% Shell 0.92%
avanza finance grafana stock

avanzagrafanatracker's Introduction

About

This project currently has a connector to Avanza that takes current balance of Avanza accounts and profit and displays that data at /metricsroute.

Setup

To run the project the following env variables need to be set in a .env file variables needs to be set

  • USERNAME - Your avanza username
  • PASSWORD - Your avanza password
  • TOTP - The secret for 2FA authenticator, see below about details how to get

See example.env for setup.

To run the project run

docker-compose up

When running first time no accounts will be tracked but in the console the possible accounts with their accountId will be outputted like this:

Account available:
Account1:123456
Account2:123456
Account3:123456

To select what accounts to track add this env variable

ACCOUNTS_TO_TRACK=Account1:123456,Account2:123456

Each account as listed with comma separation.

Restart the application and now all the relevant data should be accessible at the route /metrics.

Getting TOTP secret

See guide here https://github.com/fhqvst/avanza#getting-a-totp-secret

Optional ENV variables

  • PORT - Which port the application should be accessed with
  • UPDATE_INTERVAL - How often Avanza should be scraped

avanzagrafanatracker's People

Contributors

hugo-persson avatar

Watchers

 avatar  avatar  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.