FORSEE

Forsee Trading API

Build trading bots on Forsee’s crypto UP/DOWN prediction markets. Query markets, stream prices, place and track orders over a simple REST API.

Base URLhttps://api.forsee.market/v1

Introduction

The Forsee Trading API is a REST API for the platform’s crypto UP/DOWN parimutuel markets. Each market runs in repeating rounds; you bet on whether the price will go UP or DOWN by the round’s end. Odds are derived from the pool split, with a 3% platform fee applied to winnings.

All responses are JSON and share a consistent envelope:

json
{ "success": true,  "data": { /* ... */ } }
{ "success": false, "error": "human-readable message" }

Access: the API is in a limited rollout. API keys are currently issued to approved accounts only — see Authentication.

Authentication

Every request authenticates with an API key sent in the X-API-Key header. Create and manage keys in your dashboard at /api-keys. The secret (pk_live_…) is shown once at creation — store it securely; it is never displayed again.

curl https://api.forsee.market/v1/markets \
  -H "X-API-Key: pk_live_your_key_here"

Each key is scoped. A request is rejected with 403 if the key lacks the scope an endpoint requires:

markets:readRead markets and prices
positions:readRead your positions and orders
orders:writePlace orders (bets)
orders:cancelCancel limit orders
Keep your key server-side. Never embed it in client-side code or commit it to source control.

Rate limits

Limits are enforced per key, per account and per IP using a sliding 60-second window. Read endpoints are generous; write endpoints are stricter.

Read (per key)
120 requests / minoptional
GET endpoints (markets, prices, positions, orders).
Write (per key)
30 requests / minoptional
POST /orders and other write endpoints.
Per account
240 requests / minoptional
Aggregate across all of an account’s keys.
Per IP
300 requests / minoptional
Protects against floods and key enumeration.

Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds). When you exceed a limit you get 429 with a Retry-After header — back off and retry after that delay.

Errors

Errors use standard HTTP status codes and the { success: false, error } envelope.

400
Bad Requestoptional
Missing or invalid parameters.
401
Unauthorizedoptional
Missing, malformed or unknown API key.
403
Forbiddenoptional
Key disabled, expired, or missing the required scope.
404
Not Foundoptional
Market or resource does not exist.
409
Conflictoptional
Odds moved beyond tolerance (odds_changed) or duplicate idempotency request in progress.
429
Too Many Requestsoptional
Rate limit exceeded — see Retry-After.
503
Service Unavailableoptional
API trading is temporarily disabled.

Markets

A market is identified by <CRYPTO>_<TIMEFRAME>, e.g. BTC_FIVE_MINUTES. Timeframes: ONE_MINUTE, FIVE_MINUTES, FIFTEEN_MINUTES, FOUR_HOURS, ONE_DAY.

GET/marketsscopemarkets:read

List all active markets with their current round, pool sizes and live odds.

bash
curl https://api.forsee.market/v1/markets -H "X-API-Key: pk_live_…"
json
{
  "success": true,
  "data": [
    {
      "id": "BTC_FIVE_MINUTES",
      "crypto": "BTC",
      "timeFrame": "FIVE_MINUTES",
      "poolUp": 4097.0,
      "poolDown": 4050.0,
      "totalPool": 8147.0,
      "oddsUp": 1.9349,
      "oddsDown": 1.9512,
      "percentUp": 50.3,
      "percentDown": 49.7,
      "minBet": 1.0,
      "maxBet": 10000.0,
      "currentRound": {
        "id": "a1b2c3…",
        "roundNumber": 18423,
        "startTime": "2026-06-27T20:10:00.000Z",
        "lockTime":  "2026-06-27T20:14:40.000Z",
        "endTime":   "2026-06-27T20:15:00.000Z",
        "timeRemaining": 184,
        "timeToLock": 164000,
        "openPrice": 67120.5,
        "currentPrice": 67128.2,
        "status": "LIVE",
        "totalBets": 312,
        "totalVolume": 8147.0
      }
    }
  ]
}
GET/markets/{id}scopemarkets:read

Fetch a single market by id. Same shape as one element of the list above.

bash
curl https://api.forsee.market/v1/markets/BTC_FIVE_MINUTES -H "X-API-Key: pk_live_…"

Prices

GET/pricesscopemarkets:read

Current price per asset. Returns the open price of each asset’s latest live round (field source: "round_open") with a timestamp so you can judge its age. For true real-time ticks, use the realtime feed (see Realtime).

bash
curl https://api.forsee.market/v1/prices -H "X-API-Key: pk_live_…"
json
{
  "success": true,
  "data": [
    { "crypto": "BTC", "price": 67120.5, "source": "round_open", "timestamp": "2026-06-27T20:10:00.000Z" },
    { "crypto": "ETH", "price": 3284.1,  "source": "round_open", "timestamp": "2026-06-27T20:10:00.000Z" }
  ]
}

Positions

GET/positionsscopepositions:read

Your positions — one entry per bet. Defaults to currently-open positions.

status
stringoptional
active (default) — open positions only · all — full history.
limit
integeroptional
1–200, default 100.
bash
curl "https://api.forsee.market/v1/positions?status=active&limit=50" -H "X-API-Key: pk_live_…"
json
{
  "success": true,
  "data": [
    {
      "id": "0a1b…",
      "marketId": "BTC_FIVE_MINUTES",
      "prediction": "UP",
      "amount": 25.0,
      "oddsAtBet": 1.95,
      "potentialPayout": 47.31,
      "status": "ACTIVE",
      "result": null,
      "placedAt": "2026-06-27T20:11:02.000Z",
      "round": { "roundNumber": 18423, "status": "LIVE", "endTime": "2026-06-27T20:15:00.000Z" }
    }
  ]
}

Orders

POST/ordersscopeorders:write

Place a bet on the current live round of a market. The bet locks immediately and settles automatically when the round ends.

marketId
stringrequired
Market id, e.g. BTC_FIVE_MINUTES.
prediction
stringrequired
UP or DOWN.
amount
numberrequired
Stake in USD. Must satisfy the market’s minBet / maxBet and your account tier limits.
expectedPercent
numberoptional
Slippage guard. The percent you expect for your side; if the live value has moved more than 15 points, the order is rejected with 409 odds_changed.
clientSeed
stringoptional
Optional client seed mixed into the provably-fair bet hash.

Send an Idempotency-Key header so a network retry never double-bets (see Idempotency). Bets are not accepted within the final 20 seconds before lock.

curl -X POST https://api.forsee.market/v1/orders \
  -H "X-API-Key: pk_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "marketId": "BTC_FIVE_MINUTES", "prediction": "UP", "amount": 25, "expectedPercent": 50 }'

Response (201 Created):

json
{
  "success": true,
  "data": {
    "bet": {
      "id": "0a1b…",
      "marketId": "BTC_FIVE_MINUTES",
      "prediction": "UP",
      "amount": 25.0,
      "oddsAtBet": 1.95,
      "entryPercent": 51.2,
      "potentialPayout": 47.31,
      "status": "ACTIVE",
      "betHash": "9f2e…",
      "placedAt": "2026-06-27T20:11:02.000Z"
    },
    "newBalance": 975.0,
    "limitOrdersFilled": null
  }
}
GET/ordersscopepositions:read

List your recent orders (most recent first).

limit
integeroptional
1–200, default 50.
bash
curl "https://api.forsee.market/v1/orders?limit=50" -H "X-API-Key: pk_live_…"

Idempotency

POST /orders accepts an Idempotency-Key header (any unique string — a UUID is ideal). The first request with a given key places the bet; any retry with the same key replays the original response instead of placing a second bet. The response of a replay carries X-Idempotent-Replay: true. Keys are remembered for 10 minutes.

Always set an idempotency key on order placement so a timeout or dropped connection can be safely retried.

Realtime

A WebSocket feed for live price ticks, round transitions and your fills is on the roadmap. Until it ships, poll GET /markets and GET /prices (cached ~2s server-side, so polling every 1–2 seconds is fine and cheap).

Coming soon
Need a key? Visit forsee.market/api-keys.