Tradier.Client
1.0.1
See the version list below for details.
dotnet add package Tradier.Client --version 1.0.1
NuGet\Install-Package Tradier.Client -Version 1.0.1
<PackageReference Include="Tradier.Client" Version="1.0.1" />
<PackageVersion Include="Tradier.Client" Version="1.0.1" />
<PackageReference Include="Tradier.Client" />
paket add Tradier.Client --version 1.0.1
#r "nuget: Tradier.Client, 1.0.1"
#:package Tradier.Client@1.0.1
#addin nuget:?package=Tradier.Client&version=1.0.1
#tool nuget:?package=Tradier.Client&version=1.0.1
<div align="center">
Tradier.Client
A Modern .NET SDK for the Tradier Brokerage API
Build powerful trading applications with real-time market data, options chains, and order execution.
Installation • Quick Start • Services • Examples • License
</div>
✨ Features
- Multi-Framework Support — .NET 8, .NET 9, and .NET 10
- Complete API Coverage — Market data, trading, accounts, watchlists, and streaming
- Options Trading — Full options chains with Greeks (Delta, Gamma, Theta, Vega, IV)
- Production Ready — Battle-tested with comprehensive error handling
- Async/Await — Fully asynchronous API for optimal performance
- Dependency Injection — First-class ASP.NET Core integration
- Paper Trading — Sandbox environment for risk-free testing
- Thread-Safe — No static state, safe for multi-tenant applications
Installation
Install via NuGet Package Manager:
dotnet add package Tradier.Client
Or via the Package Manager Console:
Install-Package Tradier.Client
Quick Start
1. Get Your API Credentials
- Create an account at tradier.com
- Navigate to API Settings
- Generate your API token (sandbox for testing, production for live trading)
2. Initialize the Client
Console / Desktop Applications:
using Tradier;
using Tradier.Services;
// Create authentication with your api key
var auth = new TradierAuthentication("YOUR_API_KEY");
// Create client (use TradierSandboxClient for paper trading)
var client = new TradierSandboxClient(auth);
// Use the services
var marketData = new MarketDataService(client);
var quotes = await marketData.GetQuotes(true, "AAPL", "MSFT", "GOOGL");
ASP.NET Core Applications:
// Program.cs
using Tradier.Extensions;
// One-liner setup (defaults to sandbox for safety)
builder.Services.AddTradier("YOUR_API_KEY");
// Or with configuration options
builder.Services.AddTradier(options =>
{
options.ApiKey = builder.Configuration["Tradier:ApiKey"]!;
options.UseSandbox = builder.Environment.IsDevelopment();
});
// Inject services directly into your controllers
public class MarketController : ControllerBase
{
private readonly MarketDataService _market;
public MarketController(MarketDataService market) => _market = market;
[HttpGet("quote/{symbol}")]
public async Task<IActionResult> GetQuote(string symbol)
{
var result = await _market.GetQuotes(true, symbol);
return result.IsSuccessful ? Ok(result.Data) : BadRequest(result.ErrorMessage);
}
}
3. Fetch Market Data
var marketData = new MarketDataService(client);
// Get real-time quotes
var quotes = await marketData.GetQuotes(true, "AAPL", "MSFT", "GOOGL");
// Get options chain with Greeks
var chain = await marketData.GetOptionChains("AAPL", expirationDate, includeAllGreeks: true);
Available Services
| Service | Description |
|---|---|
MarketDataService |
Real-time quotes, options chains, historical data, market calendar |
AccountService |
Balances, positions, order history, gain/loss reports |
TradingService |
Equity and options order placement, modifications, cancellations |
WatchlistService |
Create, update, and manage watchlists |
StreamingService |
Real-time streaming quotes and events (production only) |
Client Types
| Client | Environment | Use Case |
|---|---|---|
TradierSandboxClient |
sandbox.tradier.com | Paper trading & development |
TradierClient |
api.tradier.com | Live trading with real funds |
⚠️ Important: Always test thoroughly with the sandbox environment before using production credentials.
Examples
Fetching Options Data
var auth = new TradierAuthentication("YOUR_API_KEY");
var client = new TradierSandboxClient(auth);
var marketData = new MarketDataService(client);
// Get available expiration dates
var expirations = await marketData.GetOptionExpirations("AAPL");
var nextExpiration = expirations.Data?.Dates?.First();
// Fetch the full options chain with Greeks
var chain = await marketData.GetOptionChains(
symbol: "AAPL",
expiration: DateTime.Parse(nextExpiration),
includeAllGreeks: true
);
// Process the data
foreach (var option in chain.Data?.Options ?? [])
{
Console.WriteLine($"{option.Symbol}");
Console.WriteLine($" Strike: ${option.Strike}");
Console.WriteLine($" Bid/Ask: ${option.Bid} / ${option.Ask}");
Console.WriteLine($" Delta: {option.Greeks?.Delta:F4}");
Console.WriteLine($" IV: {option.Greeks?.MidIv:P2}");
}
Placing an Order
var auth = new TradierAuthentication("YOUR_API_KEY");
var client = new TradierSandboxClient(auth);
var trading = new TradingService(client);
// Place a limit order
var order = await trading.PlaceEquityOrder(
accountId: "YOUR_ACCOUNT_ID",
symbol: "AAPL",
side: OrderSide.Buy,
quantity: 10,
type: OrderType.Limit,
price: 150.00m,
duration: OrderDuration.Day
);
if (order.IsSuccessful)
{
Console.WriteLine($"Order placed: {order.Data?.Id}");
}
Error Handling
var result = await marketData.GetQuotes(true, "AAPL");
if (result.IsSuccessful)
{
// Access the data
var quote = result.Data;
}
else
{
// Handle the error
Console.WriteLine($"Error: {result.ErrorMessage}");
Console.WriteLine($"Status: {result.StatusCode}");
}
Configuration
Using User Secrets (Recommended for Development)
dotnet user-secrets set "Tradier:ApiKey" "your-token-here"
var config = new ConfigurationBuilder()
.AddUserSecrets<Program>()
.Build();
var auth = new TradierAuthentication(config["Tradier:ApiKey"]!);
var client = new TradierSandboxClient(auth);
Using Custom HttpClient
For advanced scenarios (proxies, custom handlers, etc.):
var httpClient = new HttpClient();
// Configure httpClient as needed...
var auth = new TradierAuthentication("YOUR_API_KEY");
var client = new TradierClient(httpClient, auth);
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License — see the LICENSE file for details.
Disclaimer
This SDK is an independent project and is not affiliated with, endorsed by, or connected to Tradier Inc. Use of this software for trading involves financial risk. Always verify order details before execution, especially in production environments. The authors assume no responsibility for financial losses incurred through the use of this software.
<div align="center">
Tradier API Docs · Report Bug · Request Feature
Made with ❤️ by Pennyworth Labs
</div>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
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.2 | 105 | 2/6/2026 |
| 1.0.1 | 221 | 2/1/2026 |
| 1.0.0 | 95 | 2/1/2026 |
| 1.0.0-preview | 91 | 2/1/2026 |
v1.0.1: Removed static TradierConfig, simplified authentication to ApiKey-only, added StreamingService for real-time market data, improved DI support, added comprehensive constructor tests.