Contact Sales

Public API

The Braiins Hashpower API provides programmatic access to market data and trading functionality. Full API documentation is available via Swagger at hashpower.braiins.com/api.

Overview

The Braiins Hashpower API is a RESTful API that allows you to:

  • Access real-time market data (order book, trades, charts)
  • Manage bids (create, modify, cancel)
  • View account information and balances
  • Monitor bid status and history
  • Access transaction records

API Documentation

Interactive API documentation is available via Swagger UI:

https://hashpower.braiins.com/api

The Swagger interface provides:

  • Complete endpoint listings
  • Request/response schemas
  • Interactive "Try it out" functionality
  • Authentication support

Authentication

API Token

Authenticated endpoints require an API token passed via the apikey header:

apikey: your-api-token-here

Token Types

Token TypeAccess Level
Owner TokenFull access to all endpoints including trading
Read-only TokenAccess to market data and account viewing only

Obtaining API Tokens

  1. Visit hashpower.braiins.com
  2. Click Sign Up and complete registration
  3. Your API tokens are displayed after successful registration
  4. Store the tokens securely — they are only shown once

Never expose your API tokens in client-side code, public repositories, or logs. Use environment variables or secure secret management.

Base URL

All API requests should be made to:

https://hashpower.braiins.com/v1/

Example Request

curl -X GET "https://hashpower.braiins.com/v1/spot/orderbook" \
  -H "Content-Type: application/json"

Public Endpoints

Public endpoints do not require authentication and provide market data.

EndpointMethodDescription
/spot/orderbookGETCurrent order book with bids and asks
/spot/tradesGETRecent trade history
/spot/barsGETOHLCV candlestick data for charts
/spot/statsGETMarket statistics (volume, best prices, hashrate)

Authenticated Endpoints

Authenticated endpoints require the apikey header.

Account

EndpointMethodDescription
/account/balanceGETCurrent balance (available, reserved, total)
/account/transactionGETTransaction history
/account/transaction/on-chainGETList on-chain account transactions

Market

EndpointMethodDescription
/spot/settingsGETMarket configuration (tick size, limits, units)
/spot/feeGETCurrent fee structure

Bid Management

EndpointMethodDescription
/spot/bidGETList all bids (historical and active)
/spot/bidPOSTCreate a new bid
/spot/bidPUTUpdate an existing bid
/spot/bidDELETECancel a bid
/spot/bid/currentGETList active bids only
/spot/bid/detail/{order_id}GETGet detailed bid information
/spot/bid/speed/{order_id}GETGet speed history time series
/spot/bid/delivery/{order_id}GETGet delivery history time series

For complete endpoint details, request/response schemas, and interactive testing, see the Swagger documentation.

Error Handling

HTTP Status Codes

CodeDescription
200Success
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API token
403Forbidden — Insufficient permissions or bid belongs to another user
404Not Found — Resource doesn't exist
429Too Many Requests — Rate limit exceeded
500Internal Server Error

Error Response Format

For some errors (e.g., Bad Request), the error details are returned in the grpc-message header:

grpc-message: Bid%20duration%20too%20short%20(estimate:%209.29,%20limit:%201800)

The message is URL-encoded and should be decoded to get the human-readable error description.

Best Practices

  1. Check /spot/settings first: Understand pricing units, limits, and cooldowns before placing bids
  2. Cache market data: Order book and trades update frequently; cache appropriately
  3. Handle errors gracefully: Implement retry logic with exponential backoff
  4. Validate inputs client-side: Prevent unnecessary API calls with invalid data
  5. Monitor your rate limits: Track usage to avoid hitting limits
  6. Secure your tokens: Use environment variables, never hardcode
  7. Use cl_order_id: Assign your own IDs to bids for easier tracking and idempotency

Was this helpful?