Quickstart

Go from zero to a completed backtest in five steps using the BitPredict API.

1

Generate your API key

Go to Settings → API Keys and click Generate Key. Copy the full key — it is shown only once. Store it in an environment variable:

export BITPREDICT_API_KEY="bp_live_your_key_here"
2

Explore available data

Fetch the catalog to see all available exchanges, symbols, bar types, and timeframes.

curl -X GET "https://api.bitpredict.ai/v1/data/catalog" \
  -H "X-API-Key: $BITPREDICT_API_KEY"
Response
{
  "exchanges": ["bybit", "binance"],
  "symbols": ["BTCUSDT", "ETHUSDT"],
  "bar_types": ["time", "tick", "volume", "dollar"],
  "timeframes": { "time": ["1m", "5m", "15m", "1h", "4h", "1d"] },
  "total_bars": 14250000
}
3

Fetch OHLCV bars for BTC

Retrieve the 10 most recent hourly bars for BTCUSDT on Bybit.

curl -X GET "https://api.bitpredict.ai/v1/data/bars/time?exchange=bybit&symbol=BTCUSDT&timeframe=1h&page_size=10&sort=desc" \
  -H "X-API-Key: $BITPREDICT_API_KEY"
Response
{
  "data": [
    { "timestamp": "2026-05-19T10:00:00Z", "open": 103250.5, "high": 103890.0, "low": 103100.0, "close": 103700.0, "volume": 1248.35 },
    { "timestamp": "2026-05-19T09:00:00Z", "open": 102800.0, "high": 103400.0, "low": 102500.0, "close": 103250.5, "volume": 1102.7 }
  ],
  "page": 1,
  "page_size": 10,
  "total": 46848
}
4

Browse strategies by Sharpe ratio

List the top 5 strategies ranked by Sharpe ratio descending. Use the slug in the next step.

curl -X GET "https://api.bitpredict.ai/v1/strategies?sort_by=sharpe_ratio&sort_dir=desc&page_size=5" \
  -H "X-API-Key: $BITPREDICT_API_KEY"
5

Submit a backtest and fetch results

Submit a backtest request, poll until completion, then retrieve analytics.

# 1. Submit
curl -X POST "https://api.bitpredict.ai/v1/backtest/requests" \
  -H "X-API-Key: $BITPREDICT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"strategy_slug": "btc-momentum-v1", "start_date": "2024-01-01", "end_date": "2026-01-01", "initial_capital": 10000}'

# 2. Poll
curl -X GET "https://api.bitpredict.ai/v1/backtest/requests/123" \
  -H "X-API-Key: $BITPREDICT_API_KEY"

# 3. Fetch analytics
curl -X GET "https://api.bitpredict.ai/v1/backtest/requests/123/analytics?strategy_slug=btc-momentum-v1" \
  -H "X-API-Key: $BITPREDICT_API_KEY"

That is it — you have a complete backtest via the API.

Next, explore the Strategies reference to browse published strategies, or the Optimization reference to run hyperparameter search jobs.

Quickstart · BitPredict