Skip to main content

Quick Start

1

Get an API Key

Sign up at polysimulator.com, then create an API key from your profile page or via the API.
# Using a Supabase JWT to create your first key
curl -X POST https://api.polysimulator.com/v1/keys \
  -H "Authorization: Bearer YOUR_SUPABASE_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-first-bot", "tier": "free"}'
Save the raw_key value immediately — it’s shown only once.
2

Set Your Environment

export POLYSIM_API_KEY="ps_live_abc123..."
export POLYSIM_BASE_URL="https://api.polysimulator.com"
3

Check Connectivity

curl -H "X-API-Key: $POLYSIM_API_KEY" \
     $POLYSIM_BASE_URL/v1/health
Expected response:
{"status": "healthy", "timestamp": "2026-03-02T12:00:00Z"}
4

Fetch Hot Markets

curl -H "X-API-Key: $POLYSIM_API_KEY" \
     "$POLYSIM_BASE_URL/v1/markets?hot_only=true&limit=5"
This returns actively traded markets with live prices from Polymarket.
5

Place Your First Trade

curl -X POST $POLYSIM_BASE_URL/v1/orders \
  -H "X-API-Key: $POLYSIM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "market_id": "0xabc123...",
    "side": "BUY",
    "outcome": "Yes",
    "quantity": "10",
    "order_type": "market"
  }'
Response:
{
  "order_id": 42,
  "status": "FILLED",
  "side": "BUY",
  "outcome": "Yes",
  "price": "0.65",
  "quantity": "10",
  "notional": "6.50",
  "slippage_bps": 15,
  "account_balance": "993.50"
}
6

Check Your Portfolio

curl -H "X-API-Key: $POLYSIM_API_KEY" \
     $POLYSIM_BASE_URL/v1/account/portfolio
All numeric values are strings ("10", not 10). This prevents floating-point precision loss — critical for financial applications. See String Numerics for details.

What’s Next?