ZimRate|API Docs
← Back to RatesGet API Key
v1 — Live

ZimRate API Reference

Official Zimbabwe exchange rates, inflation data, and gold prices as clean JSON — free tier, no credit card required.

Get your free API key →OpenAPI / Swagger ↗

Overview

The ZimRate API provides programmatic access to official interbank exchange rates, inflation statistics, and gold coin prices published by the Reserve Bank of Zimbabwe (RBZ). Data is scraped from the RBZ website multiple times per day and served as clean JSON.

Base URL

bash
https://zimrate.statotec.com/api/v1

All endpoints return JSON and support CORS for browser-based usage. Responses include Cache-Control headers — respect them to minimise unnecessary requests and avoid hitting rate limits.

Authentication

All /api/v1/* endpoints require an API key. Sign up free then create a named key from your dashboard. Keys are prefixed zr_.

Pass your key via the Authorization header (recommended) or the api_key query parameter:

bash
# Header (recommended)
curl "https://zimrate.statotec.com/api/v1/rates" \
  -H "Authorization: Bearer zr_your_api_key_here"

# Query parameter
curl "https://zimrate.statotec.com/api/v1/rates?api_key=zr_your_api_key_here"
Tip: Keep your API key secret — do not commit it to public repositories or expose it in client-side code.

Public endpoints (no key required): GET /api/v1/health and GET /api/v1/openapi.json.

Response Format

All successful responses use this envelope:

json
{
  "data": { ... },
  "meta": {
    "last_updated": "2026-03-19T08:30:00.000Z",
    "count": 5,
    "timestamp": "2026-03-19T10:15:30.123Z"
  }
}

Error responses:

json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "No rates found for pair: XYZ/ABC",
    "status": 404
  },
  "meta": {
    "timestamp": "2026-03-19T10:15:30.123Z"
  }
}

Common error codes:

UNAUTHORIZED401Missing or invalid API key
INVALID_PARAM400Bad query parameter value
NOT_FOUND404No data for the requested pair / type
RATE_LIMITED429Per-minute rate limit exceeded
DAILY_LIMIT_EXCEEDED429Daily quota reached
INTERNAL_ERROR500Server-side failure

Rate Limiting

Limits are enforced per API key on two dimensions:

TierRequests / minuteRequests / day
Free60100
Premium1,000Unlimited

Every authenticated response includes rate limit headers:

X-RateLimit-LimitPer-minute limit for your tier
X-RateLimit-RemainingRequests remaining this minute
X-RateLimit-ResetUnix timestamp of next window reset
X-Daily-LimitDaily cap (unlimited for premium)
X-Daily-RemainingRequests remaining today

Exceeding limits returns 429 with a Retry-After header. Daily counts reset at midnight UTC.

Health Check

GET/api/v1/health

Returns API and database connectivity status. No authentication required. Use this for uptime monitoring.

Response

json
{
  "data": {
    "status": "ok",
    "database": "connected",
    "db_latency_ms": 12,
    "db_time": "2026-03-19T10:15:30.123Z"
  },
  "meta": { "timestamp": "2026-03-19T10:15:30.123Z" }
}

Available Currencies

GET/api/v1/currencies

Returns all currency pairs with exchange rate data. Use this to discover valid values for the ?pair= parameter.

Response

json
{
  "data": {
    "currencies": ["EUR/ZWG", "GBP/ZWG", "USD/ZWG", "ZAR/ZWG"]
  },
  "meta": { "count": 4, "timestamp": "2026-03-19T10:15:30.123Z" }
}

Exchange Rates

GET/api/v1/rates

Returns the latest RBZ interbank exchange rates with optional day-over-day change data.

Parameters

pairstringdefault: all pairs
Filter by currency pair, e.g. USD/ZWG. Format: XXX/YYY. Case-insensitive.
include_previousbooleandefault: true
Set to false to omit previous-day comparison fields.

Example

bash
curl "https://zimrate.statotec.com/api/v1/rates?pair=USD/ZWG" \
  -H "Authorization: Bearer zr_your_api_key_here"

Response

json
{
  "data": {
    "rates": [
      {
        "currency_pair": "USD/ZWG",
        "bid": 13.54,
        "ask": 13.65,
        "avg": 13.60,
        "date_label": "19 March 2026",
        "previous_avg": 13.50,
        "change_pct": 0.7407
      }
    ]
  },
  "meta": {
    "last_updated": "2026-03-19T08:30:00.000Z",
    "count": 1,
    "timestamp": "2026-03-19T10:15:30.123Z"
  }
}

Rate History

GET/api/v1/rates/history

Returns daily rate averages for a currency pair, sorted chronologically. Ideal for charting rate trends.

Parameters

pairstringdefault: USD/ZWG
Currency pair in XXX/YYY format.
daysintegerdefault: 30
Number of days back. Integer between 1 and 365.

Example

bash
curl "https://zimrate.statotec.com/api/v1/rates/history?pair=USD/ZWG&days=7" \
  -H "Authorization: Bearer zr_your_api_key_here"

Response

json
{
  "data": {
    "pair": "USD/ZWG",
    "history": [
      { "date": "13 March 2026", "avg": 13.45, "scraped_at": "2026-03-13T08:00:00.000Z" },
      { "date": "17 March 2026", "avg": 13.52, "scraped_at": "2026-03-17T08:00:00.000Z" }
    ]
  },
  "meta": { "count": 2, "days": 7, "timestamp": "2026-03-19T10:15:30.123Z" }
}

Inflation

GET/api/v1/inflation

Returns the latest Zimbabwe inflation figures including MoM, YoY, and food/non-food breakdowns.

Parameters

typestringdefault: both
Filter by type: USD or ZWG.

Example

bash
curl "https://zimrate.statotec.com/api/v1/inflation?type=USD" \
  -H "Authorization: Bearer zr_your_api_key_here"

Response

json
{
  "data": {
    "inflation": [
      {
        "type": "USD",
        "mom": 0.5,
        "yoy": 3.2,
        "period": "February 2026",
        "cpi_index": 102.4,
        "food_yoy": 4.1,
        "food_mom": 0.6,
        "nonfood_yoy": 2.8,
        "nonfood_mom": 0.4
      }
    ]
  },
  "meta": {
    "last_updated": "2026-03-19T08:30:00.000Z",
    "count": 1,
    "timestamp": "2026-03-19T10:15:30.123Z"
  }
}

Gold Prices

GET/api/v1/gold

Returns the latest RBZ Mosi-oa-Tunya gold coin selling prices in multiple currencies.

Parameters

currencystringdefault: all currencies
Filter by currency code, e.g. USD, ZWG, ZAR. 2–4 letters. Case-insensitive.

Example

bash
curl "https://zimrate.statotec.com/api/v1/gold?currency=USD" \
  -H "Authorization: Bearer zr_your_api_key_here"

Response

json
{
  "data": {
    "gold": [
      { "currency": "USD", "selling_price": 2850.00, "prev_pm_fix": 2832.50 }
    ]
  },
  "meta": {
    "last_updated": "2026-03-19T08:30:00.000Z",
    "count": 1,
    "timestamp": "2026-03-19T10:15:30.123Z"
  }
}

Code Examples

Fetching the latest USD/ZWG rate in common languages:

curl

bash
curl "https://zimrate.statotec.com/api/v1/rates?pair=USD/ZWG" \
  -H "Authorization: Bearer zr_your_api_key_here"

JavaScript (fetch)

javascript
const res = await fetch("https://zimrate.statotec.com/api/v1/rates?pair=USD/ZWG", {
  headers: { "Authorization": "Bearer zr_your_api_key_here" },
});
const { data } = await res.json();
console.log(data.rates[0].avg); // e.g. 13.60

Python

python
import requests

res = requests.get(
    "https://zimrate.statotec.com/api/v1/rates",
    params={"pair": "USD/ZWG"},
    headers={"Authorization": "Bearer zr_your_api_key_here"},
)
print(res.json()["data"]["rates"][0]["avg"])  # e.g. 13.60

Go

go
req, _ := http.NewRequest("GET", "https://zimrate.statotec.com/api/v1/rates?pair=USD/ZWG", nil)
req.Header.Set("Authorization", "Bearer zr_your_api_key_here")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()

var result struct {
    Data struct {
        Rates []struct {
            Avg float64 `json:"avg"`
        } `json:"rates"`
    } `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result.Data.Rates[0].Avg) // e.g. 13.60

Data sourced from the Reserve Bank of Zimbabwe. ZimRate is an independent service — not affiliated with the RBZ or the Government of Zimbabwe. Privacy Policy · Terms of Service