Skip to content
🌐Network: Mainnet

o2 Exchange API Endpoints Reference

Complete reference of all available API endpoints with interactive examples and detailed documentation.

Network Configuration

Use the network selector in the top navigation bar to choose your preferred API environment. All interactive examples and code snippets will automatically update to use the selected network.

Overview

The o2 Exchange API provides comprehensive access to trading functionality, market data, and account management for the Fuel-based decentralized exchange. This documentation is organized into logical sections for easy navigation:

Endpoint Categories

Quick Start

  1. Network Selection: Choose your target environment using the network selector above
  2. Authentication: Most endpoints are public; account-specific operations require signatures
  3. Rate Limits: Reasonable limits are applied (e.g., max 50 trades per request, 5000 bars per request)
  4. Response Format: All endpoints return JSON responses with consistent error handling

Interactive Testing

Each endpoint page includes interactive ApiTryIt components where you can:

  • Input parameters and see the URL update in real-time
  • Execute actual API calls to test endpoints
  • View responses with proper formatting
  • Generate code examples in Shell, Node.js, and Rust

Query Patterns & Best Practices

Pagination

Many endpoints support pagination using:

  • start_timestamp + start_trade_id/start_order_id - Starting point
  • direction - "asc" or "desc" for query direction
  • count - Number of items to return

Identity Parameters

Endpoints accepting account identifiers support:

  • address - User wallet address (Address type)
  • contract - Trading account contract ID (ContractId type)

WebSocket Real-time Data

For real-time updates, connect to the WebSocket endpoint (/ws) on your selected network with subscriptions for:

  • Order book updates (subscribe_depth)
  • Order updates (subscribe_orders)
  • Trade updates (subscribe_trades)
  • Balance updates (subscribe_balances)

For comprehensive parameter documentation, see the Parameters Reference.

Source Code References

All endpoints include direct references to the source code implementation in the packages/api/src/ directory for developers who want to understand the underlying implementation details.

Need help? Navigate through the sections above or use the sidebar to explore specific endpoint categories.