mintpal

0.1.2 • Public • Published

Mintpal

Mintpal.com NodeJS API client. Fully supports the v1 API features: Mintpal.com API.

NPM

Build Status

Example Usage

var Mintpal = require('mintpal');
var client = new Mintpal();
 
// fetch current stats for DRK/BTC
client.stats('DRK', 'BTC', function(err, data){ })
 
// fetch a market summary for LTC
client.summary('LTC', function(err, data){ })
 
// see last 100 trades for LTC/BTC
client.trades('LTC/BTC', function(err, data){ })
 
// get chart data for Dogecoin (last 24 hours)
client.chart('DOGE/BTC', '1dd', function(err, data){ })
 

Mintpal.com API documentation

For detailed API info, check out the official v1 API docs: https://www.mintpal.com/api

API Methods

### new Mintpal(options)

@options Object:

  • exchange set a default exchange, example: LTC or BTC
  • coin set a default coin, example: 'DOGE'
  • period default time period to use for chart method calls
  • api_version defaults to v1
var mintpal = new Mintpal({
  exchange: 'BTC',
  coin: 'DOGE'
})
### Mintpal.summary(exchange, callback)
  • exchange (optional) summary data by exchange (LTC or BTC)
  • callback receives error, data, response

Provides an overview of all our markets. Data refreshes every minute.

mintpal.summary(function(err, data){
  console.log(data)
})
[
  {
    "market_id": "88",
    "coin": "365Coin",
    "code": "365",
    "exchange": "BTC",
    "last_price": "0.20000001",
    "yesterday_price": "0.20000001",
    "change": "0.00",
    "24hhigh": "0.21500024",
    "24hlow": "0.20000000",
    "24hvol": "0.163",
    "top_bid": "0.20000001",
    "top_ask": "0.20499999"
  },
  ...
]
### Mintpal.stats(coin, exchange, callback)
  • coin The coin you're interested in, example: DOGE
  • exchange (optional) exchange example: LTC or BTC

Provides the statistics for a single market. Data refreshes every minute.

mintpal.summary('DOGE', 'BTC', function(err, data){
  console.log(data)
})
// or shorthand
mintpal.summary('DOGE/BTC', function(){})
 
[
  {
    "market_id": "16",
    "coin": "Dogecoin",
    "code": "DOGE",
    "exchange": "BTC",
    "last_price": "0.00000049",
    "yesterday_price": "0.00000050",
    "change": "-2.00",
    "24hhigh": "0.00000052",
    "24hlow": "0.00000046",
    "24hvol": "37.989",
    "top_bid": "0.00000049",
    "top_ask": "0.00000050"
  }
]
### Mintpal.trades(coin, exchange, callback)
  • coin The coin you're interested in, example: DOGE
  • exchange (optional) exchange example: LTC or BTC

Fetches the last 100 trades for a given market.

mintpal.trades('DOGE', 'BTC', function(err, data){
  console.log(data)
})
// or shorthand
mintpal.trades('DOGE/BTC', function(){})
 
[{
   "count":"100",
   "trades":[{
      "type":"1",
      "price":"0.00000023",
      "amount":"412128.80177019",
      "total":"0.09478962",
      "time":"1394498289.2727"
   },
   ...
}]
### Mintpal.orders(coin, exchange, type, callback)
  • coin The coin you're interested in, example: DOGE
  • exchange (optional) exchange example: LTC or BTC
  • type (optional) example: BUY or SELL (default is BUY)

Fetches the 50 best priced orders of a given type for a given market.

mintpal.orders('DOGE', 'BTC', 'BUY', function(err, data){
  console.log(data)
})
// or shorthand
mintpal.orders('DOGE/BTC', 'SELL', function(){})
 
[{
   "count":"23",
   "type":"BUY",
   "orders":[{
      "price":"0.00000023",
      "amount":"22446985.14519785",
      "total":"5.16280655"
   },
   ...
}]
### Mintpal.chart(coin, exchange, period, callback)
  • coin The coin you're interested in, example: DOGE
  • exchange (optional) exchange example: LTC or BTC
  • period (optional) time period filter examples: 6hh, 1dd, 3dd, 7dd, max default is 6hh

chart data that we use for our candlestick graphs for a market for a given time period.

mintpal.chart('DOGE', 'BTC', '6hh', function(err, data){
  console.log(data)
})
// or shorthand
mintpal.chart('DOGE/BTC', 'max', function(){})
 
[
  {
    "date":"2014-02-09 14:20",
    "open":"0.00000006",
    "close":"0.00000006",
    "high":"0.00000006",
    "low":"0.00000003",
    "exchange_volume":"0.00002145",
    "coin_volume":"608.50000000"
  },
  ...
]

Contributing

Fork and clone the repository. Install dependencies with:

npm install

Run the existing test spec with npm test.

Roadmap

Support this project

BTC 1EkGJfpcAi6oeq1ooEjgzHVuRvc1HdvuXu
LTC LKPvk8RQsoYpmS9ajoXVoMUtAVpTJ8R9zH
CRYPT Esug5bcsMkQ9m2kMPtLpz2thwXSjyMtxkw

Package Sidebar

Install

npm i mintpal

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • mediaupstream