FutuCopy.Api.Client 1.0.0

dotnet add package FutuCopy.Api.Client --version 1.0.0
                    
NuGet\Install-Package FutuCopy.Api.Client -Version 1.0.0
                    
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="FutuCopy.Api.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FutuCopy.Api.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FutuCopy.Api.Client" />
                    
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 FutuCopy.Api.Client --version 1.0.0
                    
#r "nuget: FutuCopy.Api.Client, 1.0.0"
                    
#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 FutuCopy.Api.Client@1.0.0
                    
#: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=FutuCopy.Api.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FutuCopy.Api.Client&version=1.0.0
                    
Install as a Cake Tool

FutuCopy API Client for .NET

NuGet License: MIT

The official .NET client library for the FutuCopy Trade Copier API. Build custom dashboards, analytics tools, and automation for your futures trading accounts.

FutuCopy is a cloud trade copier for futures prop traders, supporting Rithmic, Tradovate, NinjaTrader, ProjectX, and dxFeed brokerages with ultra-low latency.

Features

  • Accounts -- Monitor balances, equity, and PnL across all connected brokerage accounts
  • Positions -- Real-time open position data with unrealized PnL
  • Orders -- Query order history with status filtering (live, filled, canceled, rejected)
  • Connections -- Check brokerage connection status
  • Trade Copy -- View leader/follower copy-trading configurations
  • Risk Management -- Access account risk status (profit targets, loss limits)

API Reference

Method Description Endpoint
GetHealthAsync() Check API health status GET /api/v1/health
GetAccountsAsync() List all trading accounts with positions and orders GET /api/v1/accounts
GetAccountAsync(id) Get account detail with risk status GET /api/v1/accounts/{id}
GetConnectionsAsync() List brokerage connections and status GET /api/v1/connections
GetTradeCopyConfigsAsync() List copy-trading leader/follower configurations GET /api/v1/tradecopy
GetFuturesContractsAsync() List available futures contracts GET /api/v1/futurescontracts
EnableTradeCopyAsync(id) Enable copy trading for a leader POST /api/v1/trading/enable
DisableTradeCopyAsync(id) Disable copy trading for a leader POST /api/v1/trading/disable
FlattenAllAsync() Flatten all positions and disable all copy rules POST /api/v1/trading/flatten-all
BuyMarketAsync(id, qty) Place a market BUY order POST /api/v1/trading/buy-market
SellMarketAsync(id, qty) Place a market SELL order POST /api/v1/trading/sell-market

Supported Brokerages

FutuCopy supports trade copying across these futures brokerages:

  • Rithmic
  • Tradovate
  • NinjaTrader
  • ProjectX
  • dxFeed

All brokerages support real-time position sync and ultra-low copy latency. Learn more at futucopy.com.

Installation

dotnet add package FutuCopy.Api.Client

Quick Start

Standalone Usage

using FutuCopy.Api.Client;

using var client = new FutuCopyClient("https://your-server.futucopy.com", "fc_pk_your_api_key_here");

// Check API health
var health = await client.GetHealthAsync();
Console.WriteLine($"API Status: {health.Status}, Version: {health.Version}");

// List all accounts (includes positions and orders)
var accounts = await client.GetAccountsAsync();
foreach (var account in accounts)
{
    Console.WriteLine($"{account.AccountName}: Balance={account.Balance:C}, PnL={account.DailyPnL:C}");
    Console.WriteLine($"  Positions: {account.Positions.Count}, Orders: {account.Orders.Count}");
}

// Get detailed account info with positions and orders
var detail = await client.GetAccountAsync(accountId: 1);
foreach (var position in detail.Positions)
{
    Console.WriteLine($"{position.Symbol}: {position.Quantity} @ {position.AveragePrice}, PnL={position.UnrealizedPnL:C}");
}

Dependency Injection (ASP.NET Core, Worker Services)

// In Program.cs
builder.Services.AddFutuCopy(options =>
{
    options.ApiKey = builder.Configuration["FutuCopy:ApiKey"]!;
    options.BaseUrl = builder.Configuration["FutuCopy:BaseUrl"]!; // your dedicated instance URL
});

// In your service or controller
public class TradingDashboard(IFutuCopyClient futuCopy)
{
    public async Task<AccountResponse> GetAccount(int id)
        => await futuCopy.GetAccountAsync(id);
}

Error Handling

The client throws typed exceptions for different error scenarios:

using FutuCopy.Api.Client.Exceptions;

try
{
    var account = await client.GetAccountAsync(999);
}
catch (FutuCopyAuthenticationException ex)
{
    // 401 - Invalid or missing API key
    Console.WriteLine($"Auth failed: {ex.Error?.Code}");
}
catch (FutuCopyNotFoundException ex)
{
    // 404 - Account not found
    Console.WriteLine($"Not found: {ex.Error?.Message}");
}
catch (FutuCopyRateLimitException)
{
    // 429 - Too many requests
}
catch (FutuCopyApiException ex)
{
    // Other API errors
    Console.WriteLine($"API error {ex.StatusCode}: {ex.Message}, RequestId: {ex.RequestId}");
}

Configuration

var client = new FutuCopyClient("https://your-server.futucopy.com", "fc_pk_your_key", new FutuCopyClientOptions
{
    Timeout = TimeSpan.FromSeconds(30) // default
});

When using DI, you can chain additional HttpClient configuration:

builder.Services.AddFutuCopy(options =>
{
    options.ApiKey = builder.Configuration["FutuCopy:ApiKey"]!;
})
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
{
    // Custom handler settings (proxy, certificates, etc.)
});

Authentication

  1. Log in to your FutuCopy dashboard
  2. Navigate to Pro Server > API Access
  3. Generate an API key (format: fc_pk_...)

Security: Never hardcode API keys in source code. Use environment variables, user secrets, or a configuration provider:

options.ApiKey = Environment.GetEnvironmentVariable("FUTUCOPY_API_KEY")!;

Requirements

  • .NET 10.0 or later
  • FutuCopy Pro plan with API access enabled
  • API key (format: fc_pk_*)

Disclaimer

This software is provided for informational and development purposes. Trading futures involves substantial risk of loss and is not suitable for all investors. FutuCopy is not responsible for any trading losses incurred through the use of this software or API. Past performance is not indicative of future results. Use at your own risk.

See futucopy.com for full terms of service.

License

MIT License -- see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
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
1.0.0 35 2/10/2026