API Reference
API Reference
Complete reference for the SupaGamma REST API. All endpoints require authentication via API key.
Base URL
https://api.supagamma.com/v1Authentication
Include your API key in the X-API-Key header
X-API-Key: sg_live_your_key_hereAPI keys are created from your dashboard under the API Keys section. Keys use the format sg_live_xxxxxxxxxxxx.
Rate Limits
All users
60 requests/min
Per API key
If you exceed the rate limit, you'll receive a 429 Too Many Requests response. Wait and retry after the limit resets.
Endpoints
GET
/v1/marketsGET
/v1/markets/{market_id}GET
/v1/markets/{market_id}/statsGET
/v1/tradesGET
/v1/trades/ohlcvGET
/v1/trades/recentGET
/v1/download/tradesGET
/v1/download/ohlcvGET
/v1/user/meGET
/v1/user/keysPOST
/v1/user/keysDELETE
/v1/user/keys/{key_id}GET
/v1/user/usageGET
/v1/billing/balanceGET
/v1/billing/pricingResponse Format
Successful responses return JSON. List endpoints return arrays, detail endpoints return objects:
// GET /v1/markets — returns array
[
{
"id": "0x1234...",
"question": "Will BTC reach $100k by Dec 2025?",
"category": "crypto",
"active": true,
"volume": 1542000,
"created_at": "2024-06-15T10:00:00Z"
},
...
]
// GET /v1/trades?market_id=...&limit=2 — returns array
[
{
"id": "trade_abc123",
"market_id": "0x1234...",
"price": 0.67,
"size": 1542.50,
"side": "buy",
"maker": "0xabc...",
"taker": "0xdef...",
"timestamp": "2024-11-05T14:32:15Z"
},
...
]Error Handling
Errors return appropriate HTTP status codes with a JSON body:
// 401 Unauthorized
{"detail": "Invalid API key"}
// 429 Too Many Requests
{"detail": "Rate limit exceeded"}
// 404 Not Found
{"detail": "Market not found"}
// 402 Payment Required
{"detail": "Insufficient credits"}Pagination
List endpoints support pagination with limit and offset query parameters:
limit— Number of results to return (default: 50, max: 1000)offset— Number of results to skip (default: 0)
GET /v1/trades?market_id=0x1234&limit=100&offset=200Ready to start?
Create an account and get your API key in under 2 minutes.