RealMarketAPI.Sdk 1.0.2

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

RealMarketAPI.Sdk

Official .NET SDK for the RealMarket API — providing real-time market prices, OHLCV candles, historical data, technical indicators, WebSocket streaming, and MCP (Model Context Protocol) support.

.NET NuGet License

Installation

dotnet add package RealMarketAPI.Sdk

Quick Start

1. Register with Dependency Injection

// Program.cs or Startup.cs
builder.Services.AddRealMarketApiClient("YOUR_API_KEY");

Or with full options:

builder.Services.AddRealMarketApiClient(options =>
{
    options.ApiKey = "YOUR_API_KEY";
    options.BaseUrl = "https://api.realmarketapi.com/"; // default
});

2. Inject and Use

public class MarketService(IRealMarketApiClient client)
{
    public async Task PrintPriceAsync()
    {
        // Real-time price
        var price = await client.Ticker.GetPriceAsync("EURUSD", "M1");
        Console.WriteLine($"EURUSD Close: {price.ClosePrice}");

        // Latest OHLCV candles
        var candles = await client.Ticker.GetCandlesAsync("BTCUSDT", "H1");
        foreach (var c in candles.Data)
            Console.WriteLine($"{c.OpenTime}: O={c.OpenPrice} H={c.HighPrice} L={c.LowPrice} C={c.ClosePrice}");

        // SMA(20)
        var sma = await client.Indicators.GetSmaAsync("EURUSD", "H1", period: 20);

        // RSI(14)
        var rsi = await client.Indicators.GetRsiAsync("EURUSD", "H1");

        // MACD
        var macd = await client.Indicators.GetMacdAsync("EURUSD", "H1");

        // Available symbols
        var symbols = await client.Symbols.GetSymbolsAsync();
    }

    public async Task StreamPricesAsync(CancellationToken ct)
    {
        // Real-time WebSocket streaming (requires WebSocket-enabled plan)
        await foreach (var tick in client.WebSocket.StreamPriceAsync("EURUSD", "M1", ct))
            Console.WriteLine($"[WS] {tick.OpenTime}: Close={tick.ClosePrice}");
    }
}

Available Endpoints

Ticker (client.Ticker)

Method Description
GetPriceAsync(symbol, timeframe) Latest real-time ticker with bid/ask
GetMarketPricesAsync() Market overview for all plan symbols
GetCandlesAsync(symbol, timeframe) Latest OHLCV candles
GetHistoryAsync(symbol, start, end, page, size) Paginated historical candle data

Indicators (client.Indicators)

Method Description
GetSmaAsync(symbol, timeframe, period) Simple Moving Average
GetEmaAsync(symbol, timeframe, period) Exponential Moving Average
GetRsiAsync(symbol, timeframe, period=14) Relative Strength Index
GetMacdAsync(symbol, timeframe, fast=12, slow=26, signal=9) MACD line, signal, and histogram
GetBollingerBandsAsync(symbol, timeframe, period=20, multiplier=2) Bollinger Bands (upper, middle, lower)
GetStochasticAsync(symbol, timeframe, kPeriod=14, dPeriod=3) Stochastic Oscillator (%K and %D)
GetAtrAsync(symbol, timeframe, period=14) Average True Range
GetCciAsync(symbol, timeframe, period=20) Commodity Channel Index
GetWilliamsRAsync(symbol, timeframe, period=14) Williams %R
GetAdxAsync(symbol, timeframe, period=14) Average Directional Index (+DI, -DI)
GetSupportResistanceAsync(symbol, timeframe) Support and resistance levels
GetFibonacciAsync(symbol, timeframe, lookback=100) Fibonacci retracement levels
GetSentimentAsync(symbol, timeframe) Market sentiment (trend, fear/greed score)

Symbols (client.Symbols)

Method Description
GetSymbolsAsync() All available trading symbols for your plan

WebSocket (client.WebSocket)

Method Description
StreamPriceAsync(symbol, timeframe, ct) Stream real-time price ticks as IAsyncEnumerable<PriceTickerResult>

Requires a plan with WebSocket support enabled (IsSocketSupport = true). Endpoint: wss://api.realmarketapi.com/price

MCP — Model Context Protocol (client.Mcp)

Exposes the full RealMarket API as MCP tools, callable from AI assistants (GitHub Copilot, Claude, etc.) and from .NET code. Endpoint: https://api.realmarketapi.com/mcp

Method MCP Tool Description
GetPriceAsync(symbol, timeframe) get_price Latest real-time price ticker
GetCandlesAsync(symbol, timeframe) get_candles Latest OHLCV candles
GetHistoryAsync(symbol, start, end, page, size) get_history Paginated historical candles
GetSymbolsAsync() get_symbols All available trading symbols
GetTimeframesAsync() get_timeframes Timeframe codes supported by your plan
GetSmaAsync(symbol, timeframe, period=20) get_sma Simple Moving Average
GetEmaAsync(symbol, timeframe, period=20) get_ema Exponential Moving Average
GetRsiAsync(symbol, timeframe, period=14) get_rsi Relative Strength Index
GetMacdAsync(symbol, timeframe, fast=12, slow=26, signal=9) get_macd MACD line, signal, and histogram
GetBollingerBandsAsync(symbol, timeframe, period=20, multiplier=2) get_bollinger_bands Bollinger Bands (upper, middle, lower)
GetStochasticAsync(symbol, timeframe, kPeriod=14, dPeriod=3) get_stochastic Stochastic Oscillator (%K and %D)
GetAtrAsync(symbol, timeframe, period=14) get_atr Average True Range
GetCciAsync(symbol, timeframe, period=20) get_cci Commodity Channel Index
GetWilliamsRAsync(symbol, timeframe, period=14) get_williams_r Williams %R
GetAdxAsync(symbol, timeframe, period=14) get_adx Average Directional Index (+DI, -DI)
GetSupportResistanceAsync(symbol, timeframe) get_support_resistance Support and resistance levels
GetFibonacciAsync(symbol, timeframe, lookback=100) get_fibonacci Fibonacci retracement and extension levels
GetSentimentAsync(symbol, timeframe) get_sentiment Market sentiment (trend, fear/greed score)

Indicator MCP tools require a Pro plan or higher.

Notes

  • Indicator endpoints require a Pro plan or higher.
  • WebSocket streaming requires a plan with IsSocketSupport = true.
  • Historical data availability depends on your plan's HistoricalRangeMonth.
  • All methods accept an optional CancellationToken.
  • Targets .NET 10.
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.2 22 3/30/2026
1.0.1 39 3/27/2026
1.0.0 39 3/27/2026