All URIs are relative to https://www.bitmex.com/api/v1
Method | HTTP request | Description |
---|---|---|
instrumentGet | GET /instrument | Get instruments. |
instrumentGetActive | GET /instrument/active | Get all active instruments and instruments that have expired in <24hrs. |
instrumentGetActiveAndIndices | GET /instrument/activeAndIndices | Helper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active. |
instrumentGetActiveIntervals | GET /instrument/activeIntervals | Return all active contract series and interval pairs. |
instrumentGetCompositeIndex | GET /instrument/compositeIndex | Show constituent parts of an index. |
instrumentGetIndices | GET /instrument/indices | Get all price indices. |
List<Instrument> instrumentGet(symbol, filter, columns, count, start, reverse, startTime, endTime)
Get instruments.
This returns all instruments and indices, including those that have settled or are unlisted. Use this endpoint if you want to query for individual instruments or use a complex filter. Use `/instrument/active` to return active instruments, or use a filter like `{"state": "Open"}`.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
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`.
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.
BigDecimal count = new BigDecimal(); // BigDecimal | Number of results to fetch.
BigDecimal start = new BigDecimal(); // BigDecimal | 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<Instrument> result = apiInstance.instrumentGet(symbol, filter, columns, count, start, reverse, startTime, endTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGet");
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`. | [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 | BigDecimal | Number of results to fetch. | [optional] [default to 100] |
start | BigDecimal | 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] |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
List<Instrument> instrumentGetActive()
Get all active instruments and instruments that have expired in <24hrs.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
try {
List<Instrument> result = apiInstance.instrumentGetActive();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGetActive");
e.printStackTrace();
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
List<Instrument> instrumentGetActiveAndIndices()
Helper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
try {
List<Instrument> result = apiInstance.instrumentGetActiveAndIndices();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGetActiveAndIndices");
e.printStackTrace();
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
InstrumentInterval instrumentGetActiveIntervals()
Return all active contract series and interval pairs.
This endpoint is useful for determining which pairs are live. It returns two arrays of strings. The first is intervals, such as `["XBT:perpetual", "XBT:quarterly", "XBT:biquarterly", "ETH:quarterly", ...]`. These identifiers are usable in any query's `symbol` param. The second array is the current resolution of these intervals. Results are mapped at the same index.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
try {
InstrumentInterval result = apiInstance.instrumentGetActiveIntervals();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGetActiveIntervals");
e.printStackTrace();
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
List<IndexComposite> instrumentGetCompositeIndex(symbol, filter, columns, count, start, reverse, startTime, endTime)
Show constituent parts of an index.
Composite indices are built from multiple external price sources. Use this endpoint to get the underlying prices of an index. For example, send a `symbol` of `.XBT` to get the ticks and weights of the constituent exchanges that build the ".XBT" index. A tick with reference `"BMI"` and weight `null` is the composite index tick.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
String symbol = ".XBT"; // String | The composite index symbol.
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.
BigDecimal count = new BigDecimal(); // BigDecimal | Number of results to fetch.
BigDecimal start = new BigDecimal(); // BigDecimal | 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<IndexComposite> result = apiInstance.instrumentGetCompositeIndex(symbol, filter, columns, count, start, reverse, startTime, endTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGetCompositeIndex");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | The composite index symbol. | [optional] [default to .XBT] |
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 | BigDecimal | Number of results to fetch. | [optional] [default to 100] |
start | BigDecimal | 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] |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
List<Instrument> instrumentGetIndices()
Get all price indices.
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.InstrumentApi;
InstrumentApi apiInstance = new InstrumentApi();
try {
List<Instrument> result = apiInstance.instrumentGetIndices();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstrumentApi#instrumentGetIndices");
e.printStackTrace();
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript