Skip to content

Installation & First Request

This guide takes you from zero to your first clean candle in under 5 minutes.


1. Install the SDK

pip install hypquant

For pandas support (optional):

pip install "hypquant[pandas]"

Requirements: Python ≥ 3.10, polars ≥ 0.20.


2. Get an API key

  1. Sign up at hypquant.com/signup
  2. Go to Settings → API Keys → Create key
  3. Copy the key — it starts with qp_ and is shown only once

Free tier gives you 1,000 requests/day across 5 assets. No credit card required.


3. First request — OHLCV candles

from hypquant import MarketData

md = MarketData(api_key="qp_your_key_here")

df = md.ohlcv(
    "BTC-USDC",
    exchange="hyperliquid",
    timeframe="1h",
    start="2024-01-01",
)

print(df.head())
# shape: (5, 6)
# ┌─────────────────────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
# │ time                    ┆ open     ┆ high     ┆ low      ┆ close    ┆ volume   │
# │ ---                     ┆ ---      ┆ ---      ┆ ---      ┆ ---      ┆ ---      │
# │ datetime[μs, UTC]       ┆ f64      ┆ f64      ┆ f64      ┆ f64      ┆ f64      │
# ╞═════════════════════════╪══════════╪══════════╪══════════╪══════════╪══════════╡
# │ 2024-01-01 00:00:00 UTC ┆ 42285.0  ┆ 42320.5  ┆ 42180.0  ┆ 42289.0  ┆ 1250.45  │
# └─────────────────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘

4. Check the data quality

quality = md.quality("BTC-USDC", exchange="hyperliquid")
print(quality["timeframes"]["1h"])
# {'dqs': '0.972000', 'computed_at': '2024-06-01T12:00:00+00:00',
#  'components': {'gap_rate_score': '0.998', 'anomaly_score': '0.980',
#                 'consistency_score': '0.960', 'freshness_score': '0.950'}}

A DQS above 0.95 means the data is suitable for production use. See Data Quality for the full formula.


5. Fetch pre-computed features

df = md.features(
    "BTC-USDC",
    exchange="hyperliquid",
    timeframe="1h",
    features=["rsi_14", "macd", "bb_upper", "bb_lower"],
    start="2024-01-01",
    end="2024-01-31",
)
print(df.columns)
# ['time', 'rsi_14', 'macd', 'bb_upper', 'bb_lower']

6. Close the connection

Always close the client when done (or use a context manager):

md.close()
# Recommended: use as a context manager
with MarketData(api_key="qp_...") as md:
    df = md.ohlcv("BTC-USDC", exchange="hyperliquid", timeframe="1h", start="2024-01-01")

Async usage

import asyncio
from hypquant import AsyncMarketData

async def main():
    async with AsyncMarketData(api_key="qp_...") as md:
        df = await md.ohlcv("BTC-USDC", exchange="hyperliquid", timeframe="1h", start="2024-01-01")
        print(df.head())

asyncio.run(main())

Next steps