Integration Guide

Use Smart Money API alongside CCXT

Read live market data with CCXT, ask Smart Money API whether whale flow and derivatives positioning confirm your direction, then place the order on the exchange of your choice.

Who this is for

Python developers building exchange-agnostic bots on CCXT who want an independent market-context check before each order. Smart Money API is decision support — it does not place orders for you; CCXT stays in control of execution.

Prerequisites

  • Python 3.9+ with pip install ccxt requests.
  • Exchange API keys configured for CCXT (read-only is fine to test).
  • 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 libraries: pip install ccxt requests.
  2. 2Export your key: export SMA_API_KEY="sm_your_key_here".
  3. 3Let your strategy decide a candidate direction from CCXT market data, then call /v1/confirm as a final context gate.
  4. 4Place the order with CCXT only when the action is CONFIRM, sizing by size_mult.

Working example

This script reads a ticker with CCXT, derives a candidate direction, then calls GET /v1/confirm?symbol=BTC&direction=long before deciding whether to place the order.

ccxt_confirm.py
import os
import ccxt
import requests

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

exchange = ccxt.binance()                       # any CCXT exchange

def confirm(symbol: str, direction: str) -> dict:
    """Ask Smart Money API for market-context confirmation."""
    r = requests.get(
        f"{SMA_BASE}/v1/confirm",
        params={"symbol": symbol, "direction": direction, "source": "ccxt-bot"},
        headers={"X-API-Key": API_KEY},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()

# 1. Read market data with CCXT and pick a candidate direction
ticker = exchange.fetch_ticker("BTC/USDT")
direction = "long" if ticker["percentage"] and ticker["percentage"] > 0 else "short"

# 2. Confirm with Smart Money API before acting
sig = confirm("BTC", direction)
print(sig["action"], sig["confidence"], "size_mult", sig["size_mult"])

# 3. Act on the recommendation (CCXT executes; the API only advises)
if sig["action"] == "CONFIRM":
    base_qty = 0.01
    qty = base_qty * sig["size_mult"]          # scale by suggested multiplier
    # exchange.create_order("BTC/USDT", "market", direction, qty)
    print(f"Would place {direction} {qty} BTC/USDT")
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), 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.