-
Notifications
You must be signed in to change notification settings - Fork 212
v1 REST API
Brent Kirkland edited this page Nov 10, 2017
·
18 revisions
Here is some documentation that will help you along your way. If you would like to read more, visit the Bitfinex Docs
Install bitfinex-api-node via npm:
npm install bitfinex-api-node
Param | Type | Description |
---|---|---|
APIKey | string |
Your BFX API Key |
APISecret | string |
Your BFX Secret Key |
Opts | object |
opts = {version: 1} |
where Opts consists of:
const opts = {
version: 1 // for v1
}
Param | Type | Description |
---|---|---|
pair | string |
BTCUSD, LTCUSD, ETHUSD... |
cb | function |
callback of error, result |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.ticker('BTCUSD', (err, data) => {
if (err) console.log(err)
console.log('Ticker:', data)
})
Param | Type | Description |
---|---|---|
pair | string |
BTCUSD, LTCUSD, ETHUSD... |
cb | function |
callback of error, result |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.stats('BTCUSD', (err, data) => {
if (err) console.log(err)
console.log('Stats:', data)
})
Param | Type | Description |
---|---|---|
currency | string |
USD, GBP, JPY |
options | sting |
i.e. options = {'limit_asks': 2, 'limit_bids': 2}. |
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
const options = {'limit_asks': 30, 'limit_bids': 30}
BFX.fundingbook('USD', options, (err, data) => {
if (err) console.log(err)
console.log('Funding Book:', data)
})
Param | Type | Description |
---|---|---|
pair | string |
BTCUSD, ETHUSD, LTCUSD |
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.orderbook('BTCUSD', (err, data) => {
if (err) console.log(err)
console.log('Orderbook:', data)
})
Param | Type | Description |
---|---|---|
currency | string |
USD, GBP, JPY |
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.trades('USD', (err, data) => {
if (err) console.log(err)
console.log('Trades:', data)
})
Param | Type | Description |
---|---|---|
pair | string |
BTCUSD, ETHUSD, LTCUSD |
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.lends('BTCUSD', (err, data) => {
if (err) console.log(err)
console.log('Lends:', data)
})
Param | Type | Description |
---|---|---|
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.get_symbols((err, data) => {
if (err) console.log(err)
console.log('Symbols:', data)
})
Param | Type | Description |
---|---|---|
cb | function |
callback with error, result as params |
Example:
const bfxRest = const bfxRest = new BFX(apiKey, apiSecretKey, opts).rest
BFX.symbols_details((err, data) => {
if (err) console.log(err)
console.log('Symbols Details:', data)
})
Actively working...