# bfx-api-node-rest

> Official Bitfinex REST v1 & v2 API interfaces

Latest version **8.1.1** (published 2026-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install bfx-api-node-rest
pnpm add bfx-api-node-rest
yarn add bfx-api-node-rest
bun add bfx-api-node-rest
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 8.1.1 |
| Published | 2026-07-28 |
| First published | 2018-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 6 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Bitfinex |
| Maintainers | vigan-abd, prdn, bitfinexorg |
| Keywords | bitfinex, bitcoin, BTC |

## Links

- npm: https://www.npmjs.com/package/bfx-api-node-rest
- Repository: https://github.com/bitfinexcom/bfx-api-node-rest
- Homepage: https://github.com/bitfinexcom/bfx-api-node-rest#readme
- Issues: https://github.com/bitfinexcom/bfx-api-node-rest/issues
- npm.io page: https://npm.io/package/bfx-api-node-rest

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) 4.3.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [dirty-chai](https://npm.io/package/dirty-chai.md) ^2.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.9
- [bfx-api-node-util](https://npm.io/package/bfx-api-node-util.md) ^1.0.10
- [bfx-api-node-models](https://npm.io/package/bfx-api-node-models.md) ^2.1.3

## Recent versions

- 8.1.1 (latest) — 2026-07-28
- 8.1.0 — 2026-07-14
- 8.0.0 — 2026-04-27
- 7.0.0 — 2025-10-21
- 6.0.0 — 2024-09-17
- 5.6.0 — 2024-01-10
- 5.5.0 — 2023-08-31
- 5.4.0 — 2023-07-26
- 5.3.0 — 2023-07-04
- 5.2.0 — 2023-06-15
- 5.1.1 — 2023-06-02
- 5.1.0 — 2023-05-02
- 5.0.2 — 2023-04-26
- 5.0.1 — 2023-04-26
- 5.0.0 — 2023-04-19
- … 53 more at https://npm.io/package/bfx-api-node-rest/versions

## README

# Bitfinex RESTv1 & RESTv2 APIs for Node.JS

[![Build Status](https://travis-ci.org/bitfinexcom/bfx-api-node-rest.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-api-node-rest)
A Node.JS reference implementation of the Bitfinex REST APIs

To use, construct a new instance of either the `RESTv1` or `RESTv2` classes.
All API methods return promises and accept a callback as the last parameter; the
callback will be called with `(error, response)`.

To minimize the data sent over the network the transmitted data is structured in
arrays. In order to reconstruct key / value pairs, set `opts.transform` to `true`
when creating an interface.

## Features

* Official implementation
* REST v2 API
* REST v1 API

## Installation

```bash
  npm i --save bfx-api-node-rest
```

### Quickstart

```js
const { RESTv2 } = require('bfx-api-node-rest')
const rest = new RESTv2({ transform: true })

// do something with the RESTv2 instance
```

### Docs

Documentation at [https://docs.bitfinex.com/v2/reference](https://docs.bitfinex.com/v2/reference)

[See `docs/`](/docs) for JSDoc generated documentation of available methods.

## Example

```js
const { RESTv2 } = require('bfx-api-node-rest')

const rest = new RESTv2({
  apiKey: '...',
  apiSecret: '...',
  authToken: '...', // optional, has priority over API key/secret
  url: '...',       // optional
  transform: true,  // to have full models returned by all methods
  agent: null,      // optional proxy agent
})

rest.candles({
  timeframe: '1m',
  symbol: 'tBTCUSD',
  query: {
    start: Date.now() - (24 * 60 * 60 * 1000),
    end: Date.now(),
    limit: 1000,
  }
}).then((candles) => {
  // ...
}).catch((err) => {
  console.log(err)
})
```

## FAQ

### nonce too small

I make multiple parallel request and I receive an error that the nonce is too
small. What does it mean?

Nonces are used to guard against replay attacks. When multiple HTTP requests
arrive at the API with the wrong nonce, e.g. because of an async timing issue,
the API will reject the request.

If you need to go parallel, you have to use multiple API keys right now.

### Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

---
_Source: https://npm.io/package/bfx-api-node-rest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
