Good morning everyone,
Camp BX API is live and available for all the Bots and day-trading gurus! We have exposed all standard functionality of the UI through API, including:
- Full Market Data
- Account Data
- Quick Buy / Quick Sell Orders
- Bitcoin Send-To
API documentation is available at: https://www.CampBX.com/api.php
We are also pressing forward with some additional API calls that will expose functionality for Dwolla Transfers and AON/FOK/Market Price/Custom Expiry, so please stay tuned for those announcements!
KeyurActivating API Access
API access can be activated for an account by submitting a ticket to the Helpdesk. Your ticket must include your email, username, and latest transaction date for security reasons.Data Format
Inputs: All input parameters for the API (with the exception of passwords) must be alpha-numeric. Repeated violations of this policy may result in an account ban.
Outputs: The output of the API is in JSON format.Making API Calls
Use POST, not GET. Any API call that requires authentication must be made over SSL connection. Market data calls (which do not require authentication) can be also made over HTTP.Standard Return Codes
There are two generic responses common across all API calls to simplify error handling.
When a fatal error occurs that does not allow the API call to proceed, an Error is returned as the result. In a vast majority of the cases, error can be traced back to improper API calls or malformed parameters.
Info is returned when a non-fatal error occurs during the API call. For example, if an API calls to obtain a list of open orders has zero results, an Info code along with description "No open orders" will be returned by the API call.Depth Table
Full market depth is available through the depth table API call. The API call can be made at:
Result is a JSON object with two arrays: Asks and Bids. Each element in these two arrays has two members: first member is Price and second member is Quantity available at that price. Both numbers are rounded to two decimal points.Market Ticker
The API call to obtain market ticket can be made at:
Result is a JSON object with three members: Last Trade Price, Best Bid Price, and Best Ask Price.Account Balances
An API call to obtain latest account balances can be made in following format:
https://CampBX.com/api/myfunds.php POST: user=USERNAME pass=PASSWORD
Result is a JSON object with six members.
First two members show Total USD and BTC balances for a given account, provided the login credentials are correct.
Next two members show Liquid USD and BTC balances not tied up in open orders on the order book.
Last two members show Margin Account USD and BTC balances. When you open or close a margin position, Camp BX transparently moves funds in and out of the Margin Account; hence, no explicit funds-transfer is required.Orders List
An API call to obtain list open orders for an account can be made in following format:
https://CampBX.com/api/myorders.php POST: user=USERNAME pass=PASSWORD
Result is a JSON object with two arrays: Buy and Sell. Each array includes a sub-array of open Buy or Sell orders.Margin Positions List
An API call to obtain list open Margin positions for an account can be made in following format:
https://CampBX.com/api/mymargins.php POST user=USERNAME pass=PASSWORD
Result is a JSON object with an array of Margin positions including Margin Call Price, and current profit/loss on open positions.Canceling an Open Order
An API call to cancel an open order can be made in following format:
https://CampBX.com/api/tradecancel.php POST: user=USERNAME pass=PASSWORD Type=Buy OrderID=NUMERIC_ID
https://CampBX.com/api/tradecancel.php POST: user=USERNAME pass=PASSWORD Type=Sell OrderID=NUMERIC_ID
Please note that the parameters for this call are case-sensitive. Type and OrderID parameters must match the exact information provided by myorders.php call outlined in the previous section.
The "Type" parameter refers to the type of order; permitted values are Buy or Sell.
"OrderID" must be a numeric value corresponding to the order that you are attempting to cancel. Placing a New Order
An API call to placing an order can be made in following format:
https://CampBX.com/api/tradeenter.php POST: user=USERNAME pass=PASSWORD TradeMode=QuickBuy Quantity=DECIMAL Price=DECIMAL
https://CampBX.com/api/tradeenter.php POST: user=USERNAME pass=PASSWORD TradeMode=QuickSell Quantity=DECIMAL Price=DECIMAL
Please note that the parameters listed below are case-sensitive.
The TradeMode parameter refers to the type of the order, and permitted values are QuickBuy or QuickSell.
Quick orders are described in more detail on the FAQ page; essentially they are limit-price orders that stay open on Camp BX order book for up to 7 days.
Quantity and Price are decimal values that must follow all rules / limits set by Camp BX. Minimum quantity to place an order is 0.5 Bitcoins.Advanced Orders
We are working on an API call to expose the Advanced Trading functionality afforded by the Camp BX platform. This call will allow the bots to request specific Fill-types like AON or FOK fill, Price types like Market or Limit price, and a custom Expiry date ranging from 1 hour to 31 days.
This API call will be available on Friday July 22nd. In the meantime, we encourage you to explore and understand this functionality though the website interface prior to writing a bot around it.Buy on Margin
We are working on an API call to expose Margin trading functionality.
This API call will be activated when market liquidity crosses 1,000 Bitcoins per day for a sustained period. In the meantime, we encourage you to explore and understand this functionality on testnet prior to writing a bot around it.Short Sell
We are working on an API call to expose Short Sell and Cover functionality.
This API call will be activated when market liquidity crosses 1,000 Bitcoins per day for a sustained period. In the meantime, we encourage you to explore and understand this functionality on testnet prior to writing a bot around it.