Skip to main content

GET /v1/indicators

Returns real-time technical indicators for any symbol/timeframe. Computed in pure Rust — no external TA libraries.

Query Parameters

symbol
string
required
Trading pair symbol (e.g., BTCUSDT, ETHUSDT). Must be a valid Binance symbol.
interval
string
default:"4h"
Candlestick interval. Must be one of:
IntervalDescription
1m1 minute
3m3 minutes
5m5 minutes
15m15 minutes
30m30 minutes
1h1 hour
2h2 hours
4h4 hours
6h6 hours
8h8 hours
12h12 hours
1d1 day
3d3 days
1w1 week
1M1 month

Example

curl "https://api.crypton.dev/v1/indicators?symbol=BTCUSDT&interval=4h"
{
  "status": "ok",
  "timestamp": 1709640000000,
  "data": {
    "symbol": "BTCUSDT",
    "timeframe": "4h",
    "rsi": 62.34,
    "macd": {
      "value": 245.67,
      "signal": 198.43,
      "histogram": 47.24
    },
    "bollinger": {
      "upper": 72500.00,
      "middle": 71000.00,
      "lower": 69500.00
    },
    "atr": 850.25,
    "ema20": 71200.50,
    "ema50": 70800.75,
    "timestamp": 1709640000000
  }
}

Response Fields

data.rsi
number
Relative Strength Index (14-period). Range: 0–100.
  • >70 = overbought
  • <30 = oversold
  • Returns 422 if insufficient candle data (<51 candles)
Uses Wilder’s smoothing method (exponential moving average of gains/losses).
data.macd
object
Moving Average Convergence Divergence (12/26/9).
data.bollinger
object
Bollinger Bands (20-period, 2σ). Uses sample standard deviation (n-1) matching TradingView/ta-lib convention.
data.atr
number
Average True Range (14-period). Measures volatility in USD. Higher ATR = more volatile. Used for stop-loss placement and position sizing.
data.ema20
number
20-period Exponential Moving Average. Seeded with SMA of first 20 values.
data.ema50
number
50-period Exponential Moving Average. EMA20 > EMA50 = bullish trend.

Error Responses

StatusCondition
400Invalid interval (not in allowed list)
422Insufficient candle data (<51 candles for the requested interval)
502Failed to fetch candle data from Binance
Indicators are computed from Binance kline data with a 10-second request timeout. For illiquid pairs or during API outages, the endpoint may return 502.

Field Reference

FieldTypeDescriptionGranularityExample
rsinumberRelative Strength Index (14-period, Wilder’s smoothing). 0–100 scalePer candle close62.34
macd.valuenumberMACD line: EMA(12) − EMA(26). Positive = bullish momentumPer candle close245.67
macd.signalnumber9-period EMA of MACD line. Crossovers = buy/sell signalsPer candle close198.43
macd.histogramnumberMACD − Signal. Growing positive = strengthening bull trendPer candle close47.24
bollinger.uppernumberSMA(20) + 2σ (sample std dev). Price near upper = overboughtPer candle close72500.00
bollinger.middlenumber20-period Simple Moving AveragePer candle close71000.00
bollinger.lowernumberSMA(20) − 2σ. Price near lower = oversoldPer candle close69500.00
atrnumberAverage True Range (14-period) in USD. Volatility measurePer candle close850.25
ema20number20-period EMA. Seeded with SMA of first 20 valuesPer candle close71200.50
ema50number50-period EMA. EMA20 > EMA50 = bullish trendPer candle close70800.75

Data Sources

All indicators computed from Binance kline/candlestick data only. 500 candles fetched per request to ensure enough history for accurate indicator calculation. Computation is pure Rust (no external TA libraries). Results reflect the most recent closed candle.

Live Testing

# BTC 4h indicators
curl -s "https://api.crypton.dev/v1/indicators?symbol=BTCUSDT&interval=4h" | jq .

# ETH 1h indicators
curl -s "https://api.crypton.dev/v1/indicators?symbol=ETHUSDT&interval=1h" | jq .