
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
deribit-api
Advanced tools
The Deribit API is available in this package.
npm install deribit-api
var RestClient = require("deribit-api").RestClient;
var restClient = new RestClient();
restClient.getcurrencies().then((result) => {
console.log("Currencies: ", result);
});
restClient.index((result) => {
console.log("Index: ", result)
});
new RestClient(key, secret, url)
Constructor creates new REST client.
Parameters
| Name | Type | Decription |
|---|---|---|
key | string | Optional, Access Key needed to access Private functions |
secret | string | Optional, Access Secret needed to access Private functions |
url | string | Optional, server URL, default: https://www.deribit.com |
getorderbook(instrument, callback) - Doc, public
Retrieve the orderbook for a given instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
callback | function | Optional, callback, if not provided method returns promise |
index(callback) - Doc, public
Get price index, BTC-USD rates.
Parameters
| Name | Type | Decription |
|---|---|---|
callback | function | Optional, callback, if not provided method returns promise |
getcurrencies(callback) - Doc, public
Get all supported currencies.
Parameters
| Name | Type | Decription |
|---|---|---|
callback | function | Optional, callback, if not provided method returns promise |
getorderbook(instrument, callback) - Doc, public
Retrieve the orderbook for a given instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
callback | function | Optional, callback, if not provided method returns promise |
getlasttrades(instrument, count, since, callback) - Doc, public
Retrieve the latest trades that have occured for a specific instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
count | integer | Optional, count of trades returned (limitation: max. count is 100) |
since | integer | Optional, “since” trade id, the server returns trades newer than that “since” |
callback | function | Optional, callback, if not provided method returns promise |
getsummary(instrument, callback) - Doc, public
Retrieve the summary info such as Open Interest, 24H Volume etc for a specific instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
callback | function | Optional, callback, if not provided method returns promise |
account(callback) - Doc, Private
Get user account summary.
Parameters
| Name | Type | Decription |
|---|---|---|
callback | function | Optional, callback, if not provided method returns promise |
buy(instrument, quantity, price, postOnly, label, callback) - Doc, private
Place a buy order in an instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
quantity | integer | Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options) |
price | float | Required, USD for futures, BTC for options |
postOnly | boolean | Optional, if true then the order will be POST ONLY |
label | string | Optional, user defined maximum 4-char label for the order |
callback | function | Optional, callback, if not provided method returns promise |
sell(instrument, quantity, price, postOnly, label, callback) - Doc, private
Place a sell order in an instrument.
Parameters
| Name | Type | Decription |
|---|---|---|
instrument | string | Required, instrument name |
quantity | integer | Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options) |
price | float | Required, USD for futures, BTC for options |
postOnly | boolean | Optional, if true then the order will be POST ONLY |
label | string | Optional, user defined maximum 4-char label for the order |
callback | function | Optional, callback, if not provided method returns promise |
edit(orderId, quantity, price, callback) - Doc
Edit price and/or quantity of the own order. (Authorization is required).
Parameters
| Name | Type | Decription |
|---|---|---|
orderId | integer | Required, ID of the order returned by "sell" or "buy" request |
quantity | integer | Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options) |
price | float | Required, USD for futures, BTC for options |
callback | function | Optional, callback, if not provided method returns promise |
cancel(orderId, callback) - Doc, private
Cancell own order by id.
Parameters
| Name | Type | Decription |
|---|---|---|
orderId | integer | Required, ID of the order returned by "sell" or "buy" request |
callback | function | Optional, callback, if not provided method returns promise |
cancelall(type, callback) - Doc
Cancel all own futures, or all options, or all.
Parameters
| Name | Type | Decription |
|---|---|---|
type | string | Optional, type of instruments to cancel, allowed: "all", "futures", "options", default: "all" |
callback | function | Optional, callback, if not provided method returns promise |
getopenorders(instrument, orderId, callback) - Doc, private
Retrieve open orders.
Parameters
| Name | Type | Description |
|---|---|---|
instrument | string | Optional, instrument name, use if want orders for specific instrument |
orderId | integer | Optional, order id |
callback | function | Optional, callback, if not provided method returns promise |
positions(callback) - Doc, private
Retreive positions.
Parameters
| Name | Type | Decription |
|---|---|---|
callback | function | Optional, callback, if not provided method returns promise |
orderhistory(count, callback) - Doc, private
Get history.
Parameters
| Name | Type | Description |
|---|---|---|
count | integer | Optional, number of requested records |
callback | function | Optional, callback, if not provided method returns promise |
tradehistory(count, instrument, startTradeId, callback) - Doc, private
Get private trade history of the account. (Authorization is required). The result is ordered by trade identifiers (trade id-s).
Parameters
| Name | Type | Description |
|---|---|---|
count | integer | Optional, number of results to fetch. Default: 20 |
instrument | string | Optional, name of instrument, also aliases “all”, “futures”, “options” are allowed. Default: "all" |
startTradeId | integer | Optional, number of requested records |
callback | function | Optional, callback, if not provided method returns promise |
FAQs
EARLY BETA. Node.js connector for aster's REST APIs and WebSockets, with TypeScript & end-to-end tests.
The npm package deribit-api receives a total of 5 weekly downloads. As such, deribit-api popularity was classified as not popular.
We found that deribit-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.