RealMarketAPI.Sdk
1.0.4
See the version list below for details.
dotnet add package RealMarketAPI.Sdk --version 1.0.4
NuGet\Install-Package RealMarketAPI.Sdk -Version 1.0.4
<PackageReference Include="RealMarketAPI.Sdk" Version="1.0.4" />
<PackageVersion Include="RealMarketAPI.Sdk" Version="1.0.4" />
<PackageReference Include="RealMarketAPI.Sdk" />
paket add RealMarketAPI.Sdk --version 1.0.4
#r "nuget: RealMarketAPI.Sdk, 1.0.4"
#:package RealMarketAPI.Sdk@1.0.4
#addin nuget:?package=RealMarketAPI.Sdk&version=1.0.4
#tool nuget:?package=RealMarketAPI.Sdk&version=1.0.4
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.
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 BasicExamplesAsync()
{
// 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 InsightExamplesAsync()
{
// Next-candle forecast with bias and ATR targets
var next = await client.Insight.GetNextAsync("BTCUSD", "H1");
Console.WriteLine($"Bias: {next.Bias} Bull: {next.BullScore} Bear: {next.BearScore}");
Console.WriteLine($"Target Up: {next.TargetUp} Target Down: {next.TargetDown}");
// Trend classification
var trend = await client.Insight.GetTrendAsync("EURUSD", "H4");
Console.WriteLine($"Trend: {trend.Trend} ADX: {trend.Adx}");
// Market setup detection
var setup = await client.Insight.GetSetupAsync("XAUUSD", "M15");
Console.WriteLine($"Setup: {setup.Setup} Direction: {setup.Direction}");
// Confluence signal with strength and reasons
var confluence = await client.Insight.GetConfluenceAsync("BTCUSD", "H1");
Console.WriteLine($"Signal: {confluence.Signal} Strength: {confluence.Strength} Score: {confluence.Score}");
// Composite 0–100 bullish/bearish score
var score = await client.Insight.GetScoreAsync("EURUSD", "H1");
Console.WriteLine($"Score: {score.Score} Label: {score.Label}");
}
public async Task ProModulesExamplesAsync()
{
// Trend direction across all timeframes
var mtf = await client.MultiTimeframe.GetAsync("BTCUSD");
foreach (var (tf, direction) in mtf.Timeframes)
Console.WriteLine($"{tf}: {direction}");
// Liquidity zones (S/R clusters)
var liquidity = await client.Liquidity.GetZonesAsync("XAUUSD", "H1");
foreach (var zone in liquidity.Zones)
Console.WriteLine($"{zone.Type} @ {zone.Price} Strength: {zone.Strength} Touches: {zone.TouchCount}");
// Order flow imbalance
var imbalance = await client.OrderFlow.GetImbalanceAsync("BTCUSD", "M15");
Console.WriteLine($"Imbalance: {imbalance.CurrentImbalance} Bull%: {imbalance.BullishRatio} Bear%: {imbalance.BearishRatio}");
// Stop hunt zones
var stopHunt = await client.StopHunt.GetZonesAsync("EURUSD", "H1");
foreach (var zone in stopHunt.Zones)
Console.WriteLine($"{zone.Type} @ {zone.Price} Hunted: {zone.RecentlyHunted}");
// Anomaly scan
var anomalies = await client.Anomaly.GetAsync("BTCUSD", "M15");
if (anomalies.HasAnomalies)
foreach (var a in anomalies.Anomalies)
Console.WriteLine($"{a.Type} at {a.OpenTime}: {a.Description}");
// Manipulation risk
var risk = await client.Manipulation.GetRiskAsync("XAUUSD", "M15");
Console.WriteLine($"Risk: {risk.RiskLevel} Score: {risk.RiskScore}");
}
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 |
Volatility (client.Volatility)
| Method | Description |
|---|---|
GetVolatilityAsync(symbol, timeframe, period=14) |
Time-series of ATR, ATR%, Bollinger Band Width, and Historical Volatility |
GetSpikesAsync(symbol, timeframe, period=14, spikeMultiplier=2.0) |
Candles where ATR exceeded a multiple of the series average |
GetHeatmapAsync(symbol, timeframe) |
Day-of-Week × Hour-of-Day average true range heatmap |
Available on Starter plan and above. Free plan is not supported.
Insight (client.Insight) — Pro plan required
| Method | Description |
|---|---|
GetNextAsync(symbol, timeframe) |
Next-candle forecast: bias, bull/bear score, ATR-based targets, and 5 signals |
GetTrendAsync(symbol, timeframe) |
Trend classification using EMA alignment and ADX strength |
GetSetupAsync(symbol, timeframe) |
Market setup detection: Breakout, Pullback, Range, or None |
GetConfluenceAsync(symbol, timeframe) |
Actionable signal (Buy / Sell / Neutral) with strength rating and scored reasons |
GetScoreAsync(symbol, timeframe) |
Composite 0–100 bullish/bearish score from five equally-weighted components |
Multi-Timeframe (client.MultiTimeframe) — Pro plan required
| Method | Description |
|---|---|
GetAsync(symbol) |
Trend direction across all plan-allowed timeframes in a single call |
Liquidity (client.Liquidity) — Pro plan required
| Method | Description |
|---|---|
GetZonesAsync(symbol, timeframe) |
Key S/R clusters acting as liquidity pools, sorted nearest-first |
Order Flow (client.OrderFlow) — Pro plan required
| Method | Description |
|---|---|
GetImbalanceAsync(symbol, timeframe) |
Bullish/Bearish/Neutral imbalance from last 50 candles + abnormal-body zones |
Stop Hunt (client.StopHunt) — Pro plan required
| Method | Description |
|---|---|
GetZonesAsync(symbol, timeframe) |
Stop-cluster zones beyond key S/R levels; flags recently hunted levels |
Anomaly (client.Anomaly) — Pro plan required
| Method | Description |
|---|---|
GetAsync(symbol, timeframe) |
Scans last 50 candles for PriceSpike, UnusualVolume, and FakeBreakout anomalies |
Manipulation Risk (client.Manipulation) — Pro plan required
| Method | Description |
|---|---|
GetRiskAsync(symbol, timeframe) |
Composite manipulation risk score (0–100) from wick ratio, volume divergence, and fake breakouts |
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) |
GetVolatilityAsync(symbol, timeframe, period=14) |
get_volatility |
Volatility time-series (ATR, ATR%, Band Width, Historical Volatility) |
GetVolatilitySpikesAsync(symbol, timeframe, period=14, spikeMultiplier=2.0) |
get_volatility_spikes |
Volatility spike candles |
GetVolatilityHeatmapAsync(symbol, timeframe) |
get_volatility_heatmap |
Day-of-Week × Hour-of-Day volatility heatmap |
Indicator MCP tools require a Pro plan or higher.
Volatility MCP tools require a Starter plan or higher.
Notes
- Pro plan required for: Indicator, Insight, Multi-Timeframe, Liquidity, Order Flow, Stop Hunt, Anomaly, and Manipulation endpoints.
- Starter plan required for Volatility endpoints (Free plan not supported).
- 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.