Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deployRefer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-android-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "io.swagger:swagger-android-client:1.0.0"At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/swagger-android-client-1.0.0.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.api.APIKeyApi;
public class APIKeyApiExample {
public static void main(String[] args) {
APIKeyApi apiInstance = new APIKeyApi();
Boolean reverse = false; // Boolean | If true, will sort results newest first.
try {
List<APIKey> result = apiInstance.aPIKeyGet(reverse);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling APIKeyApi#aPIKeyGet");
e.printStackTrace();
}
}
}All URIs are relative to https://www.bitmex.com/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| APIKeyApi | aPIKeyGet | GET /apiKey | Get your API Keys. |
| AddressApi | addressGet | GET /address | Get your addresses. |
| AddressApi | addressNew | POST /address | Creates a new saved address. |
| AnnouncementApi | announcementGet | GET /announcement | Get site announcements. |
| AnnouncementApi | announcementGetUrgent | GET /announcement/urgent | Get urgent (banner) announcements. |
| ChatApi | chatGet | GET /chat | Get chat messages. |
| ChatApi | chatGetChannels | GET /chat/channels | Get available channels. |
| ChatApi | chatGetConnected | GET /chat/connected | Get connected users. |
| ChatApi | chatGetPinnedMessage | GET /chat/pinned | Get pinned message for a channel. |
| ChatApi | chatNew | POST /chat | Send a chat message. |
| ExecutionApi | executionGet | GET /execution | Get all raw executions for your account. |
| ExecutionApi | executionGetTradeHistory | GET /execution/tradeHistory | Get all balance-affecting executions. |
| FundingApi | fundingGet | GET /funding | Get funding history. |
| GlobalNotificationApi | globalNotificationGet | GET /globalNotification | Get your current GlobalNotifications. |
| GuildApi | guildArchive | POST /guild/archive | Archive a guild |
| GuildApi | guildEdit | PUT /guild | Edit guild new guild |
| GuildApi | guildGet | GET /guild | Get all guilds |
| GuildApi | guildJoin | POST /guild/join | Request to Join a private guild or join a public guild |
| GuildApi | guildKick | POST /guild/kick | Kick member from guild |
| GuildApi | guildLeave | POST /guild/leave | Leave guild or cancel guild join request |
| GuildApi | guildNew | POST /guild | Creates a new guild |
| GuildApi | guildShareTrades | POST /guild/shareTrades | Toggle share trades for your account, which controls whether your guild members can see your orders and positions in their UI |
| InstrumentApi | instrumentGet | GET /instrument | Get instruments. |
| InstrumentApi | instrumentGetActive | GET /instrument/active | Get all active instruments and instruments that have expired in <24hrs. |
| 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. |
| InstrumentApi | instrumentGetActiveIntervals | GET /instrument/activeIntervals | Return all active contract series and interval pairs. |
| InstrumentApi | instrumentGetCompositeIndex | GET /instrument/compositeIndex | Show constituent parts of an index. |
| InstrumentApi | instrumentGetIndices | GET /instrument/indices | Get all price indices. |
| InstrumentApi | instrumentGetUsdVolume | GET /instrument/usdVolume | Get a summary of exchange statistics in USD. |
| InsuranceApi | insuranceGet | GET /insurance | Get insurance fund history. |
| LeaderboardApi | leaderboardGet | GET /leaderboard | Get current leaderboard. |
| LeaderboardApi | leaderboardGetName | GET /leaderboard/name | Get your alias on the leaderboard. |
| LiquidationApi | liquidationGet | GET /liquidation | Get liquidation orders. |
| OrderApi | orderAmend | PUT /order | Amend the quantity or price of an open order. |
| OrderApi | orderCancel | DELETE /order | Cancel order(s). Send multiple order IDs to cancel in bulk. |
| OrderApi | orderCancelAll | DELETE /order/all | Cancels all of your orders. |
| OrderApi | orderCancelAllAfter | POST /order/cancelAllAfter | Automatically cancel all your orders after a specified timeout. |
| OrderApi | orderClosePosition | POST /order/closePosition | Close a position. [Deprecated, use POST /order with execInst: 'Close'] |
| OrderApi | orderGetOrders | GET /order | Get your orders. |
| OrderApi | orderNew | POST /order | Create a new order. |
| OrderBookApi | orderBookGetL2 | GET /orderBook/L2 | Get current orderbook in vertical format. |
| PorlApi | porlGetNonce | GET /porl/nonce | Get your Proof of Reserves nonce and data. |
| PorlApi | porlGetSnapshots | GET /porl/snapshots | Get Proof of Reserves historical snapshots |
| PositionApi | positionGet | GET /position | Get your positions. |
| PositionApi | positionIsolateMargin | POST /position/isolate | Enable isolated margin or cross margin per-position. |
| PositionApi | positionTransferIsolatedMargin | POST /position/transferMargin | Transfer equity in or out of a position. |
| PositionApi | positionUpdateLeverage | POST /position/leverage | Choose leverage for a position. |
| PositionApi | positionUpdateRiskLimit | POST /position/riskLimit | Update your risk limit. |
| QuoteApi | quoteGet | GET /quote | Get Quotes. |
| QuoteApi | quoteGetBucketed | GET /quote/bucketed | Get previous quotes in time buckets. |
| SchemaApi | schemaGet | GET /schema | Get model schemata for data objects returned by this API. |
| SchemaApi | schemaWebsocketHelp | GET /schema/websocketHelp | Returns help text & subject list for websocket usage. |
| SettlementApi | settlementGet | GET /settlement | Get settlement history. |
| StatsApi | statsGet | GET /stats | Get exchange-wide and per-series turnover and volume statistics. |
| StatsApi | statsHistory | GET /stats/history | Get historical exchange-wide and per-series turnover and volume statistics. |
| StatsApi | statsHistoryUSD | GET /stats/historyUSD | Get a summary of exchange statistics in USD. |
| TradeApi | tradeGet | GET /trade | Get Trades. |
| TradeApi | tradeGetBucketed | GET /trade/bucketed | Get previous trades in time buckets. |
| UserApi | userCancelPendingWithdrawal | DELETE /user/withdrawal | Cancel pending withdrawal |
| UserApi | userCancelWithdrawal | POST /user/cancelWithdrawal | Cancel a withdrawal. |
| UserApi | userCheckReferralCode | GET /user/checkReferralCode | Check if a referral code is valid. |
| UserApi | userCommunicationToken | POST /user/communicationToken | Register your communication token for mobile clients |
| UserApi | userConfirm | POST /user/confirmEmail | Confirm your email address with a token. |
| UserApi | userConfirmWithdrawal | POST /user/confirmWithdrawal | Confirm a withdrawal. |
| UserApi | userCreateSubAccount | POST /user/addSubaccount | Creates a new sub-account. |
| UserApi | userCreateUnstakingRequests | POST /user/unstakingRequests | Create unstaking request |
| UserApi | userDeleteUnstakingRequests | DELETE /user/unstakingRequests | Cancel unstaking request |
| UserApi | userGet | GET /user | Get your user model. |
| UserApi | userGetAffiliateStatus | GET /user/affiliateStatus | Get your current affiliate/referral status. |
| UserApi | userGetCSA | GET /user/csa | Get your account's CSA status. |
| UserApi | userGetCommission | GET /user/commission | Get your account's commission status. |
| UserApi | userGetDepositAddress | GET /user/depositAddress | Get a deposit address. |
| UserApi | userGetDepositAddressInformation | GET /user/depositAddressInformation | Get a deposit address. |
| UserApi | userGetExecutionHistory | GET /user/executionHistory | Get the execution history by day. |
| UserApi | userGetMargin | GET /user/margin | Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies. |
| UserApi | userGetQuoteFillRatio | GET /user/quoteFillRatio | Get 7 days worth of Quote Fill Ratio statistics. |
| UserApi | userGetQuoteValueRatio | GET /user/quoteValueRatio | Get Quote Value Ratio statistics over the last 3 days |
| UserApi | userGetStaking | GET /user/staking | Get the current user staking amount. |
| UserApi | userGetStakingInstruments | GET /user/staking/instruments | List staking instruments |
| UserApi | userGetStakingTiers | GET /user/staking/tiers | List staking tiers for a given currency |
| UserApi | userGetTradingVolume | GET /user/tradingVolume | Get your 30 days USD average trading volume |
| UserApi | userGetUnstakingRequests | GET /user/unstakingRequests | Get the current user unstaking requests |
| UserApi | userGetWallet | GET /user/wallet | Get your current wallet information. |
| UserApi | userGetWalletHistory | GET /user/walletHistory | Get a history of all of your wallet transactions (deposits, withdrawals, PNL). |
| UserApi | userGetWalletSummary | GET /user/walletSummary | Get a summary of all of your wallet transactions (deposits, withdrawals, PNL). |
| UserApi | userGetWalletTransferAccounts | GET /user/getWalletTransferAccounts | Get the list of accounts you can transfer funds between. |
| UserApi | userLogout | POST /user/logout | Log out of BitMEX. |
| UserApi | userRequestWithdrawal | POST /user/requestWithdrawal | Request a withdrawal to an external wallet. |
| UserApi | userSavePreferences | POST /user/preferences | Save user preferences. |
| UserApi | userUpdateSubAccount | POST /user/updateSubaccount | Updates the sub-account name. |
| UserApi | userWalletTransfer | POST /user/walletTransfer | Execute a transfer to a paired account. |
| UserAffiliatesApi | userAffiliatesGet | GET /userAffiliates | Get user's affiliates to a given depth |
| UserEventApi | userEventGet | GET /userEvent | Get your user events |
| WalletApi | walletGetAssetsConfig | GET /wallet/assets | Get Assets Config |
| WalletApi | walletGetNetworksConfig | GET /wallet/networks | Get Networks Config |
- APIKey
- AccessToken
- Address
- Affiliate
- Announcement
- AssetsConfig
- AssetsConfigNetworkItem
- Chat
- ChatChannel
- CollateralSupportAgreement
- CommunicationToken
- ConnectedUsers
- DepositAddress
- Error
- ErrorError
- Execution
- Funding
- GlobalNotification
- Guild
- IndexComposite
- InlineResponse200
- Instrument
- InstrumentInterval
- Insurance
- Leaderboard
- Liquidation
- Margin
- NetworksConfig
- Order
- OrderBookL2
- PinnedMessage
- Porl
- Position
- Quote
- QuoteFillRatio
- QuoteValueRatio
- Settlement
- StakingRecord
- Stats
- StatsHistory
- StatsUSD
- StatsUSDBySymbol
- Trade
- TradeBin
- TradingVolume
- Transaction
- User
- UserCommissionsBySymbol
- UserEvent
- UserPreferences
- Wallet
- WalletSummaryRecord
- XAny
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: api-expires
- Location: HTTP header
- Type: API key
- API key parameter name: api-key
- Location: HTTP header
- Type: API key
- API key parameter name: api-signature
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.