DEVELOPER REFERENCE

Drift API

REST API for systematic alpha research. All endpoints require an X-API-Key header. Base URL: https://drift-api-production-4337.up.railway.app

Get a free keyView on GitHub โ†—

Authentication

Pass your key in the X-API-Key header for every authenticated request.

curl https://drift-api-production-4337.up.railway.app/auth/me \
  -H "X-API-Key: dk_free_your_key_here"

Endpoints reference

POST/auth/signupFREE + PRO

Issue an API key for an email address.

Request body
{ "email": "you@example.com" }
Response shape
{ "key": "dk_free_...", "tier": "free" }
GET/auth/meFREE + PRO

Check key usage and tier. Headers: X-API-Key required.

Request body
No request body
Response shape
{ "email": "...", "tier": "free", "requests_today": 3, "daily_limit": 50 }
POST/signals/computeFREE (5 tickers) ยท PRO (50 tickers)

Compute IC-weighted factor signals and detect market regime.

Request body
{ "tickers": ["RELIANCE", "TCS", "INFY"], "provider": "kite", "benchmark": "^NSEI" }
Response shape
{ "regime": { "label": "bull", ... }, "signals": [...], "factors": [...] }
POST/portfolio/analyzeFREE (5 holdings) ยท PRO (50 holdings)

Full factor/risk decomposition of a portfolio. Returns holdings analysis, concentration metrics, correlation clusters, stress test, and HRP rebalance suggestion.

Request body
{ "weights": { "RELIANCE": 25, "TCS": 20, "INFY": 20, "HDFCBANK": 20, "ICICIBANK": 15 } }
Response shape
{ "annualised_vol": 0.18, "sharpe": 0.70, "holdings": [...], "rebalance": {...}, ... }
POST/portfolio/reportPRO ONLY

Generate a downloadable PDF report. Returns application/pdf binary.

Request body
Same as /portfolio/analyze
Response shape
Binary PDF file
POST/screenFREE (top 10) ยท PRO (all results)

Screen a named NSE universe by factor scores. Returns ranked stocks with classification.

Request body
{ "universe": "nifty50", "sort_by": "composite", "provider": "kite" }
Response shape
{ "results": [...], "current_regime": "bull", "is_truncated": false, ... }
POST/portfolio/optimiseFREE (5 tickers, HRP only) ยท PRO (50 tickers, all methods)

Optimise portfolio weights using HRP, Black-Litterman, or CVaR.

Request body
{ "tickers": ["RELIANCE", "TCS"], "method": "hrp" }
Response shape
{ "weights": [...], "effective_n": 1.9 }

Python quickstart

import requests

BASE = "https://drift-api-production-4337.up.railway.app"
KEY  = "dk_free_your_key_here"

def drift(path, body):
    return requests.post(
        f"{BASE}{path}",
        json=body,
        headers={"X-API-Key": KEY}
    ).json()

# Compute signals
signals = drift("/signals/compute", {
    "tickers": ["RELIANCE", "TCS", "INFY"],
    "provider": "kite"
})
print(signals["regime"]["label"])   # "bull"

# Analyse portfolio
report = drift("/portfolio/analyze", {
    "weights": {"RELIANCE": 30, "TCS": 40, "INFY": 30}
})
print(report["annualised_vol"])     # 0.18

Rate limits

TierRequests/dayMax tickersPDF reports
Free505โ€”
Pro2,00050โœ“
View pricing โ†’