Developer Reference

API Documentation

Last updated February 2026

01

REST API

Base URL: https://api.veil.markets/v1

GET/markets

Fetch all active markets with current prices, volume, and metadata.

Query params: category, status, limit, offset

GET/markets/:id

Get detailed information about a specific market including resolution criteria and historical data.

GET/markets/:id/orderbook

Retrieve the current order book for a market with bid/ask prices and liquidity depth.

POST/orders

Place a new order on a market. Requires wallet authentication and signature.

Body: marketId, outcome, amount, price, signature

GET/user/:address/positions

Get all open positions for a wallet address. Requires authentication.

02

WebSocket API

Connect to: wss://api.veil.markets/ws

Subscribe to real-time market updates, order book changes, and trade executions via WebSocket connections.

Subscribe to Market

{ "action": "subscribe", "channel": "market", "marketId": "btc-100k" }

Subscribe to Order Book

{ "action": "subscribe", "channel": "orderbook", "marketId": "btc-100k" }
03

Authentication

VEIL uses wallet-based authentication. Sign a message with your wallet to receive an API key:

  1. 1Request a challenge message from POST /auth/challenge
  2. 2Sign the message with your wallet
  3. 3Submit the signature to POST /auth/verify
  4. 4Receive an API key valid for 24 hours
  5. 5Include the API key in the Authorization header for authenticated requests