Introduction to OKEx REST API
The OKEx REST API provides a powerful interface for developers to integrate cryptocurrency trading, market data, and account management functionalities into their applications. Representational State Transfer (REST) architecture offers these key advantages:
- Each API endpoint represents a specific resource
- Client-server communication occurs through standardized HTTP methods
- Supports four primary operations: GET, POST, PUT, and DELETE
- Uses JSON format for data exchange
๐ Start trading with OKEx API today
Getting Started with OKEx API
API Endpoints and Authentication
- Base URL:
https://www.okex.com/api/v1 - Protocol: All requests require HTTPS
- Content-Type:
application/x-www-form-urlencoded
Request Workflow
- Parameter Preparation: Format requests according to API specifications
- Request Submission: Send via POST or GET methods
- Server Response: Returns JSON data after security validation
- Data Processing: Handle the response in your application
Market Data API Reference
1. Ticker Information
Endpoint: GET /api/v1/ticker.do
Frequency Limit: 20 requests/2 seconds
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Trading pair (e.g., ltc_btc) |
Response Example:
{
"date":"1410431279",
"ticker":{
"buy":"33.15",
"high":"34.15",
"last":"33.15",
"low":"32.05",
"sell":"33.16",
"vol":"10532696.39199642"
}
}2. Market Depth
Endpoint: GET /api/v1/depth.do
Optional Parameters:
size(1-200, default: 200)
Trading API Documentation
Account Management
User Information Endpoint: POST /api/v1/userinfo.do
Frequency Limit: 6 requests/2 seconds
Response Includes:
- Free balances
- Frozen funds
- Asset details
Order Placement
Trade Endpoint: POST /api/v1/trade.do
Order Types:
- Limit orders (buy/sell)
- Market orders (buy_market/sell_market)
Advanced Features
Batch Processing
- Place multiple orders simultaneously (max 5 per request)
- Cancel up to 3 orders in a single request
Historical Data
- Access complete order history (last 2 days)
- Pagination support (max 200 records per page)
Fund Management API
Withdrawal Processing
Key Parameters:
- Network fee ranges
- Minimum withdrawal amounts
- Address verification
๐ Manage your crypto assets securely
FAQ Section
Q: What's the rate limit for market data API?
A: 20 requests per 2 seconds for most market endpoints.
Q: How do I handle API authentication?
A: All private endpoints require:
- API key
- Request signature
- Timestamp validation
Q: Can I test trades without real funds?
A: OKEx provides a sandbox environment for testing with virtual funds.
Q: What currencies support withdrawals?
A: BTC, LTC, ETH, ETC, and BCH with specific minimum amounts.
Q: How are fees calculated for withdrawals?
A: Network fees vary by currency and affect confirmation speed.
Best Practices for API Integration
- Implement proper error handling
- Use exponential backoff for rate limiting
- Secure your API keys
- Monitor your usage metrics