WCINU

API Documentation

Build on top of WCINU.BET. Full REST API access to markets, odds, leaderboards, betting, and transparency data.

BASE URL https://wcinu.bet/api

Rate Limits

All endpoints are rate-limited per IP address. General limit: 60 requests/min. Prediction endpoints: 10 requests/min. Activity feed: 30 requests/min. Admin endpoints: 10 requests/min. Health check: unlimited. Returns 429 when exceeded.

JavaScript SDK

Use our SDK for easy integration: <script src="/js/wcinu-sdk.js"></script>
Or install via npm: npm install @wcinu/sdk

// CONTENTS

Endpoint Groups

Markets Stats & Leaderboards Activity & Feed User Data Predictions Transparency On-Chain Arena Social & Comments Proposals Gamification KOL Admin
// MARKETS

Markets

GET /api/markets Public 60/min

List all prediction markets with computed odds. Supports filtering by status and category.

ParamTypeDescription
statusqueryFilter by status: open, closed, settled
categoryqueryFilter: match, group, tournament, awards, knockout, meta, fun, special
limitqueryMax results (default: all, max: 1000)
offsetqueryPagination offset (default: 0)
Example Response
{
  "markets": [
    {
      "id": "match_fra_bra",
      "title": "France vs Brazil",
      "status": "open",
      "totalPool": 12.5,
      "options": [
        { "name": "France", "pool": 5.2 },
        { "name": "Draw", "pool": 3.1 },
        { "name": "Brazil", "pool": 4.2 }
      ],
      "odds": [
        { "name": "France", "probability": 0.416, "decimal": 2.40 },
        { "name": "Draw", "probability": 0.248, "decimal": 4.03 },
        { "name": "Brazil", "probability": 0.336, "decimal": 2.98 }
      ],
      "closesAt": 1750000000,
      "realBetCount": 47
    }
  ],
  "total": 85
}

GET /api/markets/:id Public

Get a single market by ID with full odds and pool data.

ParamTypeDescription
idpathMarket ID (e.g. match_fra_bra)

GET /api/markets/:id/history Public

Odds history for charting. Returns timestamped snapshots of option pools.

ParamTypeDescription
idpathMarket ID
sincequeryUnix timestamp (ms). only return snapshots after this time

GET /api/markets/:id/whales Public

Top 10 bettors on a specific market, with tier info and pick breakdown.

GET /api/markets/:id/comments Public

Get comments for a market (newest first).

ParamTypeDescription
limitqueryMax comments (default: 50)

GET /api/markets/:id/comments/top Public

Top comments sorted by likes.

GET /api/markets/:id/ai-analysis Public 20/hour

AI-powered analysis and confidence score for a market. Powered by Claude AI.

GET /api/daily-pick Public

Today's featured market with full odds.

GET /api/og/:marketId Public

Dynamic SVG share card for social media previews (Open Graph). Returns image/svg+xml.

// STATS

Stats & Leaderboards

GET /api/stats Public

Global platform statistics: total markets, volume, predictions, and biggest prediction.

Example Response
{
  "totalMarkets": 85,
  "openMarkets": 62,
  "settledMarkets": 15,
  "totalPool": 234.56,
  "totalBets": 1847,
  "totalVolume": 512.30,
  "biggestBet": 25.0
}

GET /api/leaderboard Public

Top bettors ranked by profit/volume.

ParamTypeDescription
limitqueryNumber of entries (default: 20, max: 200)

GET /api/whales Public

Top 10 users by total prediction volume, with tier, win rate, and recent predictions.

GET /api/referral/leaderboard Public

Top 20 referrers by earnings.

GET /api/prediction-leaderboard Public

Top predictors ranked by composite accuracy score.

ParamTypeDescription
limitqueryNumber of entries (default: 10)

GET /api/streaks/leaderboard Public

Top prediction streaks.

ParamTypeDescription
limitqueryNumber of entries (default: 10)

GET /api/bracket/leaderboard Public

Top bracket prediction scores.

GET /api/bracket/stats Public

Bracket pool statistics (entries, prize pool).

GET /api/teams/leaderboard Public

Team rankings by collective performance.

GET /api/season/current Public

Current active season with stats and top 10 leaderboard.

GET /api/season/:id/leaderboard Public

Leaderboard for a specific season.

// FEED

Activity & Feed

GET /api/activity Public 30/min

Recent prediction activity feed (most recent first). Ideal for live tickers.

ParamTypeDescription
limitqueryMax entries (default: 50, max: 1000)
offsetqueryPagination offset
Example Response
{
  "activity": [
    {
      "username": "degen42",
      "amount": 2.5,
      "optionName": "France",
      "marketTitle": "France vs Brazil",
      "marketId": "match_fra_bra",
      "timestamp": 1750000000,
      "ago": "3m ago"
    }
  ],
  "total": 1847
}

GET /api/scores Public

Today's live match scores from football-data.org.

GET /api/upcoming Public

Upcoming matches (next 3 days).

GET /api/settlements Public

Public audit log of all market settlements.

ParamTypeDescription
limitqueryMax entries (default: 100)

GET /api/settlements/:marketId Public

Settlement details for a specific market.

// USER

User Data

GET /api/user/by-wallet/:address Public 5/min

Look up (or auto-create) a user by Solana wallet address. Returns stats, tier, and referral info.

GET /api/user/:userId/profile Public

Aggregated user profile: predictions, tier, referral, team, season rank, streak, and prediction stats.

GET /api/user/:userId/positions Public

User's active (open) prediction positions with current odds and potential payout.

GET /api/user/:userId/history Public

User's settled prediction history with PnL.

GET /api/user/:userId/stats Public

Aggregate stats: win rate, PnL, volume, tier info, referral data.

GET /api/user/:userId/achievements Public

User's achievement progress and unlocked badges.

GET /api/user/:userId/watchlist Public

User's watchlist with full market data.

GET /api/user/:userId/insurance Public

User's prediction insurance policies.

GET /api/user/:userId/cashouts Public

User's cash out history.

GET /api/user/:userId/team Public

User's team membership and team stats.

GET /api/user/:userId/prediction-stats Public

User's prediction accuracy breakdown by category.

GET /api/user/:userId/export-csv Public

Download user's prediction history as CSV file.

GET /api/streaks/:userId Public

User's current and best win streak.

// PREDICTIONS

Predictions

POST /api/bet/web Auth: Wallet TX 10/min

Place a prediction from the website using a Phantom wallet. Requires a verified on-chain SOL transfer to the treasury.

FieldTypeDescription
walletAddressstringSolana wallet address (signer)
marketIdstringMarket ID to predict on
optionIdxnumberIndex of the chosen option (0-based)
amountnumberPrediction amount in SOL (min: 0.01, max: 100)
txSignaturestringOn-chain transaction signature (verified server-side)
onChainbooleanOptional. If true, verifies against arena vault PDA instead of treasury.
Example Response
{
  "success": true,
  "betId": "bet_a1b2c3d4",
  "market": "France vs Brazil",
  "option": "France",
  "amount": 2.5,
  "userId": "web_4sK9xP2m"
}

POST /api/bet/tg Auth: TG initData 10/min

Place a prediction from the Telegram Mini App. Authenticates via Telegram WebApp initData (HMAC-SHA256). SOL is sent from the user's bot-managed wallet.

FieldTypeDescription
initDatastringTelegram WebApp initData string (validated via HMAC)
marketIdstringMarket ID
optionIdxnumberOption index (0-based)
amountnumberPrediction amount in SOL (min: 0.01, max: 100)

POST /api/cashout Auth: Wallet 5/min

Cash out an active prediction early. 5% fee on cash out value. SOL sent from treasury to wallet.

FieldTypeDescription
betIdstringPrediction ID (e.g. bet_a1b2c3d4)
walletAddressstringMust match the prediction owner's wallet

GET /api/cashout/value/:betId Public

Get the current cash out value for a prediction (preview before executing).

POST /api/user/:userId/watchlist Public

Add or remove a market from user's watchlist.

FieldTypeDescription
marketIdstringMarket ID
actionstringadd or remove

POST /api/markets/:id/comments Auth: Wallet 5/min

Post a comment on a market.

FieldTypeDescription
walletAddressstringSolana wallet address
textstringComment text

POST /api/comments/:id/like Auth: Wallet

Toggle like on a comment.

FieldTypeDescription
walletAddressstringSolana wallet address
// TRANSPARENCY

Transparency

GET /api/transparency Public

Full transparency data: wallet addresses, distribution history, burn history, and revenue totals.

Example Response
{
  "wallets": {
    "creator": "4sK9...",
    "bundles": [],
    "stakingRewards": "7xPm...",
    "teamOps": "9qRv...",
    "burnCollector": "2fNw..."
  },
  "distributions": [...],
  "burns": [...],
  "totalDistributed": 45.67,
  "totalBurned": 1250000,
  "revenue": {
    "totalFees": 45.67,
    "totalBurned": 1250000,
    "burnCount": 312
  }
}

GET /api/revenue Public

Revenue summary: total fees collected and tokens burned.

GET /api/staking Public

On-chain staking pool stats (reads directly from Solana).

GET /api/insurance/stats Public

Platform-wide insurance statistics.

GET /api/cashout/stats Public

Platform-wide cash out statistics.

// ON-CHAIN

On-Chain Arena

GET /api/arena/status Public

On-chain arena program status: enabled flag, program ID, config, and all on-chain market states with vault balances.

Example Response
{
  "enabled": true,
  "primary": false,
  "programId": "WCArena1111...",
  "config": {
    "marketCount": 12,
    "totalVolume": "45.2300 SOL",
    "paused": false
  },
  "markets": [
    {
      "marketId": 0,
      "totalPool": "5.2000 SOL",
      "status": "open",
      "bettors": 23,
      "feesCollected": "0.1560 SOL",
      "vaultAddress": "7xPm...",
      "vaultBalance": "5.2000 SOL"
    }
  ]
}

POST /api/rpc Public

Solana RPC proxy (avoids CORS). Only whitelisted read-only methods: getBalance, getAccountInfo, getTransaction, getLatestBlockhash, getTokenAccountsByOwner, etc.

// SOCIAL

Social & Comments

Comment and like endpoints are listed under Predictions (POST) and Markets (GET).

GET /api/teams/:id Public

Single team details and stats.

// GOVERNANCE

Proposals

GET /api/proposals Public

List active community market proposals.

ParamTypeDescription
statusqueryFilter: voting, approved, rejected, expired (default: voting)
limitqueryMax entries (default: 20)

GET /api/proposals/:id Public

Single proposal details with vote counts.

POST /api/proposals/:id/vote Auth: Wallet 10/min

Vote on a community market proposal.

FieldTypeDescription
walletAddressstringSolana wallet address
directionstringup or down
// GAMIFICATION

Gamification

GET /api/achievements Public

List all achievement definitions (badges, requirements, rewards).

GET /api/config Public

Public platform config: treasury wallet address, take rate, deposit timeout.

Example Response
{
  "treasuryWallet": "4sK9xP2m...",
  "takeRateBps": 300,
  "depositTimeoutMs": 900000
}

GET /api/tiers Public

Tier definitions with holding requirements, fee percentages, and reward boosts.

GET /api/docs Public

Structured docs data: how it works, fee split, tiers, referral, and staking rules (used by the docs page).

POST /api/simulator-parlay Public

Save simulator parlay picks (returns shareable short ID). Expires after 24h.

FieldTypeDescription
picksarrayArray of pick objects
// KOL

KOL Dashboard

GET /api/kol/:code Public

KOL dashboard stats. The code itself acts as authentication (format: WCINU-XXXXX).

ParamTypeDescription
codepathKOL code (e.g. WCINU-AB123)
// SYSTEM

Health & System

GET /health Public

Health check. Returns uptime, market/bet counts, memory usage, and last bet timestamp. No rate limit.

Example Response
{
  "status": "ok",
  "uptime": 86400,
  "markets": 85,
  "bets": 1847,
  "memory": {
    "rss": "142 MB",
    "heapUsed": "89 MB",
    "heapTotal": "120 MB"
  },
  "lastBetAt": "2026-05-01T14:30:00.000Z",
  "node": "v20.11.0"
}

GET /api/health/detailed Public

Extended health stats from the health monitor (includes error counts, response times, etc.).

// ADMIN

Admin Endpoints

Authentication: Admin endpoints require HMAC authentication via X-Admin-Key header or adminKey in the request body. Format: timestamp:hmac where hmac = HMAC-SHA256(secret, timestamp). 5-minute replay window.

GET /api/admin/markets Admin

All markets (all statuses) with prediction counts. Header: X-Admin-Key or Authorization: Bearer <key>.

POST /api/admin/close Admin

Close a market (stop accepting predictions).

FieldTypeDescription
adminKeystringHMAC auth key
marketIdstringMarket to close

POST /api/admin/settle Admin

Settle a market: declare the winning option and pay out winners. Also settles affected parlays.

FieldTypeDescription
adminKeystringHMAC auth key
marketIdstringMarket to settle
winningIdxnumberIndex of the winning option

POST /api/admin/reopen Admin

Reopen a closed or settled market.

FieldTypeDescription
adminKeystringHMAC auth key
marketIdstringMarket to reopen

POST /api/seed Admin

Bulk create markets (seeding). Rate limited to 1 call/minute.

FieldTypeDescription
adminKeystringHMAC auth key
marketsarrayArray of market objects with id, title, options, closesAt
forcebooleanIf true, update closesAt on existing markets

POST /api/markets/:id/seed Admin

Seed a market with initial liquidity (virtual pools).

FieldTypeDescription
adminKeystringHMAC auth key (header or body)
amountsarraySOL amounts per option
totalSeedSolnumberAlternative: total to distribute evenly

POST /api/reopen-all Admin

Reopen all closed markets at once (emergency recovery).

POST /api/admin/reset-bets Admin

Nuclear option: refund all predictions, reset all pools and counters. Sends SOL refunds from treasury.