Santiment Whale Movements API: Track Smart Money Flows
Learn to use Santiment's Whale Movements API with Python to detect large on-chain transactions, build spike alerts, and make data-driven trading decisions in real time.
Learn to use Santiment's Whale Movements API with Python to detect large on-chain transactions, build spike alerts, and make data-driven trading decisions in real time.
Whale movements tell you what big money is doing before it shows up in price. A single wallet moving 10,000 BTC isn't noise — it's signal. The Santiment Whale Movements API gives you programmatic access to exactly that data: large on-chain transfers, exchange inflows from major holders, and accumulation patterns that precede significant market moves. If you've ever been trading on Binance or OKX and watched your position get wrecked for no obvious reason, there's a good chance the answer was sitting in on-chain data you weren't watching.
Santiment's API is built around a GraphQL interface and covers dozens of on-chain metrics. For whale tracking specifically, the most useful ones are: whale_transaction_count_100k_usd_to_inf (transactions over $100k), whale_transaction_count_1m_usd_to_inf (over $1M), top holders data, and exchange whale ratio — how much whale activity is flowing into exchanges versus cold wallets. That last distinction is critical. Whales moving coins onto Coinbase or Binance typically precedes selling pressure, while outflows often signal accumulation before a move up.
You'll need a Santiment account and an API key. The free tier gives you limited historical range and rate limits; pro plans unlock longer lookbacks and higher query limits. Authentication is a simple header — no OAuth dance, no token refresh loops. Every request just needs the Apikey prefix in the Authorization header. Start by verifying your credentials before building anything on top of them.
import requests
import os
# Load from environment — never hardcode keys in scripts
API_KEY = os.environ.get("SANTIMENT_API_KEY", "your_key_here")
API_URL = "https://api.santiment.net/graphql"
headers = {
"Authorization": f"Apikey {API_KEY}",
"Content-Type": "application/json"
}
# Verify your key works before building anything on top of it
test_query = "{ currentUser { id email } }"
response = requests.post(
API_URL,
json={"query": test_query},
headers=headers,
timeout=15
)
if response.status_code == 200:
data = response.json()
user = data.get("data", {}).get("currentUser")
if user:
print(f"Authenticated as: {user['email']}")
else:
print("Check your API key — currentUser returned null")
else:
print(f"Request failed: {response.status_code} - {response.text}")
Store your API key in an environment variable (SANTIMENT_API_KEY) and load it with python-dotenv. Never commit it to version control — Santiment keys give access to paid data and rate limit quotas that affect your whole operation.
The core query pattern uses getMetric with a metric name, asset slug, date range, and interval. The slug is Santiment's identifier for each asset — 'bitcoin', 'ethereum', 'solana', etc. Intervals can be '1h', '4h', '1d', or '7d' depending on your timeframe. For swing traders monitoring Bybit and Binance positions, daily data is usually sufficient. For shorter-term setups, hourly granularity gives you earlier signals at the cost of more noise.
def get_whale_transactions(slug, from_date, to_date, interval="1d", threshold="100k"):
metric = "whale_transaction_count_%s_usd_to_inf" % threshold
query = (
'{ getMetric(metric: "%s") {'
' timeseriesData(slug: "%s"'
' from: "%s" to: "%s" interval: "%s")'
' { datetime value } } }'
) % (metric, slug, from_date, to_date, interval)
try:
response = requests.post(
API_URL,
json={"query": query},
headers=headers,
timeout=30
)
response.raise_for_status()
result = response.json()
if "errors" in result:
print("GraphQL errors:", result["errors"])
return []
return result["data"]["getMetric"]["timeseriesData"]
except requests.exceptions.Timeout:
print("Timed out — try a shorter date range or increase timeout")
return []
except requests.exceptions.HTTPError as e:
print("HTTP error:", e.response.status_code)
return []
except (KeyError, TypeError) as e:
print("Unexpected response structure:", e)
return []
# Fetch BTC whale transactions over $100k for January 2024
txns = get_whale_transactions(
slug="bitcoin",
from_date="2024-01-01T00:00:00Z",
to_date="2024-01-31T00:00:00Z",
interval="1d"
)
for point in txns:
print(f"{point['datetime'][:10]}: {int(point['value'])} large transactions")
Raw whale transaction counts are useful, but what you actually want is anomaly detection — catching the days when whale activity spikes well above the baseline. A 7-day rolling average with a multiplier threshold works surprisingly well for this. When you see 2–3x the normal number of large transactions, something is usually brewing. Platforms like VoiceOfChain already process this signal in real time across multiple assets, but building your own gives you flexibility to customize thresholds per coin and combine with exchange-specific order book data from Binance or KuCoin.
import statistics
def detect_whale_spikes(transactions, window=7, multiplier=2.0):
# Flag days where whale activity significantly exceeds rolling average
if len(transactions) < window + 1:
print(f"Need at least {window + 1} data points, got {len(transactions)}")
return []
values = [t["value"] for t in transactions]
alerts = []
for i in range(window, len(transactions)):
rolling_avg = statistics.mean(values[i - window:i])
current = values[i]
# Skip zero-baseline days to avoid meaningless ratios
if rolling_avg == 0:
continue
spike_ratio = current / rolling_avg
if spike_ratio >= multiplier:
alerts.append({
"date": transactions[i]["datetime"][:10],
"count": int(current),
"avg": round(rolling_avg, 1),
"factor": round(spike_ratio, 2),
"level": "HIGH" if spike_ratio >= 3.0 else "MODERATE"
})
return alerts
spikes = detect_whale_spikes(txns, window=7, multiplier=2.0)
if not spikes:
print("No significant whale spikes in this period")
else:
print(f"Found {len(spikes)} spike(s):")
for s in spikes:
print(f" [{s['level']}] {s['date']}: {s['count']} txns ({s['factor']}x avg of {s['avg']})")
Whale data doesn't give you a buy or sell button — it gives you context. The direction matters as much as the volume. High whale transaction counts combined with rising exchange inflows (query the exchange_whale_ratio metric) typically signals distribution — whales moving coins to sell on Binance, Bybit, or OKX. High counts with stable or falling exchange balances suggests accumulation. That's the setup most traders want to be buying into, not fading.
VoiceOfChain aggregates whale movement signals alongside order flow and volume imbalance data in real time, which means you can cross-reference the on-chain picture with what's actually happening in the order books on Gate.io or Bitget at that exact moment. The combination — whale accumulation on-chain plus strong bid pressure showing up in the book — is one of the more reliable setups in current market structure. Either signal alone is interesting; both together is a trade.
| Whale Txn Count | Exchange Inflow | Likely Scenario | Directional Bias |
|---|---|---|---|
| High spike | Rising | Distribution — whales selling into exchanges | Bearish |
| High spike | Falling | Accumulation — whales pulling coins off exchanges | Bullish |
| High spike | Neutral | OTC move or internal transfer, no clear direction | Neutral / Wait |
| Low / flat | Any | No whale conviction either way | Stand aside |
| Gradual rise | Falling steadily | Quiet accumulation phase building | Bullish |
Never trade on a single whale spike in isolation. Always confirm with price action and at least one other on-chain metric. Whales also generate noise — internal treasury moves and exchange-to-exchange transfers look like spikes but carry no directional signal at all.
The Santiment Whale Movements API gives you a programmatic window into what the largest market participants are doing — and that information advantage is real. The setup is straightforward: authenticate with your API key, query the relevant whale metrics via GraphQL with proper error handling, and layer in rolling-average anomaly detection to surface the spikes that actually matter. Combine the on-chain picture with exchange order flow from platforms like Binance or Bybit, cross-reference with real-time signals on VoiceOfChain, and you have a decision framework that most retail traders simply don't have access to. The edge isn't in the data itself — it's in acting on it systematically while everyone else is still guessing.