Skip to main content

Quickstart

1. Get an API key

Sign up at the moxie Dashboard to generate your API key. The free tier gives you 10 requests per minute and 5,000 requests per month -- enough to explore the API and build a prototype.

See Pricing for plan details.

2. Fetch a live USDTNGN rate

curl
curl -X GET "https://api.moxiemetrx.com/v1/rates/live?pairs=USDTNGN" \
-H "X-API-Key: your_key"
Python
import requests

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

if response.status_code == 429:
raise Exception(f"Rate limit hit. Retry after {response.headers['Retry-After']}s")

response.raise_for_status()
data = response.json()
print(f"USDTNGN rate: {data['rates'][0]['vwap']}")
JavaScript
const response = await fetch(
"https://api.moxiemetrx.com/v1/rates/live?pairs=USDTNGN",
{ headers: { "X-API-Key": "your_key" } }
);

if (response.status === 429) {
throw new Error(`Rate limit hit. Retry after ${response.headers.get("Retry-After")}s`);
}
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}

const data = await response.json();
console.log(`USDTNGN rate: ${data.rates[0].vwap}`);

Response:

{
"rates": [
{
"pair": "USDTNGN",
"vwap": 1416.25,
"timestamp": "2026-03-23T12:00:00Z",
"sources": [
{ "exchange": "quidax", "price": 1415.80, "volume": 52340.0 },
{ "exchange": "luno", "price": 1416.50, "volume": 78210.0 }
],
"freshness_seconds": 4
}
]
}

3. Fetch 30-day historical data at 1-hour intervals

curl
curl -X GET "https://api.moxiemetrx.com/v1/rates/historical?pair=USDTNGN&start=2026-02-21&end=2026-03-23&interval=1h" \
-H "X-API-Key: your_key"
Python
import requests

response = requests.get(
"https://api.moxiemetrx.com/v1/rates/historical",
params={
"pair": "USDTNGN",
"start": "2026-02-21",
"end": "2026-03-23",
"interval": "1h",
},
headers={"X-API-Key": "your_key"},
)

data = response.json()
print(f"Received {len(data['candles'])} hourly candles")
JavaScript
const params = new URLSearchParams({
pair: "USDTNGN",
start: "2026-02-21",
end: "2026-03-23",
interval: "1h",
});

const response = await fetch(
`https://api.moxiemetrx.com/v1/rates/historical?${params}`,
{
headers: { "X-API-Key": "your_key" },
}
);

const data = await response.json();
console.log(`Received ${data.candles.length} hourly candles`);

Response:

{
"pair": "USDTNGN",
"interval": "1h",
"candles": [
{
"timestamp": "2026-02-21T00:00:00Z",
"open": 1412.10,
"high": 1414.50,
"low": 1411.80,
"close": 1413.20,
"volume": 134520.0
}
]
}

Next steps