Use Case

Crypto trade confirmation API

A trade confirmation API is a single call your bot makes right before entry: it returns whether whale flow and derivatives positioning support your long or short, so your strategy gets an independent market-context check instead of acting on its own signal alone.

Who this is for

Developers running automated crypto strategies who want an API-first risk filter between their entry signal and the exchange. Smart Money API is decision support — it does not place orders for you; your code stays in control of execution and risk.

Prerequisites

  • Python 3.9+ with pip install requests.
  • A strategy that already produces a candidate direction (long or short).
  • A Smart Money API key (free tier covers BTC).

Get your API key

Every request authenticates with the X-API-Key header. To get a key:

  1. 1Create a free account, then open your dashboard.
  2. 2Copy the API key shown under API Access. The free tier covers BTC at 20 requests/day — enough to test this guide end to end.
  3. 3Need more symbols or higher limits? Compare tiers on the pricing page.

Keep the key secret — store it in an environment variable, never commit it to source control.

Setup

  1. 1Install the library: pip install requests.
  2. 2Export your key: export SMA_API_KEY="sm_your_key_here".
  3. 3When your strategy produces a candidate direction, call /v1/confirm as a final context gate before sending the order.
  4. 4Enter only when the action is CONFIRM, sizing by size_mult; reduce or skip otherwise.

Working example

This script takes a candidate direction from your strategy and calls GET /v1/confirm?symbol=BTC&direction=long to validate it before deciding whether to enter.

confirm_trade.py
import os
import requests

API_KEY = os.environ["SMA_API_KEY"]            # never hard-code
SMA_BASE = "https://api.smartmoneyapi.com"

def confirm(symbol: str, direction: str) -> dict:
    """Validate a candidate trade against market context."""
    r = requests.get(
        f"{SMA_BASE}/v1/confirm",
        params={"symbol": symbol, "direction": direction, "source": "my-bot"},
        headers={"X-API-Key": API_KEY},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()

# 1. Your strategy decides a candidate direction
symbol, direction = "BTC", "long"

# 2. Validate it with the trade confirmation API
sig = confirm(symbol, direction)
print(sig["action"], sig["confidence"], "composite", sig["composite"])

# 3. Act on the recommendation (your code executes; the API only advises)
if sig["action"] == "CONFIRM":
    base_qty = 0.01
    qty = base_qty * sig["size_mult"]          # scale by suggested multiplier
    print(f"Would enter {direction} {qty} {symbol}")
elif sig["action"] == "REDUCE":
    print("Context is mixed -> trade smaller or wait for a cleaner setup")
else:  # SKIP
    print("Context does not support this trade -> stand aside")

Expected response

A successful call to /v1/confirm returns JSON like this:

200 OK · application/json
{
  "ts": 1710940821,
  "symbol": "BTC",
  "direction": "long",
  "composite": 0.74,
  "confidence": "HIGH",
  "action": "CONFIRM",
  "size_mult": 1.5,
  "deriv_score": 0.81,
  "onchain_score": 0.68,
  "whale_score": 0.73,
  "reasons": [
    "Funding rate positive across all venues",
    "LSR favors longs: 1.42",
    "Whales: 67% long consensus",
    "MVRV above 1.0 — on-chain bullish"
  ]
}

composite ranges from -1.0 (strong contra) to +1.0 (strong confirm) and blends three sub-scores: deriv_score (derivatives), onchain_score (on-chain), and whale_score (whale consensus). confidence is HIGH or MEDIUM, and size_mult is a 0.0–1.5 suggested size multiplier. See the full field reference in the API docs.

How to act on the response

CONFIRM

Context supports your direction. Proceed with your own entry and risk rules, optionally scaling size by size_mult.

REDUCE

Signals are mixed. Consider a smaller position, tighter stops, or waiting for a cleaner setup.

SKIP

Market context does not support this trade. Stand aside and re-check on the next candidate.

Ready to build?

Grab a free key and make your first confirmation call in under a minute.

Not financial advice. Crypto trading involves risk.