Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
example of how to invoke OANDA V20 API from node.js
"use strict";
const oandaV20 = require('@oanda/v20/context');
const fs = require('fs');
var ctx = new oandaV20.Context('', 443, true, "demo");
var key = fs.readFileSync('api.key', {encoding: 'utf8'});
//remove any bad chars (e.g. the trailing newline)
key = key.replace(/[^0-9a-fA-F-]/g, "");
ctx.account.list(function(res) {
var accounts = res.body;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.