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:
Token Types
Obtaining API Tokens
- Visit hashpower.braiins.com
- Click Sign Up and complete registration
- Your API tokens are displayed after successful registration
- 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:
Example Request
Public Endpoints
Public endpoints do not require authentication and provide market data.
Authenticated Endpoints
Authenticated endpoints require the apikey header.
Account
Market
Bid Management
For complete endpoint details, request/response schemas, and interactive testing, see the Swagger documentation.
Error Handling
HTTP Status Codes
Error Response Format
For some errors (e.g., Bad Request), the error details are returned in the grpc-message header:
The message is URL-encoded and should be decoded to get the human-readable error description.
Best Practices
- Check
/spot/settingsfirst: Understand pricing units, limits, and cooldowns before placing bids - Cache market data: Order book and trades update frequently; cache appropriately
- Handle errors gracefully: Implement retry logic with exponential backoff
- Validate inputs client-side: Prevent unnecessary API calls with invalid data
- Monitor your rate limits: Track usage to avoid hitting limits
- Secure your tokens: Use environment variables, never hardcode
- Use
cl_order_id: Assign your own IDs to bids for easier tracking and idempotency