Skip to main content
SupaGamma
API Reference

API Reference

Complete reference for the SupaGamma REST API. All endpoints require authentication via API key.

Base URL
https://api.supagamma.com/v1
Authentication
Include your API key in the X-API-Key header
X-API-Key: sg_live_your_key_here

API 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/markets
GET
/v1/markets/{market_id}
GET
/v1/markets/{market_id}/stats
GET
/v1/trades
GET
/v1/trades/ohlcv
GET
/v1/trades/recent
GET
/v1/download/trades
GET
/v1/download/ohlcv
GET
/v1/user/me
GET
/v1/user/keys
POST
/v1/user/keys
DELETE
/v1/user/keys/{key_id}
GET
/v1/user/usage
GET
/v1/billing/balance
GET
/v1/billing/pricing

Response 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=200

Ready to start?

Create an account and get your API key in under 2 minutes.