Bare Bitcoin API (1.0.0)

API for interacting with Bare Bitcoin. Most endpoints require authentication. Create API keys here. Read about API authentication here.

Download OpenAPI description
Languages
Servers
Prod environment
https://api.bb.no/

BitcoinTransferService

Transfer bitcoin in and out of the platform. Fetch information about past bitcoin transfers.

Operations

LedgerService

Operations

PublicService

Public endpoints that don't require authentication

Operations

TradingService

Execute and cancel orders. Fetch information about past orders.

Operations

Fetch open orders

Request

Fetches all open orders for the user. Open orders are orders that are not yet filled, and can be cancelled.

curl -i -X GET \
  https://api.bb.no/v1/orders \
  -H 'x-bb-api-hmac: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-key: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-nonce: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
ordersArray of objects(Order)
Response
application/json
{ "orders": [ { … } ] }

Place a new order

Request

Places a new order. If the endpoint returns with a 200 status, the order is successfully placed. If you're creating a market order, a trade is also created, and its ID is included in the response.

Bodyapplication/jsonrequired
typestring(enum)
Enum"ORDER_TYPE_UNSPECIFIED""ORDER_TYPE_MARKET""ORDER_TYPE_LIMIT"
directionstring(enum)
Enum"DIRECTION_UNSPECIFIED""DIRECTION_BUY""DIRECTION_SELL"
amountnumber(double)

Amount to spend. Must be positive. When buying, this is the amount in NOK. When selling, this is the amount in BTC.

accountIdstring

The bitcoin account to use for this order. Empty for default account.

descriptionstring

Free-form text description of the order. Can be used to correlate with your own systems.

pricenumber(double)

The price to buy or sell at. Only used for limit orders.

curl -i -X POST \
  https://api.bb.no/v1/orders \
  -H 'Content-Type: application/json' \
  -H 'x-bb-api-hmac: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-key: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-nonce: YOUR_API_KEY_HERE' \
  -d '{
    "type": "ORDER_TYPE_UNSPECIFIED",
    "direction": "DIRECTION_UNSPECIFIED",
    "amount": 0.1,
    "accountId": "string",
    "description": "string",
    "price": 0.1
  }'

Responses

OK

Bodyapplication/json
orderIdstring

ID of the created order.

tradeIdstring

If this was a market order, the order resulted in a trade. Empty if not market order.

Response
application/json
{ "orderId": "string", "tradeId": "string" }

Cancel an order

Request

Cancel a pending order. If the order is already filled, an error will be returned. It is not possible to cancel market orders.

Path
orderIdstringrequired
curl -i -X DELETE \
  'https://api.bb.no/v1/orders/{orderId}' \
  -H 'x-bb-api-hmac: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-key: YOUR_API_KEY_HERE' \
  -H 'x-bb-api-nonce: YOUR_API_KEY_HERE'

Responses

OK

Body

UserService

Fetch information the authenticated user and it sub accounts.

Operations