mintpal
v0.1.2
Published
Mintpal.com NodeJS API client.
Downloads
3
Maintainers
Readme
Mintpal
Mintpal.com NodeJS API client. Fully supports the v1 API features: Mintpal.com API.
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
@options Object:
exchange
set a default exchange, example: LTC or BTCcoin
set a default coin, example: 'DOGE'period
default time period to use forchart
method callsapi_version
defaults tov1
var mintpal = new Mintpal({
exchange: 'BTC',
coin: 'DOGE'
})
exchange
(optional) summary data by exchange (LTC or BTC)callback
receiveserror, 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"
},
...
]
coin
The coin you're interested in, example: DOGEexchange
(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"
}
]
coin
The coin you're interested in, example: DOGEexchange
(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"
},
...
}]
coin
The coin you're interested in, example: DOGEexchange
(optional) exchange example: LTC or BTCtype
(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"
},
...
}]
coin
The coin you're interested in, example: DOGEexchange
(optional) exchange example: LTC or BTCperiod
(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
- Implement the v2 beta API see: https://www.mintpal.com/api/v2
- Node Streams?
- Promises API support?
- ???
Support this project
BTC 1EkGJfpcAi6oeq1ooEjgzHVuRvc1HdvuXu
LTC LKPvk8RQsoYpmS9ajoXVoMUtAVpTJ8R9zH
CRYPT Esug5bcsMkQ9m2kMPtLpz2thwXSjyMtxkw