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}POST
/v1/markets/{market_id}/estimateGET
/v1/markets/{market_id}/statsGET
/v1/seriesGET
/v1/series/{series_id}POST
/v1/series/{series_id}/estimateGET
/v1/tradesGET
/v1/trades/ohlcvGET
/v1/trades/recentGET
/v1/download/tradesGET
/v1/download/ohlcvGET
/v1/download/orderbookPOST
/v1/ordersGET
/v1/ordersGET
/v1/orders/estimateGET
/v1/user/meGET
/v1/user/keysPOST
/v1/user/keysDELETE
/v1/user/keys/{key_id}GET
/v1/user/usageGET
/v1/user/downloadsGET
/v1/billing/balancePOST
/v1/billing/checkoutGET
/v1/billing/transactionsGET
/v1/billing/pricingResponse Format
Successful responses return JSON. List endpoints return arrays, detail endpoints return objects:
// GET /v1/markets — returns array
[
{
"id": "0x1234...",
"event_id": "evt_...",
"question": "Will BTC reach $100k by Dec 2025?",
"description": "Market resolves YES if ...",
"outcomes": ["Yes", "No"],
"outcome_prices": [0.67, 0.33],
"active": true,
"closed": false,
"resolved": false,
"winning_outcome": null,
"volume": 1542000,
"volume_24h": 12500,
"liquidity": 8900,
"start_date": "2025-06-15T10:00:00Z",
"end_date": "2025-12-31T23:59:59Z",
"trade_count": 4231,
"orderbook_count": 87412,
"data_from": "2025-06-15T10:00:00Z",
"data_to": "2026-05-11T12:00:00Z",
"tags": ["crypto", "bitcoin"],
"category": "crypto"
}
]
// GET /v1/trades?market_id=...&limit=2 — returns array.
// market_id in trades rows is the outcome token id (YES or NO),
// not the same as the parent markets.id from /v1/markets.
[
{
"id": "trade_abc123",
"market_id": "0xtoken_yes...",
"timestamp": "2025-11-05T14:32:15Z",
"block_number": 65123456,
"transaction_hash": "0xfeed...",
"outcome": 0,
"side": "buy",
"price": 0.67,
"size": 1542.50,
"usd_value": 1033.48,
"maker": "0xabc...",
"taker": "0xdef...",
"fee": 0.0
}
]
// POST /v1/markets/{market_id}/estimate — windowed cost preview
// Body: { "data_type": "trades", "start": null, "end": null }
{
"market_id": "0x1234...",
"data_type": "trades",
"estimated_rows": 4231,
"estimated_size_bytes": 973130,
"estimated_size_mb": 0.9281,
"rate_per_mb": 1.0,
"estimated_cost_usd": 0.93,
"in_range": true
}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.