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.