Skip to content

GET /v1/quality

GET https://api.hypquant.com/v1/quality

Returns the Data Quality Score (DQS) for a symbol, with per-component breakdown. Requires an API key.


Parameters

Name Type Required Description
symbol string yes Trading pair, e.g. BTC-USDC
exchange string yes hyperliquid or binance
timeframe string no Filter to one timeframe. Returns all available timeframes if omitted

Response

{
  "exchange": "hyperliquid",
  "symbol": "BTC-USDC",
  "timeframes": {
    "1h": {
      "dqs": "0.972000",
      "computed_at": "2024-06-01T12:00:00+00:00",
      "components": {
        "gap_rate_score": "0.998000",
        "anomaly_score": "0.980000",
        "consistency_score": "0.960000",
        "freshness_score": "0.950000"
      }
    },
    "4h": {
      "dqs": "0.985000",
      "computed_at": "2024-06-01T12:00:00+00:00",
      "components": {
        "gap_rate_score": "0.999000",
        "anomaly_score": "0.990000",
        "consistency_score": "0.960000",
        "freshness_score": "0.990000"
      }
    }
  }
}

Timeframes are returned only for granularities allowed by the caller's tier. Free tier callers will see 1h, 4h, 1d.


DQS formula

DQS = 0.30 × gap_rate_score
    + 0.25 × anomaly_score
    + 0.25 × consistency_score
    + 0.20 × freshness_score
Component Formula
gap_rate_score present_candles / expected_candles over the last 7 days
anomaly_score 1 − (candles_with_zscore_gt_4 / total_candles)
consistency_score 1 if avg basis < 0.5%, otherwise decays linearly to 0 at 2%
freshness_score 1 if latest candle is within SLA, otherwise 0

Freshness SLA by timeframe

Timeframe SLA
1m 5 minutes
5m 15 minutes
15m 30 minutes
1h 90 minutes
4h 6 hours
1d 26 hours

Interpreting DQS

Range Interpretation
0.95 – 1.00 Production-ready
0.85 – 0.95 Minor issues — check the component scores
0.70 – 0.85 Data quality concerns — backtest results may be affected
< 0.70 Significant issues — do not use for production strategies

Examples

from hypquant import MarketData

with MarketData(api_key="qp_...") as md:
    # All timeframes
    quality = md.quality("BTC-USDC", exchange="hyperliquid")
    for tf, dqs in quality["timeframes"].items():
        print(f"{tf}: {dqs['dqs']}")

    # Specific timeframe
    quality = md.quality("BTC-USDC", exchange="hyperliquid", timeframe="1h")
curl -H "X-API-Key: qp_..." \
  "https://api.hypquant.com/v1/quality?symbol=BTC-USDC&exchange=hyperliquid"

Error responses

HTTP error code Cause
401 UNAUTHORIZED Missing or invalid API key
403 TIER_LIMIT_EXCEEDED Requested timeframe not available on current plan
404 QUALITY_NOT_FOUND No quality data computed yet for this symbol/timeframe
429 RATE_LIMIT_EXCEEDED Daily or per-minute request quota reached