API Documentation

Integrate orbits8's trading platform with your applications

Introduction

Welcome to the orbits8 API documentation. Our REST API allows you to programmatically access trading features, account data, and market information. All API endpoints are secured with API key authentication.

Base URL: https://api.orbits8.com/v1

Authentication

To use the API, you need to generate API keys from your account settings. You'll receive:

  • API Key: Your public identifier
  • API Secret: Used to sign requests (keep secret!)

// Example API request with authentication
const apiKey = 'YOUR_API_KEY';
const apiSecret = 'YOUR_API_SECRET';
const timestamp = Date.now();
const signature = crypto.createHmac('sha256', apiSecret)
    .update(timestamp + 'GET/api/v1/account')
    .digest('hex');

fetch('https://api.orbits8.com/v1/account', {
    headers: {
        'X-API-Key': apiKey,
        'X-Timestamp': timestamp,
        'X-Signature': signature
    }
});
                    

Market Data Endpoints

GET /ticker

Get latest ticker prices for all symbols

Response Example:

{
    "BTCUSDT": {
        "symbol": "BTCUSDT",
        "price": "42345.67",
        "volume": "1250.45",
        "change": "+2.34",
        "changePercent": "+5.23"
    }
}
                        
GET /klines

Get candlestick data for a symbol

Parameters:

  • symbol - Trading pair (e.g., BTCUSDT)
  • interval - Timeframe (1m, 5m, 15m, 1h, 4h, 1d)
  • limit - Number of candles (default 100, max 1000)
Request Example:

GET /klines?symbol=BTCUSDT&interval=1h&limit=50
                        
GET /orderbook

Get current order book for a symbol

Response Example:

{
    "bids": [
        ["42345.00", "1.5"],
        ["42340.00", "2.0"]
    ],
    "asks": [
        ["42350.00", "1.2"],
        ["42355.00", "0.8"]
    ]
}
                        

Trading Endpoints

POST /order

Place a new order

Parameters:

  • symbol - Trading pair
  • side - BUY or SELL
  • type - MARKET, LIMIT, STOP_LOSS
  • quantity - Amount to trade
  • price - For limit orders
Request Example:

POST /order
{
    "symbol": "BTCUSDT",
    "side": "BUY",
    "type": "LIMIT",
    "quantity": 0.01,
    "price": 42000
}
                        
DELETE /order/{orderId}

Cancel an open order

GET /open-orders

Get all open orders

Account Endpoints

GET /account

Get account information

Response Example:

{
    "accountId": "123456",
    "email": "user@example.com",
    "balance": 10000.00,
    "equity": 12500.00,
    "margin": 2500.00,
    "freeMargin": 10000.00
}
                        
GET /balance

Get account balance

GET /positions

Get all open positions

WebSocket Streams

For real-time data, we provide WebSocket streams:

WebSocket URL: wss://stream.orbits8.com

  • /ws/ticker/{symbol} - Real-time ticker updates
  • /ws/trades/{symbol} - Live trade execution stream
  • /ws/orderbook/{symbol} - Order book depth updates
  • /ws/kline/{symbol}/{interval} - Candle updates

// WebSocket connection example
const ws = new WebSocket('wss://stream.orbits8.com/ws/ticker/BTCUSDT');
ws.onmessage = (event) => {
    const data = JSON.parse(event.data);
    console.log('BTC Price:', data.price);
};
                    

Rate Limits

  • Public endpoints: 10 requests per second
  • Private endpoints: 5 requests per second
  • Order placement: 3 requests per second
  • Rate limit headers are returned in responses

Error Codes

400
Bad Request - Invalid parameters
401
Unauthorized - Invalid API key or signature
403
Forbidden - Insufficient permissions
404
Not Found - Endpoint or resource not found
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

SDK Examples

Python


from orbits8 import Client

client = Client(api_key='YOUR_API_KEY', api_secret='YOUR_API_SECRET')

# Get ticker
ticker = client.get_ticker('BTCUSDT')
print(ticker)

# Place order
order = client.create_order(
    symbol='BTCUSDT',
    side='BUY',
    type='LIMIT',
    quantity=0.01,
    price=42000
)
                    

JavaScript/Node.js


const orbits8 = require('orbits8-api');

const client = new orbits8.Client({
    apiKey: 'YOUR_API_KEY',
    apiSecret: 'YOUR_API_SECRET'
});

// Get account balance
const balance = await client.getBalance();

// Place market order
const order = await client.createOrder({
    symbol: 'ETHUSDT',
    side: 'SELL',
    type: 'MARKET',
    quantity: 0.5
});