Skip to main content

Installation

Node.js

Install the package using npm:
npm install tradewatch --save

Browser

The library also works in the browser environment via npm and browserify. After installing browserify:
npm install -g browserify
Perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.

Usage

var Tradewatch = require('tradewatch');
var defaultClient = Tradewatch.ApiClient.instance;

// Configure API key authorization: api_key_query
var api_key_query = defaultClient.authentications['api_key_query'];
api_key_query.apiKey = "YOUR API KEY"

var api = new Tradewatch.AccountApi()
var opts = {
  'limit': 56, // {Number}
  'interval': new Tradewatch.AccountUsageStatisticsInterval()
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getUsage(opts, callback);

More Examples

Find more examples in our GitHub repository.