Skip to main content

Introduction

Exchange Web provides a comprehensive REST API and WebSocket connection for real-time cryptocurrency trading data. The backend powers market data retrieval, order placement, and live updates for order books and trades.

Base URLs

REST API
string
https://exchange.jogeshwar.xyz/backend/api/v1
WebSocket
string
wss://exchange.jogeshwar.xyz/ws

Authentication

The API uses user_id based authentication. Create a user account first:
import { createUser } from './utils/requests';

const userResponse = await createUser();
const userId = userResponse.user_id;
Include the user_id in order creation requests for authentication.

Available Endpoints

The REST API provides the following endpoints:
EndpointMethodDescription
/depthGETRetrieve order book depth for a market
/tradesGETGet recent trades for a market
/klinesGETFetch candlestick (OHLCV) data
/tickersGETGet all market tickers
/tickerGETGet specific market ticker
/orderPOSTCreate a new order
/usersPOSTCreate a new user account
All market symbols follow the format: BASE_QUOTE (e.g., SOL_USDC, SOL_USDC)

WebSocket Events

Real-time data is available through WebSocket subscriptions:
  • depth - Order book updates
  • trade - Live trade executions
Connect to the WebSocket URL and send SUBSCRIBE/UNSUBSCRIBE messages to manage your data streams.

Quick Start

import { getTicker, createOrder } from './utils/requests';

// Get market ticker
const ticker = await getTicker('SOL_USDC');
console.log(`BTC price: ${ticker.lastPrice}`);

// Create an order
const order = {
  market: 'SOL_USDC',
  side: 'buy',
  quantity: 0.01,
  price: 50000,
  userId: 'your-user-id'
};

const orderId = await createOrder(order);

Rate Limits

Please implement appropriate rate limiting in your application to avoid overwhelming the backend. Consider caching frequently accessed data like tickers.

Next Steps

REST Endpoints

Detailed documentation for all REST API endpoints

WebSocket Events

Real-time data streaming with WebSocket

Data Types

TypeScript interfaces and data structures

Build docs developers (and LLMs) love