How to Fetch VPIN and CVD Data Using Python via the Buildix API
Technical tutorial: query real-time VPIN, CVD, signal scores, and whale positions from the Buildix API using Python. Code examples included.
$ Stop reading delayed data. Compare live order book depth across 5 exchanges right now.
Launch Free Terminal →The Buildix API gives you programmatic access to real-time orderflow data for 530+ crypto perpetual futures pairs. This tutorial shows you how to fetch VPIN, CVD, signal scores, and whale positions using Python in under 20 lines of code.
The Buildix API provides real-time VPIN, CVD, OBI, signal scores, whale positions, and cross-exchange funding data through a REST interface with JSON responses, documented at buildix.trade/openapi.json.
Prerequisites
You need Python 3.7+ and the requests library. Install it with pip install requests. You will also need a Buildix API key which you can generate from your dashboard at buildix.trade/dashboard/api-keys. The free tier gives you access to the screener and signals endpoints. Paid tiers unlock deep view and smart money endpoints.
Fetching the Full Screener
The screener endpoint returns all 530+ pairs with live price, volume, funding rate, and open interest in a single API call.
`python import requests
API_KEY = "your_buildix_api_key" BASE = "https://www.buildix.trade/api/v1"
resp = requests.get(f"{BASE}/screener", headers={"X-API-Key": API_KEY}) data = resp.json()
for pair in data.get("pairs", [])[:10]: sym = pair["symbol"] price = pair["price"] vol = pair["volume24h"] / 1e6 funding = pair["fundingRate"] * 100 print(f"{sym:8} price={price:>10,.2f} vol={vol:.1f}M funding={funding:.4f}%") ` This prints the top 10 pairs with their price, 24h volume in millions, and funding rate. You can filter by volume, funding, or any other field to build your own screener logic.
Fetching Signal Scores with VPIN and CVD
The signals endpoint returns the composite signal score (-100 to +100), VPIN, CVD direction, and regime classification for every pair.
`python resp = requests.get(f"{BASE}/signals", headers={"X-API-Key": API_KEY}) signals = resp.json()
# Sort by absolute signal strength ranked = sorted(signals.items(), key=lambda x: abs(x[1].get("score", 0)), reverse=True)
for sym, s in ranked[:10]: score = s.get("score", 0) vpin = s.get("vpin", 0) regime = s.get("regime", "n/a") direction = s.get("direction", "NEUTRAL") print(f"{sym:8} score={score:+4d} dir={direction:7} vpin={vpin:.2f} regime={regime}")
# Find pairs with elevated VPIN (informed trading activity) high_vpin = {sym: s for sym, s in signals.items() if s.get("vpin", 0) > 0.35} print(f"\nPairs with elevated VPIN: {len(high_vpin)}") for sym, s in high_vpin.items(): print(f" {sym}: VPIN={s['vpin']:.2f}, score={s['score']:+d}") `
VPIN above 0.35 indicates elevated informed trading activity. When VPIN spikes on a pair it typically means institutional or whale traders are actively positioning before a significant price move. Combining VPIN with the signal score gives you a quick filter for the highest conviction setups.
Getting Detailed Pair Data
The pair endpoint returns comprehensive data for a single symbol including price, orderflow metrics, regime detection, and the full signal breakdown.
`python def get_pair(symbol): resp = requests.get(f"{BASE}/pair/{symbol}", headers={"X-API-Key": API_KEY}) data = resp.json() print(f"\n{'='*40}") print(f"{symbol} @ {data['price']:,.2f}") print(f"Signal: {data.get('signalDirection', 'N/A')} ({data.get('signalScore', 0):+d})") print(f"VPIN: {data.get('vpin', 0):.2f} ({data.get('vpinLevel', 'n/a')})") print(f"Regime: {data.get('regime', 'n/a')}") print(f"Funding: {data.get('fundingRate', 0)*100:.4f}%") return data
btc = get_pair("BTC") eth = get_pair("ETH") sol = get_pair("SOL") `
Tracking Whale Positions
The smart money endpoint returns live positions from 500+ tracked whale wallets on Hyperliquid with labels, account values, leverage, and unrealized PnL.
`python resp = requests.get(f"{BASE}/smart-money", headers={"X-API-Key": API_KEY}) data = resp.json()
print(f"Tracking {data.get('wallets', 0)} whale wallets\n")
for pos in data.get("positions", [])[:15]: label = pos.get("label") or pos.get("address", "???")[:12] side = "LONG" if pos["side"] == "long" else "SHORT" notional_m = pos["notional"] / 1e6 lev = pos["leverage"] pnl_k = pos.get("unrealizedPnl", 0) / 1e3 print(f" {label:15} {pos['symbol']:6} {side:5} ${notional_m:.1f}M {lev:.0f}x PnL: {pnl_k:+.1f}K") `
This gives you the same data you see on the Buildix whale tracker page but in a programmatic format you can pipe into your own trading systems, alerts, or dashboards.
Building a Simple Alert System
Combine the screener and signals endpoints to build a Python alert that notifies you when high conviction setups appear.
`python import time
def scan_for_setups(): resp = requests.get(f"{BASE}/signals", headers={"X-API-Key": API_KEY}) signals = resp.json() for sym, s in signals.items(): score = s.get("score", 0) vpin = s.get("vpin", 0) direction = s.get("direction", "NEUTRAL") if abs(score) >= 30 and vpin > 0.35: print(f"ALERT: {sym} {direction} score={score:+d} vpin={vpin:.2f}")
while True: scan_for_setups() time.sleep(300) # every 5 minutes `
This scans all pairs every 5 minutes and alerts you when the composite signal score exceeds plus or minus 30 AND VPIN is above 0.35. These are the pairs where informed traders are active and the orderflow is giving a directional signal. You can extend this to send Telegram messages, Discord webhooks, or trigger trades on your exchange.
Cross-Exchange Funding Arbitrage
The funding arbitrage endpoint compares funding rates across Hyperliquid, Binance, Bybit, OKX, and dYdX to find arbitrage opportunities.
`python resp = requests.get(f"{BASE}/funding-arb", headers={"X-API-Key": API_KEY}) data = resp.json()
for pair in sorted(data.get("pairs", []), key=lambda x: abs(x.get("maxSpread", 0)), reverse=True)[:10]: sym = pair["symbol"] hl = pair.get("hl", 0) * 100 bn = (pair.get("binance") or 0) * 100 spread = pair.get("maxSpread", 0) * 100 print(f"{sym:8} HL={hl:+.4f}% Binance={bn:+.4f}% spread={spread:.4f}%") `
When the spread exceeds 0.03 percent per 8 hours between two exchanges that is roughly 41 percent annualized which is a significant arbitrage opportunity. The wider the spread the more likely it is to mean revert within 48 hours.
API Reference
The complete OpenAPI specification is available at buildix.trade/openapi.json. You can import it into Postman, Swagger UI, or any OpenAPI-compatible tool to explore all endpoints interactively.
Rate limits depend on your tier. Free tier allows 60 requests per minute on screener and signals. Paid tiers get higher limits and access to deep view and smart money endpoints. Full documentation at buildix.trade/developers.