← Back to Home

API Documentation

Build powerful trading applications with our API

Getting Started

The OC Exchange API allows you to integrate our trading platform into your applications. Access real-time market data, manage orders, and build sophisticated trading strategies.

Base URL

https://api.ocexchange.com/v1

API Features

High Performance

Low latency API with 99.9% uptime guarantee

Secure Authentication

API keys with configurable permissions and IP restrictions

RESTful Design

Clean, intuitive REST API following industry standards

Comprehensive Docs

Detailed documentation with code examples

Authentication

API Keys

To access protected endpoints, you need to create API keys in your account settings. Each API key can be configured with specific permissions.

Required Headers

X-API-Key: your-api-key
X-API-Secret: your-api-secret
X-API-Timestamp: 1640995200000
X-API-Signature: calculated-signature

Rate Limits

Public Endpoints

1000 requests/minute

Private Endpoints

100 requests/minute

Trading Endpoints

10 requests/second

API Endpoints

GET/api/market/data

Get real-time market data for all trading pairs

GET/api/trading/orders
Auth Required

Get user's trading orders

POST/api/trading/orders
Auth Required

Create a new trading order

GET/api/wallet/balances
Auth Required

Get user's wallet balances

GET/api/wallet/transactions
Auth Required

Get user's transaction history

Code Examples

Get Market Data

// JavaScript
const response = await fetch('https://api.ocexchange.com/v1/market/data');
const marketData = await response.json();
console.log(marketData);

// Python
import requests
response = requests.get('https://api.ocexchange.com/v1/market/data')
market_data = response.json()
print(market_data)

// cURL
curl -X GET "https://api.ocexchange.com/v1/market/data"

Create Order (Authenticated)

// JavaScript
const order = await fetch('https://api.ocexchange.com/v1/trading/orders', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'your-api-key',
    'X-API-Secret': 'your-api-secret',
    'X-API-Timestamp': Date.now().toString(),
    'X-API-Signature': 'calculated-signature'
  },
  body: JSON.stringify({
    symbol: 'BTCUSDT',
    side: 'buy',
    type: 'limit',
    amount: 0.001,
    price: 45000
  })
});

SDKs and Tools

JavaScript SDK

Official JavaScript/TypeScript SDK for Node.js and browsers

npm install @ocexchange/sdk

Python SDK

Python library for algorithmic trading and data analysis

pip install ocexchange

Postman Collection

Ready-to-use Postman collection for API testing

Need Help?

Our developer support team is here to help you integrate with our API.