An improved Node.js wrapper around the Nordnet nExt test API.
Install via npm
$ npm install nordnet
or
Install via git clone
$ git clone https://github.com/fhqvst/nordnet.git
$ cd nordnet
$ npm install
The most important functions are authenticate
, call
, and subscribe
.
authenticate
: Refer to the example below.call
: See the nExt API docs.subscribe
: See the nExt Feed docs.For anything else, refer to API.md.
NOTE: Do not use your Nordnet credentials. Instead, create a nExt API account here.
import Nordnet from 'nordnet'
const nordnet = new Nordnet()
// See note above for which credentials to use.
nordnet.authenticate({
username: 'gunther_marder',
password: 'dinkelspiel123'
}).then(() => {
// Listen for feed messages
nordnet.on('private', data => console.log('Private feed:', data))
nordnet.on('public', data => console.log('Public feed:', data)
// Subscribe to trade events for Nordnet B (1869) on Burgundy market (30)
nordnet.subscribe('trades', { i: '1869', m: 30 })
// Fetch data about VOLV A
nordnet.call('GET', 'instruments/16313163').then(console.log)
})
Run all tests
$ npm test
NOTE: No tests will run without an .env
file. Refer to .env.example
in order to create your own.
The author of this software is not responsible for any indirect damages (foreseeable or unforeseeable), such as, if necessary, loss or alteration of or fraudulent access to data, accidental transmission of viruses or of any other harmful element, loss of profits or opportunities, the cost of replacement goods and services or the attitude and behavior of a third party.
The GitHub releases page is used for changelog entries.
axios: https://github.com/mzabriskie/axios/
node-rsa: https://github.com/rzcoder/node-rsa/