All URIs are relative to https://www.bitmex.com/api/v1
Method | HTTP request | Description |
---|---|---|
executionGet | GET /execution | Get all raw executions for your account. |
executionGetTradeHistory | GET /execution/tradeHistory | Get all balance-affecting executions. |
List<Execution> executionGet(symbol, filter, columns, count, start, reverse, startTime, endTime)
Get all raw executions for your account.
This returns all raw transactions, which includes order opening and cancelation, and order status changes. It can be quite noisy. More focused information is available at `/execution/tradeHistory`. You may also use the `filter` param to target your query. Specify an array as a filter value, such as `{"execType": ["Settlement", "Trade"]}` to filter on multiple values. See the FIX Spec for explanations of these fields.
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ExecutionApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apiExpires
ApiKeyAuth apiExpires = (ApiKeyAuth) defaultClient.getAuthentication("apiExpires");
apiExpires.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.setApiKeyPrefix("Token");
// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");
ExecutionApi apiInstance = new ExecutionApi();
String symbol = "symbol_example"; // String | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive.
String filter = "filter_example"; // String | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details.
String columns = "columns_example"; // String | Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect.
Integer count = 100; // Integer | Number of results to fetch. Must be a positive integer.
Integer start = 0; // Integer | Starting point for results.
Boolean reverse = false; // Boolean | If true, will sort results newest first.
OffsetDateTime startTime = OffsetDateTime.now(); // OffsetDateTime | Starting date filter for results.
OffsetDateTime endTime = OffsetDateTime.now(); // OffsetDateTime | Ending date filter for results.
try {
List<Execution> result = apiInstance.executionGet(symbol, filter, columns, count, start, reverse, startTime, endTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ExecutionApi#executionGet");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. | [optional] |
filter | String | Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. | [optional] |
columns | String | Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. | [optional] |
count | Integer | Number of results to fetch. Must be a positive integer. | [optional] [default to 100] |
start | Integer | Starting point for results. | [optional] [default to 0] |
reverse | Boolean | If true, will sort results newest first. | [optional] [default to false] |
startTime | OffsetDateTime | Starting date filter for results. | [optional] |
endTime | OffsetDateTime | Ending date filter for results. | [optional] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
List<Execution> executionGetTradeHistory(targetAccountId, targetAccountIds, symbol, filter, columns, count, start, reverse, startTime, endTime)
Get all balance-affecting executions.
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.ExecutionApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apiExpires
ApiKeyAuth apiExpires = (ApiKeyAuth) defaultClient.getAuthentication("apiExpires");
apiExpires.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.setApiKeyPrefix("Token");
// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");
ExecutionApi apiInstance = new ExecutionApi();
Double targetAccountId = 3.4D; // Double | AccountId fetching the trade history, must be a paired account with main user.
String targetAccountIds = "targetAccountIds_example"; // String | AccountIds fetching the trade history, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user
String symbol = "symbol_example"; // String | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive.
String filter = "filter_example"; // String | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details.
String columns = "columns_example"; // String | Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect.
Integer count = 100; // Integer | Number of results to fetch. Must be a positive integer.
Integer start = 0; // Integer | Starting point for results.
Boolean reverse = false; // Boolean | If true, will sort results newest first.
OffsetDateTime startTime = OffsetDateTime.now(); // OffsetDateTime | Starting date filter for results.
OffsetDateTime endTime = OffsetDateTime.now(); // OffsetDateTime | Ending date filter for results.
try {
List<Execution> result = apiInstance.executionGetTradeHistory(targetAccountId, targetAccountIds, symbol, filter, columns, count, start, reverse, startTime, endTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ExecutionApi#executionGetTradeHistory");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
targetAccountId | Double | AccountId fetching the trade history, must be a paired account with main user. | [optional] |
targetAccountIds | String | AccountIds fetching the trade history, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user | [optional] |
symbol | String | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. | [optional] |
filter | String | Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. | [optional] |
columns | String | Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. | [optional] |
count | Integer | Number of results to fetch. Must be a positive integer. | [optional] [default to 100] |
start | Integer | Starting point for results. | [optional] [default to 0] |
reverse | Boolean | If true, will sort results newest first. | [optional] [default to false] |
startTime | OffsetDateTime | Starting date filter for results. | [optional] |
endTime | OffsetDateTime | Ending date filter for results. | [optional] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript