Overview
Your gateway to programmatic trading and market data on OKX — over REST and WebSocket.
The OKX V5 API is organized into the product areas in the sidebar — Trading Account, Order Book Trading, Market Data, Public Data, Funding, and more. Every endpoint lists its parameters, a real response example, and code snippets.
New to the API? Start with Create an API Key and REST Authentication.
Welcome to our API documentation. OKX provides REST and WebSocket APIs to suit your trading needs.
Important - OKX API Agreement: continued use constitutes acceptance
We encourage you to review the OKX API Agreement in full before continuing to use the API Services. Your continued use of any OKX API Services following the date of this notice constitutes your acceptance of the Agreement in full.
If you do not agree to the Agreement, you must immediately cease all use of the OKX API Services, including disconnecting any active API integrations, Agent Trade Kit connections, and automated systems that access OKX via APIs.
Important - Regional API Domain Requirement
Depending on where you registered, you must use the correct domain for both API calls and documentation.
Using openapi.okx.com will not work for the regions below.
US & AU users (registered on app.okx.com): Use us.okx.com as your API domain. See the US & AU API documentation.
EU users (registered on my.okx.com): Use eea.okx.com as your API domain. See the EU API documentation.

