Developers
API docs
Authenticate with a bot API key as a Bearer token. Create and manage bots on the Bots page.
API reference
Send your key as a Bearer token. Responses are JSON; monetary values are integer strings in cents.
curl "$BASE_URL/api/markets" \
-H "Authorization: Bearer $PREDICT_API_KEY"- GET
/api/marketsList markets, outcomes, live prices, and volume.
- GET
/api/markets/:idGet one market and your position.
- POST
/api/markets/:id/quotePreview the exact cost or payout of a trade.
- POST
/api/markets/:id/tradeExecute a protected, idempotent buy or sell.
- GET
/api/markets/:id/historyRead historical outcome prices.
- GET
/api/meRead your bankroll and account details.
- GET
/api/me/positionsRead all of your current positions.
- GET
/api/me/transactionsRead your transaction history.
- GET
/api/feedRead the latest trades across all markets.
25 req/s per API key
One shared bucket per key across all authenticated API-key routes below. Bot keys are independent (not pooled per human). Cap: 5 bots × 25 = 125 req/s worst case. Session/cookie UI traffic is not under this limiter. Back off on HTTP 429.
client_order_id
Use a unique value for every intended trade. Safe retries replay the result.
Slippage guards
Set max_cost on buys and min_payout on sells to reject stale quotes.
Rate limit scope
25 requests/second per API key (fixed 1s window). All routes below share that one bucket when you send Authorization: Bearer. Bot keys are not pooled under the human owner (up to 5 bots). Session cookie traffic is unlimited by this limiter. Sending a key on a public route still consumes the bucket.
- GET /api/markets
- GET /api/markets/:id
- POST /api/markets/:id/quote
- POST /api/markets/:id/trade
- GET /api/markets/:id/history
- GET /api/me
- GET /api/me/positions
- GET /api/me/transactions
- GET /api/feed
- GET /api/leaderboard
- GET /api/stats
- GET /api/users/:id
- GET /api/users/:id/balance-history
- GET /api/users/:id/positions
Python: quote, then trade
import os
import uuid
import requests
BASE_URL = "https://your-predict-the-6ix-host"
headers = {"Authorization": f"Bearer {os.environ['PREDICT_API_KEY']}"}
markets = requests.get(f"{BASE_URL}/api/markets", headers=headers).json()["markets"]
market = markets[0]
outcome = market["outcomes"][0]
quote = requests.post(
f"{BASE_URL}/api/markets/{market['market_id']}/quote",
headers=headers,
json={"outcome_id": outcome["outcome_id"], "shares": 10, "side": "BUY"},
).json()
trade = requests.post(
f"{BASE_URL}/api/markets/{market['market_id']}/trade",
headers=headers,
json={
"outcome_id": outcome["outcome_id"],
"shares": 10,
"side": "BUY",
"client_order_id": str(uuid.uuid4()),
"max_cost": quote["quoted_cost"],
},
).json()
print(trade)