
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
bit_mex_api
Advanced tools
REST_API_for_the_BitMEX_com_trading_platform_brbra_hrefapprestAPIREST_Documentationabra_hrefappwsAPIWebsocket_Documentationa
BitMexApi - JavaScript client for bit_mex_api
REST API for the BitMEX.com trading platform.
<a href="/app/restAPI">REST Documentation
<a href="/app/wsAPI">Websocket Documentation
This SDK is automatically generated by the Swagger Codegen project:
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install bit_mex_api --save
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Please follow the installation instruction and execute the following JS code:
var BitMexApi = require('bit_mex_api');
var api = new BitMexApi.AnnouncementApi()
var opts = {
'columns': "columns_example" // {String} Array of column names to fetch. If omitted, will return all columns.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.announcementGet(opts, callback);
All URIs are relative to https://localhost/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| BitMexApi.AnnouncementApi | announcementGet | GET /announcement | Get site announcements. |
| BitMexApi.AnnouncementApi | announcementGetUrgent | GET /announcement/urgent | Get urgent (banner) announcements. |
| BitMexApi.ApiKeyApi | apiKeyDisable | POST /apiKey/disable | Disable an API Key. |
| BitMexApi.ApiKeyApi | apiKeyEnable | POST /apiKey/enable | Enable an API Key. |
| BitMexApi.ApiKeyApi | apiKeyGet | GET /apiKey | Get your API Keys. |
| BitMexApi.ApiKeyApi | apiKeyNew | POST /apiKey | Create a new API Key. |
| BitMexApi.ApiKeyApi | apiKeyRemove | DELETE /apiKey | Remove an API Key. |
| BitMexApi.ChatApi | chatGet | GET /chat | Get chat messages. |
| BitMexApi.ChatApi | chatGetConnected | GET /chat/connected | Get connected users. |
| BitMexApi.ChatApi | chatNew | POST /chat | Send a chat message. |
| BitMexApi.ExecutionApi | executionGet | GET /execution | Get all raw executions for your account. |
| BitMexApi.ExecutionApi | executionGetTradeHistory | GET /execution/tradeHistory | Get all balance-affecting executions. This includes each trade, insurance charge, and settlement. |
| BitMexApi.FundingApi | fundingGet | GET /funding | Get funding history. |
| BitMexApi.InstrumentApi | instrumentGet | GET /instrument | Get instruments. |
| BitMexApi.InstrumentApi | instrumentGetActive | GET /instrument/active | Get all active instruments and instruments that have expired in <24hrs. |
| BitMexApi.InstrumentApi | instrumentGetActiveAndIndices | GET /instrument/activeAndIndices | Helper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active. |
| BitMexApi.InstrumentApi | instrumentGetActiveIntervals | GET /instrument/activeIntervals | Return all active contract series and interval pairs. |
| BitMexApi.InstrumentApi | instrumentGetIndices | GET /instrument/indices | Get all price indices. |
| BitMexApi.InsuranceApi | insuranceGet | GET /insurance | Get insurance fund history. |
| BitMexApi.LeaderboardApi | leaderboardGet | GET /leaderboard | Get current leaderboard. |
| BitMexApi.LiquidationApi | liquidationGet | GET /liquidation | Get liquidation orders. |
| BitMexApi.OrderApi | orderAmend | PUT /order | Amend the quantity or price of an open order. |
| BitMexApi.OrderApi | orderAmendBulk | PUT /order/bulk | Amend multiple orders. |
| BitMexApi.OrderApi | orderCancel | DELETE /order | Cancel order(s). Send multiple order IDs to cancel in bulk. |
| BitMexApi.OrderApi | orderCancelAll | DELETE /order/all | Cancels all of your orders. |
| BitMexApi.OrderApi | orderCancelAllAfter | POST /order/cancelAllAfter | Automatically cancel all your orders after a specified timeout. |
| BitMexApi.OrderApi | orderClosePosition | POST /order/closePosition | Close a position. [Deprecated, use POST /order with execInst: 'Close'] |
| BitMexApi.OrderApi | orderGetOrders | GET /order | Get your orders. |
| BitMexApi.OrderApi | orderNew | POST /order | Create a new order. |
| BitMexApi.OrderApi | orderNewBulk | POST /order/bulk | Create multiple new orders. |
| BitMexApi.OrderBookApi | orderBookGet | GET /orderBook | Get current orderbook [deprecated, use /orderBook/L2]. |
| BitMexApi.OrderBookApi | orderBookGetL2 | GET /orderBook/L2 | Get current orderbook in vertical format. |
| BitMexApi.PositionApi | positionGet | GET /position | Get your positions. |
| BitMexApi.PositionApi | positionIsolateMargin | POST /position/isolate | Enable isolated margin or cross margin per-position. |
| BitMexApi.PositionApi | positionTransferIsolatedMargin | POST /position/transferMargin | Transfer equity in or out of a position. |
| BitMexApi.PositionApi | positionUpdateLeverage | POST /position/leverage | Choose leverage for a position. |
| BitMexApi.QuoteApi | quoteGet | GET /quote | Get Quotes. |
| BitMexApi.QuoteApi | quoteGetBucketed | GET /quote/bucketed | Get previous quotes in time buckets. |
| BitMexApi.SchemaApi | schemaGet | GET /schema | Get model schemata for data objects returned by this API. |
| BitMexApi.SchemaApi | schemaWebsocketHelp | GET /schema/websocketHelp | Returns help text & subject list for websocket usage. |
| BitMexApi.SettlementApi | settlementGet | GET /settlement | Get settlement history. |
| BitMexApi.StatsApi | statsGet | GET /stats | Get exchange-wide and per-series turnover and volume statistics. |
| BitMexApi.StatsApi | statsHistory | GET /stats/history | Get historical exchange-wide and per-series turnover and volume statistics. |
| BitMexApi.TradeApi | tradeGet | GET /trade | Get Trades. |
| BitMexApi.TradeApi | tradeGetBucketed | GET /trade/bucketed | Get previous trades in time buckets. |
| BitMexApi.UserApi | userCancelWithdrawal | POST /user/cancelWithdrawal | Cancel a withdrawal. |
| BitMexApi.UserApi | userCheckReferralCode | GET /user/checkReferralCode | Check if a referral code is valid. |
| BitMexApi.UserApi | userConfirmEmail | POST /user/confirmEmail | Confirm your email address with a token. |
| BitMexApi.UserApi | userConfirmEnableTFA | POST /user/confirmEnableTFA | Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint. |
| BitMexApi.UserApi | userConfirmPasswordReset | POST /user/confirmPasswordReset | Confirm a password reset. |
| BitMexApi.UserApi | userConfirmWithdrawal | POST /user/confirmWithdrawal | Confirm a withdrawal. |
| BitMexApi.UserApi | userDisableTFA | POST /user/disableTFA | Disable two-factor auth for this account. |
| BitMexApi.UserApi | userGet | GET /user | Get your user model. |
| BitMexApi.UserApi | userGetAffiliateStatus | GET /user/affiliateStatus | Get your current affiliate/referral status. |
| BitMexApi.UserApi | userGetCommission | GET /user/commission | Get your account's commission status. |
| BitMexApi.UserApi | userGetDepositAddress | GET /user/depositAddress | Get a deposit address. |
| BitMexApi.UserApi | userGetMargin | GET /user/margin | Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies. |
| BitMexApi.UserApi | userGetWalletHistory | GET /user/walletHistory | Get a history of all of your wallet transactions (deposits and withdrawals). |
| BitMexApi.UserApi | userLogin | POST /user/login | Log in to BitMEX. |
| BitMexApi.UserApi | userLogout | POST /user/logout | Log out of BitMEX. |
| BitMexApi.UserApi | userLogoutAll | POST /user/logoutAll | Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices. |
| BitMexApi.UserApi | userNew | POST /user | Register a new user. |
| BitMexApi.UserApi | userRequestEnableTFA | POST /user/requestEnableTFA | Get Google Authenticator secret key for setting up two-factor auth. Fails if already enabled. Use /confirmEnableTFA for Yubikeys. |
| BitMexApi.UserApi | userRequestPasswordReset | POST /user/requestPasswordReset | Request a password reset. |
| BitMexApi.UserApi | userRequestWithdrawal | POST /user/requestWithdrawal | Request a withdrawal to an external wallet. |
| BitMexApi.UserApi | userSavePreferences | POST /user/preferences | Save user preferences. |
| BitMexApi.UserApi | userSendVerificationEmail | POST /user/resendVerificationEmail | Re-send verification email. |
| BitMexApi.UserApi | userUpdate | PUT /user | Update your password, name, and other attributes. |
All endpoints do not require authorization.
FAQs
REST_API_for_the_BitMEX_com_trading_platform_brbra_hrefapprestAPIREST_Documentationabra_hrefappwsAPIWebsocket_Documentationa
The npm package bit_mex_api receives a total of 4 weekly downloads. As such, bit_mex_api popularity was classified as not popular.
We found that bit_mex_api demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.