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: See Rate Limits section below for detailed limits per endpoint
  4. Response Format: All endpoints return JSON responses with structured error codes

Rate Limits

These are application-level rate limits. Infrastructure providers may enforce additional limits at the network level.

Rate Limiter Types

  1. IP-based - Based on public IP address
  2. Owner ID-based - Uses o2-owner-id header (Fuel address)

Session Endpoints

EndpointRate LimitType
PUT /v1/session5/sOwner ID-based
POST /v1/session/actions5/sOwner ID-based

Account Endpoints

EndpointRate LimitType
POST /v1/accounts1/sIP-based
POST /v1/accounts/actions10/mOwner ID-based
POST /v1/accounts/upgrade10/mOwner ID-based
POST /v1/accounts/withdraw10/mOwner ID-based

Market Endpoints

EndpointRate LimitType
GET /v1/markets/fees5/sIP-based

Aggregated Endpoints

EndpointRate LimitType
GET /v1/aggregated/assets5/sIP-based
GET /v1/aggregated/orderbook5/sIP-based
GET /v1/aggregated/summary5/sIP-based
GET /v1/aggregated/ticker5/sIP-based
GET /v1/aggregated/trades5/sIP-based
GET /v1/aggregated/coingecko/tickers5/sIP-based
GET /v1/aggregated/coingecko/orderbook5/sIP-based

All aggregated endpoints are also available under the /v1/agg/ alias with the same rate limits.

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 Identity variants:

  • 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.

Smart Contract ABIs

For developers building applications that integrate directly with o2 smart contracts, the contract ABIs are publicly available:

The repository contains the currently deployed smart contract ABIs for the o2 exchange on the Fuel network. Refer to the markets API endpoint for the on-chain contract IDs.

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.