The exchange API is located at https://bitnomial.com/exchange/api/v1/
. For the production API, the
full path is https://bitnomial.com/exchange/api/v1/prod
. For the sandbox API, the full path is
https://bitnomial.com/exchange/api/v1/sandbox
.
The exchange API is separated into two categories:
The exchange API is rate-limited to 200 requests per 5 minutes. If you go over this rate, you will start to receive HTTP 403 responses.
The product API is publicly available and provides information and specs for all products at the
exchange. Its base url is: https://bitnomial.com/exchange/api/v1/prod/product
.
The product data API has the following endpoints:
GET /data/
, which returns a list of all product data objects for each product in the
systemGET /data/:product_id
where :product_id
is the product ID for a given product, returning only the
product data for the given product.GET /specs/
, which returns a list of all product spec objects for each product in the
systemGET /spec/:product_id
, where :product_id
is the product ID for a given product, returning only the
spec for the given productEach of these endpoints supports the following flags:
day
, show products only for that given day, the current day is used if this is not supplied.active=true
, filter products only to active products, active=false
has the same behavior as
omitting the flag altogether.base_symbol
, show only products that share a given base symbolProduct Data objects have the following TS type:
export interface ProductData {
product_id: number;
last_price_time: string | null;
last_price: number | null;
settlement_time: string | null;
settlement_price: number | null;
settlement_price_comment: string | null;
open_price: number | null;
high_price: number | null;
low_price: number | null;
close_price: number | null;
price_change: number | null;
volume: number | null;
notional_volume: number | null;
block_volume: number | null;
notional_block_volume: number | null;
price_limit_upper: number;
price_limit_lower: number;
open_interest: number | null;
open_interest_change: number | null;
}
The Product Spec objects have the following TS type
export type ProductSpec = IFutureSpec | ISpreadSpec | IOptionSpec;
export type IFutureSpec = ProductFutureSpec;
export type ISpreadSpec = ProductSpreadSpec;
export type IOptionSpec = ProductOptionSpec;
export type ProductStatus = "active" | "forthcoming" | "expired";
export interface ProductFutureSpec {
type: string;
product_id: number;
product_name: string;
margin_unit: string;
settlement_method: string;
max_order_quantity: number;
min_block_size: number;
contract_size: number;
contract_size_unit: string;
price_increment: number;
price_quotation_unit: string;
price_band_variation: number;
price_limit_percentage: number;
first_trading_day: string;
final_settle_time: string;
daily_open_time: string;
daily_settle_time: string;
symbol: string;
month: number;
year: number;
base_symbol: string;
cqg_symbol: string;
product_status: ProductStatus;
}
export interface ProductSpreadSpec {
type: string;
product_id: number;
product_name: string;
max_order_quantity: number;
min_block_size: number;
price_band_variation: number;
price_limit_percentage: number;
first_trading_day: string;
final_settle_time: string;
daily_open_time: string;
daily_settle_time: string;
symbol: string;
base_symbol: string;
price_increment: number;
cqg_symbol: string;
product_status: ProductStatus;
legs: SpreadSpecLeg[];
}
export interface SpreadSpecLeg {
product_id: number;
weight: number;
}
export interface ProductOptionSpec {
type: string;
product_id: number;
product_name: string;
max_order_quantity: number;
min_block_size: number;
price_band_variation: number;
price_limit_percentage: number;
first_trading_day: string;
final_settle_time: string;
daily_open_time: string;
daily_settle_time: string;
symbol: string;
cqg_symbol: string;
underlying_product: number;
strike_price: number;
base_symbol: string;
price_increment: number;
option_type: string;
product_status: ProductStatus;
}
The following are the fields provided in the product data API. This data comes from sources such as the settlement process ran each day or live market activity. The settlement process is usually ran between 2:30 and 3:00 PM CT, or within 30 minutes of the daily settle time of the respective field for that process.
volume
, open_interest
, and open_interest_change
have their own semantics. They are updated by
8:30 AM the following day. Those values will be null until they are published.
Field | Notes |
---|---|
product_id | The product ID for a given product |
last_price_time | The time of the last trade, updated live |
last_price | The price of the last trade, updated live |
settlement_time | The time that the settlement process was ran, updated by the settlement process |
settlement_price | Settlement price, updated by the settlement process. When the product has expired this is the final settlement price. |
settlement_price_comment | Settlement price comment, updated by the settlement process |
open_price | Open price, updated live as the price of the first trade of the day |
high_price | High price, updated live as the highest price of a trade for the day |
low_price | Low price, updated live as the lowest price of a trade for the day |
close_price | Close price, updated by the settlement process |
price_change | Price change computed as either the percentage change between the last_price and settlement_price , or, if there are no trades on the day, the percentage change between the last two settlement prices. |
volume | Trade volume, fetched from the clearing house, during trading it is updated live |
notional_volume | Notional trade volume, fetched from the clearing house, during trading it is updated live |
price_limit_upper | The upper price limit for the product |
price_limit_lower | The lower price limit for the product |
open_interest | Open interest, fetched from the clearing house |
open_interest_change | Open interest change in number of contracts day over day. Positive for increases, negative for decreases. |
The following are the fields provided in the product spec API. These fields are mostly static, they do not change day to day. The changes seen through this API will be new contract listings near the end of a given quarter. If there are other changes, such as to market hours, customers will be notified well in advance of API changes.
The increment of price_band_variation is expressed in terms of the price_quotation_unit field.
Field | Product Types | Notes |
---|---|---|
product_id | All | Product ID |
product_name | All | Product name |
max_order_quantity | All | Max order quantity |
min_block_size | All | Minimum block size |
price_band_variation | All | Price band variation |
price_limit_percentage | All | Price limit percentage |
type | All | Product type, either “future” or “spread” or “option” |
first_trading_day | All | First trading day |
final_settle_time | All | Final settle time |
daily_open_time | All | Daily open time |
daily_settle_time | All | Daily settle time |
symbol | All | Bitnomial product symbol |
cqg_symbol | All | CQG product symbol (for use on CQG IC/Desktop) |
product_status | All | Product status, either “active” or “forthcoming” or “expired” |
legs | Spread | Legs for a given spread product, with “product_id” and “weight” fields |
underlying_product | Option | Product ID of the underlying product |
strike_price | Option | Option strike price |
option_type | Option | Option type, either call or put |
margin_unit | Future | Margin unit |
settlement_method | Future | Settlement method |
contract_size | Future | Contract size |
contract_size_unit | Future | Contract size unit |
price_increment | Future | Price increment |
price_quotation_unit | Future | Price quotation unit |
month | Future | Contract month |
year | Future | contract year |
base_symbol | Future | Contract base symbol |
The orders API contains private endpoints for querying order state. Requires a base64-encoded SHA256 HMAC signature as defined in Exchange API Authentication.
The endpoint is available at the URL /exchange/api/v1/<env>/orders
, where <env>
is either
sandbox
or prod
.
The endpoint supports the following query parameters:
Parameter | Notes |
---|---|
symbol |
Filter orders by product symbol, only works in production |
product_id |
Filter orders by product ID, only works in production |
product_type |
Filter orders by product type, only works in production |
clearing_firm_code |
Filter orders by clearing firm code, only works in production |
account_id |
Filter orders by account code, only works in production |
connection_id |
Filter orders by connection ID, only works in production |
day |
Get range for day, overrides begin_time and end_time |
limit |
Limit number of orders per page |
begin_time |
Begin time for order time range, see time for more details |
end_time |
End time for order time range, see time for more details |
order |
Page order, either asc or desc |
cursor |
Cursor string for paginated query |
The endpoint returns a pagination response of the type Pagination<Order, CursorInfo>
. More details
on paginated APIs can be found in Exchange HTTP API Pagination.
Order
is defined as follows:
export interface Order {
symbol: string;
product_id: number;
product_type: ProductType;
id: string;
connection_id: string;
clearing_firm_code: string;
account_id: string;
open_ack_id: string;
side: Side;
price: number;
quantity_requested: number;
quantity_filled: number;
status: OrderStatus;
time_in_force: TimeInForce;
}
export type ProductType = "Future" | "Spread" | "Option";
export type Side = 'Bid' | 'Ask';
export type OrderStatus = 'Working' | 'Closed';
export type TimeInForce = 'IOC' | 'Day' | 'GTC';
The fills API contains private endpoints for querying order fills. It requires a Base64-encoded SHA256 HMAC signature as defined in Exchange API Authentication.
The endpoint is available at the URL /exchange/api/v1/<env>/fills
, where <env>
is either sandbox
or prod
.
The endpoint supports the following query parameters:
Parameter | Notes |
---|---|
symbol |
Filter fills by product symbol, only works in production |
product_id |
Filter fills by product ID, only works in production |
product_type |
Filter fills by product type, only works in production |
clearing_firm_code |
Filter fills by clearing firm code, only works in production |
account_id |
Filter fills by account code, only works in production |
connection_id |
Filter fills by connection ID, only works in production |
day |
Get range for day, overrides begin_time and end_time |
limit |
Limit number of fills per page |
begin_time |
Begin time for fill time range, see time for more details |
end_time |
End time for fill time range, see time for more details |
order |
Page order, either asc or desc |
cursor |
Cursor string for paginated query |
The endpoint returns a pagination response of the type Pagination<Fill, CursorInfo>
. More details
on paginated APIs can be found in Exchange HTTP API Pagination.
Fill
is defined as follows:
export interface Fill {
symbol: string;
product_id: number;
product_type: ProductType;
order_id: string;
clearing_firm_code: string;
time: string;
connection_id: string;
account_id: string;
ack_id: string;
side: Side;
price: number;
quantity_requested: number;
quantity_filled: number;
liquidity: Liquidity;
}
export type Liquidity = "Add" | "Remove" | "SpreadLeg";
export type Side = "Bid" | "Ask";
export type ProductType = "Future" | "Spread" | "Option";
The block trades API contains private endpoints for querying block trades. It requires a Base64-encoded SHA256 HMAC signature as defined in Exchange API Authentication.
The endpoint is available at the URL /exchange/api/v1/<env>/block-trades
, where <env>
is either sandbox
or prod
.
The endpoint supports the following query parameters:
Parameter | Notes |
---|---|
symbol |
Filter by product symbol, only works in production |
product_id |
Filter by product ID, only works in production |
product_type |
Filter by product type, only works in production |
clearing_firm_code |
Filter by clearing firm code, only works in production |
account_id |
Filter by account code, only works in production |
connection_id |
Filter by connection ID, only works in production |
status |
Block trade status filter |
day |
Get range for day, overrides begin_time and end_time |
limit |
Limit number of block trades per page |
begin_time |
Begin time for block trade execution time range, see time for more details |
end_time |
End time for block trade execution time range, see time for more details |
order |
Page order, either asc or desc |
cursor |
Cursor string for paginated query |
The endpoint returns a pagination response of the type Pagination<BlockTrade, CursorInfo>
. More details
on paginated APIs can be found in Exchange HTTP API Pagination.
BlockTrade
is defined as follows:
For more information on block trades, see here. For specifics on the status of a block trade, see here.
export interface BlockTrade {
account_id: string;
block_trade_id: number;
counterparty_id: string;
counterparty_email: string | null;
symbol: string;
side: Side;
price: number;
product_id: number;
quantity: number;
exec_time: string;
report_time: string;
status: BlockTradeStatus;
status_reason: string | null;
status_time: string | null;
}
export type BlockTradeStatus = 'Pending' | 'Canceled' | 'Rejected' | 'Confirmed' | 'Accepted';
The index API is publicly available and provides data for all indexes at the exchange. Its base url
is: https://bitnomial.com/exchange/api/v1/index
.
The GET /hashrate/data/
endpoint returns a list of all hashrate data within a specified time range.
Hashrate data is available going back to 2024-04-27
.
The endpoint supports the following query parameters:
Parameter | Notes |
---|---|
limit |
Limit number of hashrate datapoints per page |
begin_time |
Begin time for hashrate data, see time for more details |
end_time |
End time for hashrate data, see time for more details |
order |
Page order, either asc or desc |
cursor |
Cursor string for paginated query |
And returns a pagination response of the type Pagination<string[], CursorInfo>
. More details
on paginated APIs can be found in Exchange HTTP API Pagination.
The schema for the hashrate data array is [timestamp, price]
, where timestamp is an ISO 8601 string
and price is in US Dollar Cents.