OKX.Api 5.6.427

dotnet add package OKX.Api --version 5.6.427
                    
NuGet\Install-Package OKX.Api -Version 5.6.427
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OKX.Api" Version="5.6.427" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OKX.Api" Version="5.6.427" />
                    
Directory.Packages.props
<PackageReference Include="OKX.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OKX.Api --version 5.6.427
                    
#r "nuget: OKX.Api, 5.6.427"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OKX.Api@5.6.427
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OKX.Api&version=5.6.427
                    
Install as a Cake Addin
#tool nuget:?package=OKX.Api&version=5.6.427
                    
Install as a Cake Tool

OKX.Api

OKX.Api is a .NET wrapper for the OKX V5 REST and WebSocket APIs.

The project aims to stay close to the official OKX surface while still feeling natural in C#:

  • section-based clients such as api.Account, api.Trade, api.Public, and api.Funding
  • typed request and response models instead of loose dictionaries
  • REST and WebSocket coverage in the same package
  • support for both public and authenticated workflows
  • examples, fixtures, and integration coverage for the live API

Installation

Available on NuGet:

Install-Package OKX.Api

The package currently targets:

  • netstandard2.0
  • netstandard2.1

Quick Start

Add the namespace:

using OKX.Api;

Create a REST client for public endpoints:

var api = new OkxRestApiClient();

var instruments = await api.Public.GetInstrumentsAsync(OkxInstrumentType.Spot);
var ticker = await api.Public.GetTickerAsync("BTC-USDT");

if (ticker.Success)
{
    Console.WriteLine($"{ticker.Data!.InstrumentId}: {ticker.Data.LastPrice}");
}

Create a REST client for private endpoints:

var api = new OkxRestApiClient();
api.SetApiCredentials("YOUR-API-KEY", "YOUR-API-SECRET", "YOUR-API-PASSPHRASE");

var balances = await api.Account.GetBalancesAsync();
var openOrders = await api.Trade.GetOpenOrdersAsync();

Create a WebSocket client:

var ws = new OkxWebSocketApiClient();

var subscription = await ws.Public.SubscribeToTickersAsync(
    data => Console.WriteLine($"{data.InstrumentId} {data.LastPrice}"),
    "BTC-USDT");

// later
await ws.UnsubscribeAsync(subscription.Data!);

Documentation

The root README is intentionally short. Full documentation now lives in docs/.

REST Sections

OkxRestApiClient is organized around OKX sections:

  • Account
  • Trade
  • Algo
  • Grid
  • DCA
  • SignalBot
  • RecurringBuy
  • CopyTrading
  • Public (Market is an alias)
  • Block
  • Spread
  • Rubik (TradingStatistics is an alias)
  • Funding
  • SubAccount
  • Financial
  • Broker
  • Affiliate

Each section now has its own reference page under docs/reference.

Examples

The repository includes a dedicated examples project:

It contains end-to-end sample calls across REST and WebSocket sections and is a good place to explore the current API surface quickly.

Changelog

Release notes were moved out of the root file into split documents:

Official OKX Documentation

This wrapper follows the official OKX documentation:

Where behavior differs in practice, the wrapper and its tests prefer live API behavior over stale examples whenever possible.

Support

If you think something is broken, something is missing, or you have a question, please open an issue.

If you want to support maintenance, the original donation addresses are kept here:

  • BTC: 33WbRKqt7wXARVdAJSu1G1x3QnbyPtZ2bH
  • ETH: 0x65b02db9b67b73f5f1e983ae10796f91ded57b64
  • USDT (TRC-20): TXwqoD7doMESgitfWa8B2gHL7HuweMmNBJ
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.6.427 104 4/27/2026
5.6.426 111 4/26/2026
5.6.216 1,358 2/16/2026
5.6.210 1,367 2/9/2026
5.6.209 1,369 2/9/2026
5.6.111 6,114 1/11/2026
5.5.1209 7,186 12/9/2025
5.5.1107 6,894 11/7/2025
5.5.1101 6,796 11/1/2025
5.5.1019 7,004 10/19/2025
5.5.1013 6,637 10/13/2025
5.5.1011 6,508 10/10/2025
5.5.1010 6,400 10/10/2025
5.5.1004 6,421 10/4/2025
5.5.924 9,434 9/24/2025
5.5.917 9,374 9/17/2025
5.5.903 9,903 9/3/2025
5.5.814 10,835 8/12/2025
5.5.813 10,656 8/11/2025
Loading failed