OkCoin provides 3 different methods for our users to call our API interface. Developers can adjust based on their own preference to inquire the market, conduct trading and to withdraw funds.
REST , a.k.a Respresntational State Transfer, is one of the most common web services protocol. REST emphasis on its readability, standardization, interoperabilty and scalability.Advantages:
- Each URL respresented one web resources in RESTful architecture;
- Act as a representation of resources between client and server;
- Client-end is enabled to operate server-side resources with 4 HTTP requests - representational state transfer.
We recommend developers to use REST API to proceed spot trading and withdrawals.
WebSocket protocol is a new HTML5 protocol, which provides full-duplex communication between web browsers and web servers. Connection can be established after one handshake. Web server can then push business logic data to web browsers.Advantages:
- Request header is small in size (around 2 bytes) during communication
- Web servers and clients can send data bi-directionaly
- Since there is no need to create and delete TCP connection repeatedly, it saves resources
We strongly recommend developers to use Websocket API to access market related information and trading depth.