API reference
Client methods, parameters and response types exported by okx-api. The same API works in JavaScript and TypeScript.
Clients
Common methods
| Task | Method |
|---|---|
| Public ticker | getTicker |
| Instrument metadata | getInstruments |
| Order-book snapshot | getOrderBook |
| Trading-account balances | getBalance |
| Funding-account balances | getBalances |
| Submit / amend / cancel | submitOrder, amendOrder, cancelOrder |
| Recover one order | getOrderDetails |
| Open orders and positions | getOrderList, getPositions |
| Order and execution history | getOrderHistory, getFills |
| Subscribe to updates | subscribe |
| WebSocket order command | submitNewOrder |
Search methods and types with ⌘K / Ctrl+K. Use the authentication, order lifecycle and private stream guides for complete workflows.