Markets BitstampBitfinexTicket to da moon. My hodlings. Fiat equivalent $ Cheapest and fastest fee per byte Blockchain Explorer API. Bitcoinfees Github View on Github. Donation. You can also help the hodler coaster guy reach the moon. XRP/BTC: +% ₮ 16 Robot-friendly API. Fees. Pay only % on every market trade and benefit from a % rebate on LP orders. Support. By your side 24 hours a day, our support team will assist you with any issue or question you may have. Api. BTC Markets is proud to announce the launch of the latest update to our API, releasing our much-anticipated v3. Why API v3 We have developed the new generation of APIs with the intention of providing a better experience for traders, market makers, and institutions to build and operate their applications.
Btc markets api githubaffcrypto.de API v1 Reference
Options: global , local , crypto , tokens , light. Options: global , local , crypto , tokens symbol True Full currency pair symbol. If only crypto parameter is sent, then all symbols beginning with that cryptocurrency are returned. Options: global , local crypto False Filters repsonse by supplied crypto currency. Example: BTC. Accepts comma separated values fiat False Filters repsonse by supplied fiat currency. Example: USD.
If only base parameter is sent, then all symbols beginning with any of the base cryptocurrencies are returned. If only target parameter is sent, then all symbols ending with any of the target currencies are returned. If both base and target parameters are sent, then only the symbols that both start with the base cryptocurrencies and end with the target cryptocurrencies are returned.
Options: crypto , tokens base False Filters repsonse by supplied base cryptocurrency. Accepts comma separated values target False Filters response by supplied target cryptocurrency.
Options: include or exclude exchanges True A comma seperated list of exchanges. Historical Data Improvement to the History Data API Previously our history API automatically returned minute data when your request timestamp was within 24h period, afterwards it automatically moved to hour data from 1 day to 30 days and then provided day data when the timestamp exceeded 30 days in the past.
Api call credits This endpoint can return well over data points and can spend more than one API call credit. History limits by plan The history API endpoints will return different data size depending on your plan. Options: minute , hour , day format False Response format.
Options: json , csv Period parameter minute - returns price data in minute intervals. Example: resolution True Possible values: minute , hour , day.
Resolution Depending on the resolution parameter you will receive that in minute, hour or day resolution. Exchange Data The endpoints in this section provide real-time exchange data and other metrics. Accepts one or more comma separated values.
Accepts one or more comma seperated values. Example: bitstamp market True Name of the market. Currently this endpoint only supports BTC currency symbols. Example: 8a3bbaa9e2b0bbf3ccdeabcdc35ecff Websocket API Deprecated Overview The websocket feed provides real-time market data for price indices and exchanges. The ticket can only be used once. Channels After authentication is complete the websocket connection is established, you may then subscribe to the required channel.
The unsubscribe message automatically closes the websocket connection. Every time you send a new subscription message, the requested currency is added to the response.
Every time you send a new subscription message, the requested exchange is added to the response. Data Frequency Updates are pushed in real time, so they depend on the activity of the markets. Authentication The procedure for authenticating these websocket connections is the same as in version 1 except the urls are changed.
Step 1. Channels After authentication is complete the websocket connection is established, you may then send your subscription message to the channel.
Plan Connections limit Ticker symbols Exchanges symbols Grow 10 Dominate 20 Data Frequency Updates are pushed in real time, so they depend on the activity of the markets. Authentication Step 1. The ticket can be used once. You need to generate new ticket for every connection.
Channels After the websocket connection is established you may send your subscription message to specify the channel and the subscription options. There are 4 channels: ticker, exchanges, orderbooks and tradebooks.
Ticker This channel returns ticker data for multiple symbols grouped in symbol sets. If the response is of type snapshot then store the arrays of bids buy orders and asks sell orders. Otherwise the respnose is of type update. Iterate the update array from the response and update the orderbook. If the amount is 0 then remove that price level from the orderbook.
If the amount is greater than 0 then update the price level. In this example we're using our npm package that can be installed with: npm install bitcoinaverage Exchanges Trade Data This channel returns trade data for one or more symbols from a single exchange.
Try again later. Please try again later. This set provides global symbols that are derived from the Local currency markets. This set includes Cryptocurrencies that are actively traded to a fiat currency on an exchange. This set includes any Token that is not in itself a coin or crypto , and instead resides on top of another blockchain such as Ethereum.
Specify only year and month for hour candles. The response model is the same. There are no further breaking changes planned. Keep in mind the following: Enable 2FA on your account. Example Value: xxxxxxxxed05xxxxxxxxxx Api-Timestamp Populate this header with the current time as a UNIX timestamp, in epoch-millisecond format. SHA content. Hex ; Example Value: cf83eeefb8bdfd66ddebdc83f4ad36ce9ce47d0d13c5d85f2b0ffdeec2f63bbda81aafda3e Api-Subaccount-Id Only for subaccount feature NOTE: This functionality is limited to partners and unavailable to general traders.
If you wish to make a request on behalf of a subaccount, you will need to: Authenticate using all 4 of the headers above referring to your master account.
The specified subaccount must be a subaccount of the master account used to authenticate the request. Include the Api-Subaccount-Id header at the end of the pre-signed signature, as indicated in the next section.
Arguments: pageSize optional : A limit on the number of objects to be returned between 1 and , defaults to nextPageToken optional : The id of the last item on the current page.
Order Types Market Order : An order to buy or sell a specified quantity of an asset immediately at the best available price. Note: If the order is not a maker order, you will return an error and the order will be cancelled Conditional Order : A directive for the system to place an order on your behalf when the price on the market moves past a given threshold.
Order types and time in force The following table shows which time in force options apply to which order types. Placing Conditional Orders Conditional orders are placed using this API by specifying the market price trigger conditions and what action to take when the trigger is reached.
Trigger conditions The trigger for a conditional order is made up of two parts: the operand and the trigger price or percentage. The general flow of information to check is: status code of the response. See the error code and response data for more details. Please make sure to implement exponential backoff with your requests. C : V3WebsocketExample. ComputeHash Encoding.
GetBytes data ; return BitConverter. ToString hash. Replace "-" , string. CopyTo decompressedStream ; decompressedStream. To ensure you have the most recent data, and have not missed anything, the recommended sequence of steps is to: Subscribe to the relevant socket streams Begin to queue up messages without processing them Call the equivalent v3 REST API and record both the results and the value of the returned Sequence header.
For example, orderbook snapshots of different depths will have different sequence numbers. If the Sequence header is less than the sequence number of the first queued socket message received unlikely , discard the results of step 3 and then repeat step 3 until this check passes. Discard all socket messages where the sequence number is less than or equal to the Sequence header retrieved from the REST call Apply the remaining socket messages in order on top of the results of the REST call.
Each socket delta is a snapshot of an object. The identity of the object is defined by a unique key made up of one or more fields in the message see documentation of individual streams for details.
To apply socket deltas to a local cache of data, simply replace the objects in the cache with those coming from the socket where the keys match. Continue to apply messages as they are received from the socket as long as sequence number on the stream is always increasing by 1 each message Note: for private streams, the sequence number is scoped to a single account or subaccount.
If a message is received that is not the next in order, return to step 2 in this process For applications that depend on keeping the stream of data as reliable as possible, creating multiple socket connections for redundancy is recommended.
NOTE: This functionality is limited to partners and unavailable to general traders. Authenticated Account. Get 30 day volume for account. Get trading permissions. Get trading permissions for a single market. Get currency permissions. Get currency permissions for a single currency. Authenticated Addresses. List deposit addresses that have been requested or provisioned.
Authenticated Balances. Get sequence of balances snapshot. Authenticated Batch. List of operations in the batch BatchOperation. Authenticated ConditionalOrders. Retrieve information on a specific conditional order. Cancel a conditional order.
List open conditional orders. Get sequence of open conditional orders snapshot. Create a new conditional order. List currencies. Retrieve info on a specified currency. Authenticated Deposits. Get open deposits sequence. Retrieves all deposits for this account with the given TxId.
Retrieve information for a specific deposit. Authenticated Executions. Gets sequence number and last execution id. Get sequence number for executions. List markets. List summaries of the last 24 hours of activity for all markets. Retrieve the current sequence number for the market summaries snapshot. List tickers for all markets. Retrieve the current sequence number for the tickers snapshot. Retrieve the ticker for a specific market. Retrieve information for a specific market. Retrieve summary of the last 24 hours of activity for a specific market.
Retrieve the order book for a specific market. Retrieve the current sequence number for the specified market's order book snapshot. Retrieve the recent trades for a specific market.
Retrieve the current sequence number for the specified market's recent trades snapshot. Retrieve the current sequence number for the specified market's candles snapshot. Authenticated Orders. List open orders. Bulk cancel all open orders can be limited to a specified market. Get sequence of open orders snapshot. Retrieve information on a specific order. Cancel an order. Create a new order. Pings the service. Authenticated Subaccounts. Authenticated Transfers. Executes a new transfer.
Authenticated Withdrawals. Retrieves all withdrawals for this account with the given TxId. Retrieve information on a specified withdrawal. Create a new withdrawal. Returns a list of allowed addresses. Authenticate Authenticates the current connection using an API key.
IsAuthenticated Determines if the current connection is authenticated. True if the connection is authenticated, false otherwise. Subscribe Subscribes to one or more data streams. Unsubscribe Unsubscribes from one or more data streams. Candle Sends a message at the start of each candle based on the subscribed interval and when trades have occurred on the market. Deposit Sends a message when a new deposit is detected or its status changes.
Heartbeat Sends an empty message on an interval currently 5 seconds. Message schema "Heartbeat messages contain no payload". Market Summaries Provides regular updates of the current market summary data for all markets. Market Summary Provides regular updates of the current market summary data for a given market.
Orderbook Sends a message when there are changes to the order book within the subscribed depth. Tickers Sends a message with the best bid price, best ask price, and last trade price for all markets as there are changes to the order book or trades.
Ticker Sends a message with the best bid and ask price for the given market as well as the last trade price whenever there is a relevant change to the order book or a trade.
Trade Sends a message with the quantity and rate of trades on a market as they occur. Account subaccountId: string uuid the subaccount ID associated with this request if one was specified in the header optional accountId: string uuid The account ID associated with this request only for master accounts.
AccountVolume updated: string date-time Date and time indicating as when volume was updated volume30days: number double 30 day volume information. MarketPolicy symbol: string unique ID for the market this policy is associated with view: boolean true if the current user should be shown information about this market buy: boolean true if the current user can place buy orders on this market sell: boolean true if the current user can place sell orders on this market.
CurrencyPolicy symbol: string unique ID for the currency this policy is associated with view: boolean true if the current user should be shown information about this currency deposit: DepositMethods methods for depositing this currency withdraw: WithdrawMethods methods for withdrawing this currency. DepositMethods blockchain: boolean true if the current user can deposit this currency via blockchain transaction creditCard: boolean true if the current user can deposit this currency via credit card wireTransfer: boolean true if the current user can deposit this currency via wire transfer.
WithdrawMethods blockchain: boolean true if the current user can withdraw this currency via blockchain transaction wireTransfer: boolean true if the current user can withdraw this currency via wire transfer.
NewAddress currencySymbol: string the currency ID to provision a new address for. Balance currencySymbol: string unique ID for the currency this balance is associated with total: number double total amount available: number double available amount updatedAt: string date-time time stamp when this balance was last updated.
BatchResponse Base class for batch response status: integer int32 status code of this batch operation payload: object Detailed results for this operation. PaginationParameters nextPageToken: string The unique identifier of the item that the resulting query result should start after, in the sort order of the given endpoint.
DateFilter startDate: string date-time optional Filters out results before this timestamp. Execution id: string uuid unique ID of this execution, assigned by the service marketSymbol: string market symbol where this execution took place executedAt: string date-time time when the execution was processed quantity: number double quantity traded during this execution rate: number double rate at which this trade was executed orderId: string uuid order ID associated with this execution commission: number double commission charged for this execution isTaker: boolean true if the order ID specified was the taker for this execution, otherwise false.
ExecutionLastId lastId: string uuid last lot id for the user. Market symbol: string unique symbol for this market baseCurrencySymbol: string unique symbol for base currency quoteCurrencySymbol: string unique symbol for quote currency minTradeSize: number double minimum trade size precision: integer int32 maximum allowed precision for the limit price on an order status: string ONLINE , OFFLINE true if this market is currently active createdAt: string date-time timestamp in UTC when this market was created notice: string notice or alert info prohibitedIn: string list of prohibited regions.
MarketSummary symbol: string unique symbol for this market high: number double highest price of a trade that occurred within the last 24 hours or zero if there were no trades low: number double lowest price of a trade that occurred within the last 24 hours or zero if there were no trades volume: number double volume within the last 24 hours quoteVolume: number double quote volume within the last 24 hours percentChange: number double percentage change of the exchange rate over the last 24 hours positive or negative updatedAt: string date-time timestamp in UTC when market summary was last updated.
Ticker symbol: string unique symbol for this market lastTradeRate: number double price of the last trade or zero if there were no trades bidRate: number double rate of the current best bid or zero if there are no bids askRate: number double rate of the current best ask or zero if there are no asks.
OrderBookEntry quantity: number double quantity rate: number double rate. Trade id: string uuid unique ID of this trade, assigned by the service always present executedAt: string date-time timestamp in UTC when order was filled quantity: number double quantity rate: number double rate takerSide: string BUY , SELL taker side specifies whether the taker was the buy or sellside.
Candle startsAt: string date-time time stamp in UTC for when this candle's time interval starts open: number double open high: number double high low: number double low close: number double close volume: number double volume quoteVolume: number double quoute volume.
Order id: string uuid unique ID of this order, assigned by the service always present Note that this ID is completely unrelated to the optional ClientOrderId. BulkCancelResult id: string uuid statusCode: string result: Order. ServicePing serverTime: integer int64 Server time in epoch millisecond format, rounded down to the nearest second. Subaccount id: string uuid unique ID of this subaccount createdAt: string date-time timestamp when this subaccount was created. SentTransferInfo toSubaccountId: string uuid receiver account ID toMasterAccount: boolean transfer to master account id: string uuid unique ID for this transfer requestId: string uuid client transfer id currencySymbol: string currency symbol transfered amount: number double amount transfered executedAt: string date-time time stamp when this transfer was executed.
ReceivedTransferInfo fromSubaccountId: string uuid sender account ID fromMasterAccount: boolean transfer from master account id: string uuid unique ID for this transfer requestId: string uuid client transfer id currencySymbol: string currency symbol transfered amount: number double amount transfered executedAt: string date-time time stamp when this transfer was executed.
The specific formats are as follows:. The topic indicates the data you would like to receive whilst the filter parses for the specific data you desire - for example, the symbol. The topic is mandatory but the filter is optional. It is possible to use multiple filters for the same topic by splitting them with a pipe - of course, these filters must all be applicable to the selected topic.
Some topics are pushed at intervals. If the args contain a millisecond param, such as ms , this topic is pushed at intervals. Otherwise, it is pushed constantly. After the subscription response, the first response will be the snapshot response. This shows the entire orderbook. The data is ordered by price, starting with the lowest buys and ending with the highest sells. Following this, all responses are in the delta format, which represents updates to the orderbook relative to the last response.
This is a list of valid options and rules for the different parameters when sending a request to the API. Maximum quantity of 1 million Must be an integer - no decimals, only a whole number of USD contracts 40 - allowed It may not be or below. In pseudocode assuming the price is an increment of 0.
For example, if the liquidation price of an open long position is In the case of a short position the price must be less than the liquidation price. Conditional order Must be equal to order greater than 1. The abandoned endpoints will be deprecated on December 10, Effective immediately, the rate limit will be reduced by half before being completely removed from service on December 17, Currently, this field is useless.
When the funding rate is positive, longs pay shorts. When it is negative, shorts pay longs. When in Cross Margin mod, the number minus your unclosed loss is your real wallet balance. This is to prevent replay attacks. BTC" if data : print data. Data recording period. What is a reduce-only order? True means your position can only reduce in size if this order is triggered. What is a close on trigger order? For a closing order. It can only reduce your position, not increase it.
If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin. Customised order ID, maximum length at 36 characters, and order ID under the same agency has to be unique. Your active order ID. The unique order ID returned to you when the corresponding active order was created.
Search direction. Defaults to next. Page turning mark. Use return cursor. Sign using origin data, in request please use urlencode.