Alerts & APIIntermediate
7 min read

Access the API

Generate an API key, make your first authenticated request, understand rate limits, and start using the 60+ available endpoints.

BitPredict provides a REST API with 60+ endpoints across 8 domains. You can fetch market data, retrieve strategy performance, submit backtests, manage alerts, and interact with virtual accounts programmatically. This guide gets you from zero to your first authenticated API call.

1

Generate an API key

Go to Settings → API Keys → Generate New Key. Give it a descriptive name (e.g. "My Trading Bot"). Select the scopes you need: Market Data (read-only), Strategies (read-only), Backtests (read + write), Alerts (read + write), Accounts (read + write). Click Generate. Copy the key — you'll only see it once.
2

Read the authentication docs

Go to /api-docs/authentication. BitPredict uses API key authentication — pass your key in the X-API-Key request header on every request.
3

Make your first request

Fetch BTC/USDT time bar data:
curl -X GET "https://api.bitpredict.ai/v1/market-data/ohlcv?symbol=BTCUSDT&bar_type=time&timeframe=1h&limit=100" \
  -H "X-API-Key: your_api_key_here"
You should receive a JSON array of OHLCV bars with regime metadata.
4

Handle rate limits

Check the response headers:
  • X-RateLimit-Limit — requests per minute allowed
  • X-RateLimit-Remaining — requests remaining in the current window
  • X-RateLimit-Reset — Unix timestamp when the window resets
If you receive a 429 response, wait until the reset timestamp before retrying. Implement exponential backoff for production code.
5

Explore the 8 API domains

  • Market Data (OHLCV, regimes, on-chain)
  • Strategies (list, detail, signals)
  • Backtests (submit, status, results)
  • Optimization (submit, trials)
  • Strategy Builder (save, activate)
  • Alerts (subscriptions, history)
  • Virtual Accounts (create, assign, P&L)
  • Demo Trading (accounts, assignments, ledger)
Full endpoint list at /api-docs/reference.
6

Install an SDK (optional)

  • Python: pip install bitpredict-python
  • JavaScript: npm install @bitpredict/sdk
SDK usage:
from bitpredict import Client

client = Client(api_key="your_api_key_here")
bars = client.market_data.get_ohlcv(
    symbol="BTCUSDT",
    bar_type="time",
    timeframe="1h",
    limit=100
)
7

Review the changelog

Check /api-docs/changelog before upgrading SDK versions. Breaking changes are clearly flagged. Subscribe to the changelog RSS feed or check it before any production deployment.

Start with read-only Market Data and Strategy endpoints before adding write permissions. Build confidence in the API's behaviour with safe, idempotent requests before submitting backtests or modifying account state.

Never commit your API key to version control. Use environment variables: BITPREDICT_API_KEY=your_key_here and load with os.environ.get("BITPREDICT_API_KEY") in Python or process.env.BITPREDICT_API_KEY in Node.js.

Access the API · BitPredict