Bitania Public API
The Bitania Public API provides programmatic access to the Bitania cryptocurrency exchange platform. It covers both the Classic Exchange (order-book trading) and the P2P Marketplace (peer-to-peer trading).
Base URL
https://api.bitania.com/v1
Quick Start
1. Get Market Data (no auth required)
# List all trading pairs
curl https://api.bitania.com/v1/exchange/pairs
# Get BTC/USDT orderbook
curl https://api.bitania.com/v1/exchange/orderbook?pair=BTC/USDT
# Get recent trades
curl https://api.bitania.com/v1/exchange/trades?pair=BTC/USDT&limit=20
import requests
BASE = "https://api.bitania.com/v1"
# List trading pairs
pairs = requests.get(f"{BASE}/exchange/pairs").json()
# Orderbook
book = requests.get(f"{BASE}/exchange/orderbook", params={"pair": "BTC/USDT"}).json()
# Recent trades
trades = requests.get(f"{BASE}/exchange/trades", params={"pair": "BTC/USDT", "limit": 20}).json()
2. Authenticate
# Register (if you don't have an account)
curl -X POST https://api.bitania.com/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "myuser", "password": "securepassword123"}'
# Login to get a JWT token
curl -X POST https://api.bitania.com/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "myuser", "password": "securepassword123"}'
import requests
BASE = "https://api.bitania.com/v1"
# Login
resp = requests.post(f"{BASE}/auth/login", json={
"username": "myuser",
"password": "securepassword123"
})
token = resp.json()["access_token"]
headers = {"Authorization": f"Bearer {token}"}
3. Place an Order
curl -X POST https://api.bitania.com/v1/exchange/orders \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pair": "BTC/USDT",
"side": "buy",
"type": "limit",
"price": 50000.00,
"amount": 0.001
}'
order = requests.post(f"{BASE}/exchange/orders", headers=headers, json={
"pair": "BTC/USDT",
"side": "buy",
"type": "limit",
"price": 50000.00,
"amount": 0.001
}).json()
4. Create an API Key (for bots)
For automated trading, create an API key instead of using JWT tokens:
curl -X POST https://api.bitania.com/v1/api-keys \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"label": "My Trading Bot",
"permissions": ["read", "trade"]
}'
Then use the API key headers on all subsequent requests:
curl https://api.bitania.com/v1/exchange/balances \
-H "X-API-Key: bta_a1b2c3d4..." \
-H "X-API-Secret: your_secret_here"
API Sections
| Section | Description | Auth Required |
|---|---|---|
| General | Platform info, prices, currencies | No |
| Authentication | Register, login, user info | Partial |
| Exchange - Market Data | Pairs, orderbook, trades, candles | No |
| Exchange - Trading | Orders, balances, portfolio | Yes |
| Wallet | Deposits, withdrawals, transactions | Yes |
| P2P Marketplace | Ads, trades, feedback | Partial |
| Portfolio | Analytics, P&L, history | Yes |
| Instant Swap | HMAC-signed swap orders | HMAC |
| WebSocket | Real-time market data & user events | Optional |
SDKs & Libraries
Official client libraries are not yet available. The API follows standard REST conventions and can be used with any HTTP client. We recommend:
- Python:
requestsorhttpx - JavaScript/TypeScript:
fetchoraxios - Go:
net/http - Rust:
reqwest