Fork me on GitHub

Installation

npm install coinbase-api

Initialization

var coinbase = require("coinbase-api")({ api: <your_api_key>, secret: <your_secret_key> });

Before you get started

Anytime that you see { ... } in the arguments you need to use the parameters specified by the Coinbase API.


Account Changes

coinbase.accountChanges(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.accountChanges({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Accounts

.get(id, cb)

coinbase.accounts.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.createAddress(id, { ... }, cb)

coinbase.accounts.createAddress(<id>, { ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.list([{ ... },] cb)

coinbase.accounts.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.accounts.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.balance(id, cb)

coinbase.accounts.balance(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.create({ ... }, cb)

coinbase.accounts.create({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.update(id, { ... }, cb)

coinbase.accounts.update(<id>, { ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.primary(id, cb)

coinbase.accounts.primary(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.del(id, cb)

coinbase.accounts.del(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Addresses

coinbase.addresses(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.addresses({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Authorization

coinbase.authorization(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Buttons

.create({ ... }, cb)

coinbase.buttons.create({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.createOrder(code, cb)

coinbase.buttons.createOrder(<code>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.orders(code, cb)

coinbase.buttons.orders(<code>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Buys

coinbase.buys({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Contacts

coinbase.contacts(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.contacts({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Currencies

.list(cb)

coinbase.currencies.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.exchangeRates(cb)

coinbase.currencies.exchangeRates(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Oauth Applications

.list([{ ... },] cb)

coinbase.oauth.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.oauth.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.oauth.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.create({ ... }, cb)

coinbase.oauth.create({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Orders

.list([{ ... }], cb)

coinbase.orders.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.orders.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.orders.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Payment Methods

coinbase.paymentMethods(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Prices

.buy([{ ... }], cb)

coinbase.prices.buy(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.prices.buy({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.sell([{ ... }], cb)

coinbase.prices.sell(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.prices.sell({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.spotRate([{ ... }], cb)

coinbase.prices.spotRate(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.prices.spotRate({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.historical([page], cb)

coinbase.prices.historical(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.prices.historical(<page>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Recurring Payments

.list([{ ... }], cb)

coinbase.recurringPayments.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.recurringPayments.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.recurringPayments.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Reports

.list([{ ... },] cb)

coinbase.reports.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.reports.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.create({ ... }, cb)

coinbase.reports.create({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.reports.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Sells

coinbase.sells({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Subscribers

.list([{ ... }], cb)

coinbase.subscribers.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.subscribers.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.subscribers.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Tokens

.create(cb)

coinbase.tokens.create(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.redeem(token_id, cb)

coinbase.tokens.redeem(<token_id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Transactions

.list([{ ... }], cb)

coinbase.transactions.list(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.transactions.list({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.get(id, cb)

coinbase.transactions.get(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.sendMoney({ ... }, cb)

coinbase.transactions.sendMoney({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.requestMoney({ ... }, cb)

coinbase.transactions.requestMoney({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.resendRequest(id, cb)

coinbase.transactions.resendRequest(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.cancelRequest(id, cb)

coinbase.transactions.cancelRequest(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.completeRequest(id, cb)

coinbase.transactions.completeRequest(<id>, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Transfers

coinbase.transfers(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

or

coinbase.transfers({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

Users

.create({ ... }, cb)

coinbase.users.create({ ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.current(cb)

coinbase.users.current(function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});

.update(id, { ... }, cb)

coinbase.users.update(<id>, { ... }, function(err, json) {
    if (err) return console.log(err);

    console.log(json);
});