Skip to main content

Get Real-Time BTC/NGN Rates in Python (5 Lines of Code)

· 3 min read

Get a VWAP-aggregated BTC/NGN rate from 4 Nigerian exchanges in under 60 seconds. No SDK, no signup form, no credit card.

Step 1: Get a Free API Key

curl -X POST https://api.moxiemetrx.com/v1/auth/free-key \
-H "Content-Type: application/json" \
-d '{"customer_name": "my-app", "email": "you@email.com"}'

Response:

{
"api_key": "mx_test_abc123...",
"tier": "free",
"note": "Store this key securely - it cannot be retrieved again"
}

Save the key. You only see it once.

Step 2: Fetch Live Rates (Python)

import requests

r = requests.get(
"https://api.moxiemetrx.com/v1/rates/live",
params={"pairs": "BTCNGN"},
headers={"X-API-Key": "YOUR_KEY_HERE"},
)

print(r.json()["data"]["BTCNGN"]["rate"])
# Output: 93229084.006

That's it. Five lines. The response includes the VWAP rate aggregated from Luno, Quidax, Busha, and Ovex.

Step 3: See Where the Price Comes From

The response includes per-exchange source breakdown:

data = r.json()["data"]["BTCNGN"]

print(f"Rate: {data['rate']:,.0f} NGN")
print(f"Status: {data['status']}")
print(f"Freshness: {data['data_freshness_seconds']}s ago")

for source in data["sources"]:
print(f" {source['exchange']}: {source['rate']:,.0f} NGN")

Output:

Rate: 93,229,084 NGN
Status: verified
Freshness: 42s ago
busha: 91,537,890 NGN
luno: 93,513,829 NGN
ovex: 94,223,739 NGN
quidax: 93,640,878 NGN

Notice Busha is ~2% lower and Ovex ~1% higher than the VWAP. That spread is why multi-source aggregation matters.

Step 4: Multiple Pairs in One Call

Fetch NGN, ZAR, and KES rates in a single request:

r = requests.get(
"https://api.moxiemetrx.com/v1/rates/live",
params={"pairs": "BTCNGN,BTCZAR,BTCKES,USDTNGN"},
headers={"X-API-Key": "YOUR_KEY_HERE"},
)

for pair, info in r.json()["data"].items():
print(f"{pair}: {info['rate']:>15,.2f} ({info['status']})")

Output:

BTCNGN:  93,229,084.01  (verified)
BTCZAR: 1,150,670.09 (verified)
BTCKES: 8,639,208.76 (verified)
USDTNGN: 1,396.97 (verified)

One request. Multiple pairs. Counts as a single API call against your quota.

Step 5: Historical Data

Pull hourly candles for the last 3 days:

r = requests.get(
"https://api.moxiemetrx.com/v1/rates/historical",
params={
"pair": "BTCNGN",
"start": "2026-04-03",
"end": "2026-04-06",
"interval": "1h",
},
headers={"X-API-Key": "YOUR_KEY_HERE"},
)

candles = r.json()["data"]
print(f"{len(candles)} hourly candles")
print(f"Latest close: {candles[-1]['close']:,.0f} NGN")

JavaScript (Node.js)

const res = await fetch(
"https://api.moxiemetrx.com/v1/rates/live?pairs=BTCNGN,USDTNGN",
{ headers: { "X-API-Key": "YOUR_KEY_HERE" } }
);

const { data } = await res.json();
console.log(`BTC/NGN: ${data.BTCNGN.rate}`);

What You Get on the Free Tier

  • 5,000 requests/month (10/minute)
  • Live VWAP rates across 19 pairs
  • 30 days of historical data (1h, 1d intervals)
  • Verification status on every response
  • No credit card, no contract

Need 5-minute candles, CSV export, or confidence scores? Upgrade to Builder ($49/mo).

Prefer no code? Google Sheets FX Dashboard — get the same rates auto-refreshing in a spreadsheet, no programming required.

Full API Reference