Giter Site home page Giter Site logo

node-btce's Introduction

BTC-E API for Node.js

Simple API to BTC-E Crypto Coin Trading platform

Features

  • Full API (Public and Trade)
  • Asynchronous requests
  • Automatically converts Date objects, strings and JS timestamps to UNIX timestamps

Usage samples

Install

npm install btce

Init

var BTCE = require('btce')
var btce = new BTCE('YOUR-KEY', 'YOUR-SECRET')

Get a ticker

btce.ticker({ pair: 'btc_usd' }, function(err, data) {
  if (!err) console.log(data)
  else console.log(err)
})

Display user information (funds, transaction count, open orders count...)

btce.getInfo(function(err, data) {
  if (!err) console.log(data)
  else console.log(err)
})

Get last 10 transactions in descending order

btce.transHistory({ count: 10, order: 'DESC' }, function(err, data) {
  if (!err) console.log(data)
  else console.log(err)
})

Buy 2 bitcoins for 100$ each

btce.trade({'pair': 'btc_usd', 'type': 'buy', 'rate': 100.0, 'amount': 2.0}, function(err, data) {
  if (!err) console.log(data);
  else console.log(err);
});

Methods

// Trade API (requires api key and secret)
getInfo(callback)
transHistory(params, callback)
tradeHistory(params, callback)
orderList(params, callback)
activeOrders(params, callback)
trade(params, callback)
cancelOrder(orderId, callback)
query(method, params, callback)

// Public API
fee(params, callback)
trades(params, callback)
depth(params, callback)
ticker(params, callback)

// utils
getTimestamp(time)
getHTTPS(url, callback)

Information about parameters in source comments

BTC-E API documentation

Feature requests

  • petermrg at ymail dot com

Donate

  • BTC: 1GVRSmJzZpFoLvFnPNtdwPeVXh6t4t65PZ
  • LTC: LWSRwTDKVxE9BGziUzbUw7MkHz6KACVnAA
  • XPM: Aett4LKYVkaHXzp3EJAUiMzk29No9a9ZUu

node-btce's People

Contributors

petermrg avatar haze-mobicow avatar

Watchers

James Cloos 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.